This repository has been archived by the owner on May 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add npm script to kick off functional tests
- Loading branch information
Showing
8 changed files
with
119 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
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 |
---|---|---|
|
@@ -13,10 +13,13 @@ | |
"check-style": "/bin/bash -c '[[ $(npm ls cloudgov-style) =~ \"git://github.com\" ]] && npm run build-style || exit 0'", | ||
"clean": "rm -rf ./static/assets/*", | ||
"lint": "eslint --ext .js --ext .jsx ./static_src", | ||
"test": "export NODE_ENV=test && npm run lint && karma start --single-run", | ||
"test": "npm run lint && npm run test-karma && npm run test-functional", | ||
"test-functional": "NODE_ENV=test wdio wdio.conf.js", | ||
"test-karma": "NODE_ENV=test karma start --single-run", | ||
"test-selenium-install": "selenium-standalone install --drivers.phantomjs", | ||
"testing-server": "node ./static_src/test/server/server.js", | ||
"watch-server": "npm run testing-server & npm run watch", | ||
"watch-test": "export NODE_ENV=test && karma start --browsers Chrome", | ||
"watch-test": "NODE_ENV=test karma start --browsers Chrome", | ||
"watch": "webpack --watch" | ||
}, | ||
"author": "Marco Segreto ([email protected])", | ||
|
@@ -101,7 +104,12 @@ | |
"enzyme": "^2.7.0", | ||
"eslint-plugin-jasmine": "^2.2.0", | ||
"jasmine-enzyme": "^2.1.0", | ||
"phantomjs": "^2.1.7", | ||
"react-addons-test-utils": "^15.4.2", | ||
"react-dom": "^15.4.2" | ||
"react-dom": "^15.4.2", | ||
"selenium-standalone": "^5.11.0", | ||
"wdio-jasmine-framework": "^0.2.19", | ||
"wdio-selenium-standalone-service": "0.0.7", | ||
"webdriverio": "^4.6.1" | ||
} | ||
} |
File renamed without changes.
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,7 @@ | ||
{ | ||
"extends": "../.eslintrc", | ||
"globals": { | ||
"browser": true, | ||
"sinon": true | ||
} | ||
} |
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,28 @@ | ||
/* eslint-disable jasmine/no-global-setup */ | ||
import testServer from '../server'; | ||
|
||
// Using promises here to work around this bug https://github.com/webdriverio/wdio-jasmine-framework/issues/28 | ||
beforeAll('start test server', function () { | ||
return new Promise((resolve, reject) => { | ||
testServer.start(err => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
|
||
return resolve(); | ||
}); | ||
}); | ||
}); | ||
|
||
afterAll('stop test server', function () { | ||
return new Promise((resolve, reject) => { | ||
const timeout = 5000; | ||
testServer.stop(timeout, err => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
|
||
return resolve(); | ||
}); | ||
}); | ||
}); |
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,7 @@ | ||
|
||
describe('Overview page', function () { | ||
it('navigates to page', function () { | ||
browser.url('http://localhost:8000/'); | ||
expect(browser.getTitle()).toBe('cloud.gov dashboard'); | ||
}); | ||
}); |
File renamed without changes.
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,40 @@ | ||
exports.config = { | ||
specs: [ | ||
'./static_src/test/functional/**/*.spec.js' | ||
], | ||
|
||
capabilities: [{ | ||
browserName: 'phantomjs' | ||
}], | ||
|
||
sync: true, | ||
logLevel: 'error', | ||
coloredLogs: true, | ||
|
||
// If you only want to run your tests until a specific amount of tests have failed use | ||
// bail (default is 0 - don't bail, run all tests). | ||
bail: 0, | ||
|
||
// Saves a screenshot to a given path if a command fails. | ||
screenshotPath: './screenshots/', | ||
|
||
// Set a base URL in order to shorten url command calls. If your url parameter starts | ||
// with "/", then the base url gets prepended. | ||
baseUrl: 'http://localhost:8000', | ||
|
||
// Default timeout for all waitFor* commands. | ||
waitforTimeout: 10000, | ||
|
||
// Default timeout in milliseconds for request | ||
// if Selenium Grid doesn't send response | ||
connectionRetryTimeout: 90000, | ||
|
||
// Default request retries count | ||
connectionRetryCount: 3, | ||
|
||
services: ['selenium-standalone'], | ||
framework: 'jasmine', | ||
jasmineNodeOpts: { | ||
defaultTimeoutInterval: 10000 | ||
} | ||
}; |