Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
[20] Updated initialization of child Element
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelena Rybakova committed May 31, 2021
1 parent af0b429 commit 5a19cc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export default class Element {
this.page = elementPage
}

newChildElement(childSelector) {
newChildElement(childSelector, childElementPage = page) {
var isXPathSlector = (selector) => selector.startsWith("//");
if (isXPathSlector(this.selector) != isXPathSlector(childSelector)) {
throw "Cannot combine different selectors types!";
}
return new Element(`${this.selector} ${childSelector}`);
return new Element(`${this.selector} ${childSelector}`, childElementPage);
}

async wait(timeout = defaultTimeout) {
Expand Down

0 comments on commit 5a19cc1

Please sign in to comment.