ember-cli-page-object
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -32,3 +32,4 @@ import Ember from 'ember'; | ||
Ember.Logger.error(fullErrorMessage); | ||
throw new Ember.Error(fullErrorMessage); | ||
} |
@@ -10,2 +10,3 @@ import { text } from './properties/text'; | ||
import { as } from './properties/as'; | ||
import wait from 'ember-test-helpers/wait'; | ||
@@ -15,4 +16,3 @@ const thenDescriptor = { | ||
value() { | ||
/* global wait */ | ||
return wait().then(...arguments); | ||
return (window.wait || wait)().then(...arguments); | ||
} | ||
@@ -19,0 +19,0 @@ }; |
@@ -24,4 +24,3 @@ import { | ||
runAsync(cb) { | ||
/* global wait */ | ||
wait().then(() => { | ||
window.wait().then(() => { | ||
cb(this); | ||
@@ -28,0 +27,0 @@ }); |
@@ -34,2 +34,14 @@ import { assign, buildSelector, findClosestValue } from '../helpers'; | ||
* | ||
* // <input class="name"> | ||
* // <input class="email"> | ||
* | ||
* const page = PageObject.create({ | ||
* keydown: triggerable('keypress', '.name') | ||
* }); | ||
* | ||
* // triggers keypress using enter key on element with selector '.name' | ||
* page.keydown({ which: 13 }); | ||
* | ||
* @example | ||
* | ||
* // <div class="scope"> | ||
@@ -59,3 +71,3 @@ * // <input class="name"> | ||
* | ||
* // clicks on element with selector '.scope button.continue' | ||
* // focuses on element with selector '.scope .name' | ||
* page.focus(); | ||
@@ -80,13 +92,15 @@ * | ||
get(key) { | ||
return function() { | ||
let executionContext = getExecutionContext(this); | ||
let options = assign({ pageObjectKey: `${key}()` }, userOptions); | ||
return function(eventProperties = {}) { | ||
const executionContext = getExecutionContext(this); | ||
const options = assign({ pageObjectKey: `${key}()` }, userOptions); | ||
const staticEventProperties = assign({}, options.eventProperties); | ||
return executionContext.runAsync((context) => { | ||
let fullSelector = buildSelector(this, selector, options); | ||
let container = options.testContainer || findClosestValue(this, 'testContainer'); | ||
const fullSelector = buildSelector(this, selector, options); | ||
const container = options.testContainer || findClosestValue(this, 'testContainer'); | ||
context.assertElementExists(fullSelector, options); | ||
context.triggerEvent(fullSelector, container, event, options.eventProperties); | ||
const mergedEventProperties = assign(staticEventProperties, eventProperties); | ||
context.triggerEvent(fullSelector, container, event, mergedEventProperties); | ||
}); | ||
@@ -93,0 +107,0 @@ }; |
export { alias } from './-private/properties/alias'; | ||
export { getter } from './-private/properties/getter'; |
{ | ||
"name": "ember-cli-page-object", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "This ember-cli addon eases the construction of page objects on your acceptance and integration tests", | ||
@@ -13,3 +13,2 @@ "homepage": "http://ember-cli-page-object.js.org", | ||
"build": "ember build", | ||
"preversion": "git clean -df && npm test", | ||
"start": "ember server", | ||
@@ -32,2 +31,3 @@ "test": "ember try:each", | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.13.1", | ||
"documentation": "^3.0.4", | ||
@@ -39,2 +39,3 @@ "ember-ajax": "^2.4.1", | ||
"ember-cli-blueprint-test-helpers": "0.13.0", | ||
"ember-cli-code-coverage": "0.3.12", | ||
"ember-cli-dependency-checker": "^1.3.0", | ||
@@ -91,2 +92,3 @@ "ember-cli-doc-server": "1.1.0", | ||
"ember-cli-version-checker": "^1.2.0", | ||
"ember-test-helpers": "^0.6.3", | ||
"rsvp": "^3.2.1" | ||
@@ -93,0 +95,0 @@ }, |
@@ -108,2 +108,3 @@ # Ember Page Objects | ||
[![Code Climate](https://codeclimate.com/github/san650/ember-cli-page-object/badges/gpa.svg)](https://codeclimate.com/github/san650/ember-cli-page-object) | ||
[![Coverage Status](https://coveralls.io/repos/github/san650/ember-cli-page-object/badge.svg?branch=master)](https://coveralls.io/github/san650/ember-cli-page-object?branch=master) | ||
@@ -115,2 +116,3 @@ ### Maintainers | ||
- Jerad Gallinger (@jeradg) | ||
- Anna Andresian (@magistrula) | ||
@@ -117,0 +119,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2079554
142
3510
122
13
35
+ Addedember-test-helpers@^0.6.3
+ Addedember-test-helpers@0.6.3(transitive)