forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update examples - closes webdriverio#2087
1 parent
58ce564
commit 6c5004b
Showing
18 changed files
with
62 additions
and
109 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
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,4 +1,3 @@ | ||
# Commands | ||
|
||
All files inside this directory demonstrate how some commands can get used. To run these examples just | ||
execute them with node. | ||
All files inside this directory demonstrate how some commands can get used. To run these examples just execute them with node. |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
searchWebdriverIO: function (searchString) { | ||
return this | ||
.url('http://webdriver.io') | ||
.setValue('.ds-input', searchString) | ||
.pause(1000) | ||
.keys(['Enter']) //press Enter Key | ||
.pause(1000); | ||
} | ||
}; |
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,20 +1,21 @@ | ||
var webdriverio = require('../../build/index'); | ||
var helper = require('./webdriverio.externalAddCommandHelper'); | ||
var helper = require('./helpers/externalAddCommandHelper'); | ||
|
||
var options = { | ||
var client = webdriverio.remote({ | ||
desiredCapabilities: { | ||
browserName: 'chrome' | ||
} | ||
}; | ||
var client = webdriverio.remote(options); | ||
client.addCommand('searchGoogle',helper.searchGoogle.bind(client)); | ||
}); | ||
|
||
var SearchString = 'webdriver.io'; | ||
client.addCommand('searchWebdriverIO', helper.searchWebdriverIO.bind(client)); | ||
|
||
var SearchString = 'click'; | ||
|
||
client | ||
.init() | ||
.searchGoogle(SearchString) //external helper function | ||
.title(function(err, res) { | ||
console.log('Title was: ' + res.value); | ||
.searchWebdriverIO(SearchString) //external helper function | ||
.getTitle().then(function(title) { | ||
console.log('Title was: ' + title); | ||
}) | ||
.end(); | ||
.end() | ||
.catch((e) => console.log(e)); |
This file was deleted.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.