Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Acceptance tests!! Runs automatically with pushes/pull requests
Uses Sauce Labs integration within Travis. Next we will use the npm module so that we can run the tests via Grunt. Documentation to come.
- Loading branch information
1 parent
30f9f02
commit 891c75a
Showing
7 changed files
with
122 additions
and
3 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 |
---|---|---|
|
@@ -8,4 +8,6 @@ config.php | |
composer.lock | ||
vendor/composer | ||
vendor/krinkle | ||
vendor/autoload.php | ||
vendor/autoload.php | ||
reports/ | ||
*.jar |
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,10 +1,22 @@ | ||
language: php | ||
php: | ||
- 5.5 | ||
node_js: | ||
- 4.3.0 | ||
before_script: | ||
- nvm install 5.6.0 | ||
- nvm use 5.6.0 | ||
- npm install -g grunt-cli | ||
- npm install | ||
- sudo apt-get install apache2 | ||
- sudo a2enmod actions | ||
- sudo a2enmod rewrite | ||
- echo "export PATH=/home/vagrant/.phpenv/bin:$PATH" | sudo tee -a /etc/apache2/envvars > /dev/null | ||
- echo "$(curl -fsSL https://gist.github.com/roderik/16d751c979fdeb5a14e3/raw/gistfile1.txt)" | sudo tee /etc/apache2/conf.d/phpconfig > /dev/null | ||
- echo "$(curl -fsSL https://gist.github.com/roderik/2eb301570ed4a1f4c33d/raw/gistfile1.txt)" | sed -e "s,PATH,`pwd`/public_html,g" | sudo tee /etc/apache2/sites-available/default > /dev/null | ||
- sudo service apache2 restart | ||
script: | ||
- eslint -c .eslintrc javascripts/ | ||
- ./nightwatch --env saucelabs | ||
addons: | ||
sauce_connect: | ||
username: "MusikAnimal" | ||
access_key: "71bb4995-3679-4b53-89d3-9d1516da1089" |
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,2 @@ | ||
#!/usr/bin/env node | ||
require('nightwatch/bin/runner.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"src_folders" : ["tests"], | ||
"output_folder" : "reports", | ||
"custom_commands_path" : "", | ||
"custom_assertions_path" : "", | ||
"page_objects_path" : "", | ||
"globals_path" : "", | ||
|
||
"selenium" : { | ||
"start_process" : false, | ||
"server_path" : "", | ||
"log_path" : "", | ||
"host" : "127.0.0.1", | ||
"port" : 4444, | ||
"cli_args" : { | ||
"webdriver.chrome.driver" : "" | ||
} | ||
}, | ||
|
||
"test_settings" : { | ||
"default" : { | ||
"launch_url" : "http://localhost/pageviews", | ||
"selenium_port" : 4444, | ||
"selenium_host" : "localhost", | ||
"silent": true, | ||
"screenshots" : { | ||
"enabled" : false, | ||
"path" : "" | ||
}, | ||
"desiredCapabilities": { | ||
"browserName": "firefox", | ||
"javascriptEnabled": true, | ||
"acceptSslCerts": true | ||
} | ||
}, | ||
"saucelabs" : { | ||
"launch_url" : "http://127.0.0.1/pageviews", | ||
"selenium_host": "ondemand.saucelabs.com", | ||
"selenium_port": 80, | ||
"username": "MusikAnimal", | ||
"access_key": "71bb4995-3679-4b53-89d3-9d1516da1089", | ||
"use_ssl" : false, | ||
"silent": true, | ||
"output" : true, | ||
"desiredCapabilities": { | ||
"name": "test-example", | ||
"browserName": "firefox" | ||
}, | ||
"selenium" : { | ||
"start_process" : false | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const moment = require('moment'); | ||
const _ = require('underscore'); | ||
|
||
module.exports = { | ||
'Page loads with defaults when given no params' : function (client) { | ||
client | ||
.url('http://localhost/pageviews') | ||
.waitForElementPresent('canvas', 10000); | ||
|
||
const startDate = moment().subtract(20, 'days').format('M/D/YYYY'), | ||
endDate = moment().subtract(1, 'days').format('M/D/YYYY'), | ||
dateStr = `${startDate} - ${endDate}`; | ||
|
||
client.expect.element('#range-input').to.have.value.that.equals(dateStr); | ||
client.expect.element('.aqs-project-input').to.have.value.that.equals('en.wikipedia.org'); | ||
client.expect.element('#platform-select').to.have.value.that.equals('all-access'); | ||
client.expect.element('#agent-select').to.have.value.that.equals('user'); | ||
client.expect.element('.select2-selection__rendered').to.have.text.that.matches(/×Cat\n.*×Dog/m); | ||
client.expect.element('#chart-legend').to.have.text.that.matches(/\bCat\b.*\bDog\b/); | ||
client.end(); | ||
}, | ||
'Page loads with values and text matching given params' : function(client) { | ||
client | ||
.url('http://localhost/pageviews#start=2016-01-01&end=2016-01-10&project=en.wikivoyage.org&pages=Europe|Asia&platform=desktop&agent=spider') | ||
.waitForElementPresent('canvas', 10000); | ||
|
||
client.expect.element('#range-input').to.have.value.that.equals('1/1/2016 - 1/10/2016'); | ||
client.expect.element('.aqs-project-input').to.have.value.that.equals('en.wikivoyage.org'); | ||
client.expect.element('#platform-select').to.have.value.that.equals('desktop'); | ||
client.expect.element('#agent-select').to.have.value.that.equals('spider'); | ||
client.expect.element('.select2-selection__rendered').to.have.text.that.matches(/Europe\n.*Asia/m); | ||
client.expect.element('#chart-legend').to.have.text.that.matches(/\bEurope\b.*\bAsia\b/); | ||
client.end(); | ||
} | ||
}; |
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 @@ | ||
module.exports = { | ||
'Invalid project shows error and disables form' : function (browser) { | ||
browser | ||
.url('http://localhost/pageviews') | ||
.waitForElementVisible('body', 1000) | ||
.setValue('.aqs-project-input', ['en.nonexistent.org', browser.Keys.TAB]) | ||
.pause(1000) | ||
.assert.containsText('.error-message', 'en.nonexistent.org') | ||
.assert.cssClassPresent('.select2-selection--multiple', 'disabled') | ||
.assert.elementNotPresent('canvas') | ||
.end(); | ||
} | ||
}; |