-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
103 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Example usage of nemo automation framework + browserstack | ||
|
||
Install dependencies from within this directory `npm install` | ||
|
||
## Run against a local browser | ||
|
||
```shell | ||
$ node nemo.js | ||
``` | ||
|
||
## Run in the browserstack cloud | ||
|
||
Set browserstack environment variables as in the below shell example | ||
|
||
```shell | ||
$ export BSTK_USER=myusername1 | ||
$ export BSTK_KEY=aa4235ssdda | ||
$ export BSTK_BROWSER=chrome | ||
$ export BSTK_VERSION=22.0 | ||
``` | ||
|
||
Run node command with NODE_ENV=browserstack to engage the `browserstack.json` override | ||
|
||
```shell | ||
$ NODE_ENV=browserstack node nemo.js | ||
``` | ||
|
||
## For more information on nemo | ||
|
||
Go to https://nemo.js.org |
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,13 @@ | ||
{ | ||
"driver": { | ||
"builders": { | ||
"usingServer": ["http://hub.browserstack.com/wd/hub"], | ||
"withCapabilities": [{ | ||
"browserName": "env:BSTK_BROWSER", | ||
"browserstack.user": "env:BSTK_USER", | ||
"browserstack.key": "env:BSTK_KEY", | ||
"version": "env:BSTK_VERSION" | ||
}] | ||
} | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"driver": { | ||
"builders": { | ||
"withCapabilities": [{ | ||
"browserName": "firefox" | ||
}] | ||
} | ||
}, | ||
"plugins": { | ||
"view": { | ||
"module": "nemo-view", | ||
"arguments": ["path:locator"] | ||
} | ||
}, | ||
"data": { | ||
"baseUrl": "https://www.paypal.com" | ||
} | ||
} |
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,23 @@ | ||
var Nemo = require('nemo'); | ||
var nemo = Nemo(__dirname, function (err) { | ||
//always check for errors! | ||
if (!!err) { | ||
return console.error('Error during Nemo setup', err); | ||
} | ||
nemo.driver.getCapabilities(). | ||
then(function (caps) { | ||
console.log("Nemo successfully launched", caps.caps_.browserName); | ||
}); | ||
nemo.driver.get(nemo.data.baseUrl); | ||
nemo.view._waitVisible('#header-buttons #ul-btn').click(); | ||
nemo.view._waitVisible('#createAccount').click(); | ||
nemo.view._waitVisible('#personalSignUpForm').click(); | ||
nemo.view._waitVisible('#email').then(function () { | ||
console.log('loaded the signup form'); | ||
nemo.driver.quit(); | ||
}, function (err) { | ||
console.log('a funny thing happened on the way to the signup form'); | ||
console.error(err); | ||
nemo.driver.quit(); | ||
}); | ||
}); |
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,19 @@ | ||
{ | ||
"name": "nemo-browserstack-example", | ||
"version": "1.0.0", | ||
"description": "Nemo and Browserstack integration example", | ||
"main": "nemo.js", | ||
"scripts": { | ||
"test": "node nemo.js" | ||
}, | ||
"keywords": [ | ||
"Nemo", | ||
"selenium-webdriver", | ||
"browserstack" | ||
], | ||
"author": "Matt Edelman <[email protected]>", | ||
"dependencies": { | ||
"nemo": "^1.0.6", | ||
"nemo-view": "^1.2.0" | ||
} | ||
} |