Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixed #2489 - api commands throwing TypeError when called inside page…
… section custom commands
- Loading branch information
1 parent
237d61f
commit 49ccb2c
Showing
6 changed files
with
104 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 30 additions & 29 deletions
59
test/extra/pageobjects/pages/simplePageObjWithCommandsObject.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
const commonCommands = { | ||
dropdownSelect() { | ||
return this; | ||
}, | ||
|
||
dropdownSelectByText() { | ||
return this; | ||
}, | ||
|
||
scrollToElement() { | ||
return this; | ||
} | ||
}; | ||
|
||
const testCommands = { | ||
...commonCommands, | ||
|
||
testCommand() { | ||
return this; | ||
} | ||
}; | ||
|
||
const o = { | ||
module.exports = { | ||
url: 'http://localhost.com', | ||
elements: { | ||
loginAsString: '#weblogin', | ||
loginCss: {selector: '#weblogin'}, | ||
loginIndexed: {selector: '#weblogin', index: 1}, | ||
loginXpath: {selector: '//weblogin', locateStrategy: 'xpath'}, | ||
loginId: {selector: 'weblogin', locateStrategy: 'id'} | ||
loginIndexed: { | ||
selector: '#weblogin', | ||
index: 1 | ||
}, | ||
loginXpath: { | ||
selector: '//weblogin', | ||
locateStrategy: 'xpath' | ||
}, | ||
loginId: { | ||
selector: 'weblogin', | ||
locateStrategy: 'id' | ||
} | ||
}, | ||
commands: testCommands | ||
}; | ||
commands: { | ||
dropdownSelect() { | ||
return this; | ||
}, | ||
|
||
module.exports = o; | ||
dropdownSelectByText() { | ||
return this; | ||
}, | ||
|
||
scrollToElement() { | ||
return this; | ||
}, | ||
|
||
testCommand() { | ||
return this; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters