Skip to content

Commit

Permalink
ExecutionContext: remove assertElementExists
Browse files Browse the repository at this point in the history
as not needed anymore
  • Loading branch information
ro0gr committed Oct 29, 2019
1 parent 2273504 commit 3015c73
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 62 deletions.
14 changes: 0 additions & 14 deletions addon-test-support/-private/execution_context/acceptance.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,6 @@ AcceptanceExecutionContext.prototype = {
$selection.blur();
},

assertElementExists(selector, options) {
/* global find */
let result = find(selector, options.testContainer || findClosestValue(this.pageObjectNode, 'testContainer'));

if (result.length === 0) {
throwBetterError(
this.pageObjectNode,
options.pageObjectKey,
ELEMENT_NOT_FOUND,
{ selector }
);
}
},

find(selector, options) {
let result;

Expand Down
20 changes: 0 additions & 20 deletions addon-test-support/-private/execution_context/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,6 @@ IntegrationExecutionContext.prototype = {
$selection.blur();
},

assertElementExists(selector, options) {
let result;
let container = options.testContainer || findClosestValue(this.pageObjectNode, 'testContainer');

if (container) {
result = $(selector, container);
} else {
result = this.testContext.$(selector);
}

if (result.length === 0) {
throwBetterError(
this.pageObjectNode,
options.pageObjectKey,
ELEMENT_NOT_FOUND,
{ selector }
);
}
},

find(selector, options) {
let result;
let container = options.testContainer || findClosestValue(this.pageObjectNode, 'testContainer');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,6 @@ ExecutionContext.prototype = {
blur(element);
},

assertElementExists(selector, options) {
let container = options.testContainer || findClosestValue(this.pageObjectNode, 'testContainer');

let result = this.$(selector, container);

if (result.length === 0) {
throwBetterError(
this.pageObjectNode,
options.pageObjectKey,
ELEMENT_NOT_FOUND,
{ selector }
);
}
},

find(selector, options) {
let container = options.testContainer || findClosestValue(this.pageObjectNode, 'testContainer');

Expand Down
13 changes: 0 additions & 13 deletions addon-test-support/-private/execution_context/rfc268.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,6 @@ ExecutionContext.prototype = {
return this.invokeHelper(selector, options, blur);
},

assertElementExists(selector, options) {
let result = this.getElements(selector, options);

if (result.length === 0) {
throwBetterError(
this.pageObjectNode,
options.pageObjectKey,
ELEMENT_NOT_FOUND,
{ selector }
);
}
},

find(selector, options) {
selector = buildSelector(this.pageObjectNode, selector, options);
let result = this.getElements(selector, options);
Expand Down

0 comments on commit 3015c73

Please sign in to comment.