Skip to content

Commit

Permalink
adding nemo/browserstack example
Browse files Browse the repository at this point in the history
  • Loading branch information
grawk committed Jun 17, 2015
1 parent 3c08ca8 commit 95bc56d
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
30 changes: 30 additions & 0 deletions nemo/README.md
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
13 changes: 13 additions & 0 deletions nemo/config/browserstack.json
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"
}]
}
}
}
18 changes: 18 additions & 0 deletions nemo/config/config.json
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"
}
}
23 changes: 23 additions & 0 deletions nemo/nemo.js
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();
});
});
19 changes: 19 additions & 0 deletions nemo/package.json
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"
}
}

0 comments on commit 95bc56d

Please sign in to comment.