-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: functional test framework using CodeceptJS #628
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2564f8e
Update: box-annotations to v0.11.1
DanDeMicco 60dcdc2
Merge remote-tracking branch 'upstream/master'
DanDeMicco f356276
Merge remote-tracking branch 'upstream/master'
DanDeMicco 65aae45
Chore: functional test framework using CodeceptJS
DanDeMicco f2c6f44
Chore: support environment variables for browser
DanDeMicco 372417e
Chore: add more configuration via environement variables
DanDeMicco b80eaa0
Chore: add download functional test
DanDeMicco 2b8ed2b
Merge branch 'master' into codeceptjs
DanDeMicco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ reports | |
dist | ||
src/i18n/json | ||
jsconfig.json | ||
functional-tests/output |
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,6 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- '6' | ||
- '8' | ||
stages: | ||
- ci | ||
- name: sauce-labs | ||
|
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,60 @@ | ||
const DEFAULT_WAIT_TIME = 10000; // 10 seconds | ||
const { | ||
SAUCE_USERNAME, | ||
SAUCE_ACCESS_KEY, | ||
TRAVIS_JOB_NUMBER, | ||
CI, | ||
BROWSER_NAME = 'chrome', | ||
BROWSER_VERSION = 'latest', | ||
BROWSER_PLATFORM | ||
} = process.env; | ||
|
||
// Local selenium config | ||
const webDriverIOlocal = { | ||
url: 'http://localhost:8000', | ||
browser: 'chrome', | ||
smartWait: DEFAULT_WAIT_TIME, | ||
restart: false, | ||
waitForTimeout: DEFAULT_WAIT_TIME | ||
}; | ||
|
||
// CI saucelabs config | ||
const WebDriverIO = | ||
typeof SAUCE_USERNAME === 'undefined' | ||
? webDriverIOlocal | ||
: Object.assign({}, webDriverIOlocal, { | ||
host: 'ondemand.saucelabs.com', | ||
port: 80, | ||
user: SAUCE_USERNAME, | ||
key: SAUCE_ACCESS_KEY, | ||
desiredCapabilities: { | ||
'tunnel-identifier': TRAVIS_JOB_NUMBER, | ||
browserName: BROWSER_NAME, | ||
version: BROWSER_VERSION, | ||
platform: BROWSER_PLATFORM, | ||
chromeOptions: { | ||
args: ['--disable-web-security'] | ||
} | ||
} | ||
}); | ||
|
||
// Local saucelabs config | ||
if (!CI) { | ||
Object.assign(WebDriverIO, { | ||
host: 'localhost', | ||
port: 4445 | ||
}); | ||
} | ||
|
||
exports.config = { | ||
tests: './functional-tests/*_test.js', | ||
timeout: DEFAULT_WAIT_TIME, | ||
output: './functional-tests/output', | ||
helpers: { | ||
WebDriverIO | ||
}, | ||
include: {}, | ||
bootstrap: false, | ||
mocha: {}, | ||
name: 'box-content-preview' | ||
}; |
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 @@ | ||
{ | ||
"extends": [ | ||
"../.eslintrc" | ||
], | ||
"globals": { | ||
"Feature" : false, | ||
"Before" : false, | ||
"Scenario" : 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Running tests locally | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
|
||
## Saucelabs | ||
1) Download the [saucelabs proxy](https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy) | ||
2) Run ```yarn functional-tests``` to start a local server on localhost:8000 | ||
3) Run the proxy ```./bin/sc -u SAUCELABS_USER_NAME -k SAUCELABS_ACCESS_KEY -N -i test``` to allow saucelabs to access your localhost | ||
4) Run the tests | ||
```SAUCE_USERNAME=SAUCELABS_USER_NAME SAUCE_ACCESS_KEY=SAUCELABS_ACCESS_KEY TRAVIS_JOB_NUMBER=TUNNEL_ID node ./node_modules/codeceptjs/bin/codecept.js run --verbose``` where SAUCE_USERNAME, SAUCELABS_ACCESS_KEY can be found in saucelabs website. TUNNEL_ID is a unique identifier such as your username. | ||
|
||
## local selenium and browser testing (without saucelabs) | ||
Make sure selenium webdriver is running and run ```node ./node_modules/codeceptjs/bin/codecept.js run --verbose``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature('Sanity'); | ||
const bpLoaded = '.bp-loaded'; | ||
|
||
Before((I) => { | ||
I.amOnPage('/functional-tests/index.html'); | ||
}); | ||
|
||
Scenario('Sanity test @ci', (I) => { | ||
I.waitForElement(bpLoaded); | ||
I.waitForVisible(bpLoaded); | ||
I.waitForText('The Content Platform for Your Apps'); | ||
}); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any repercussions from this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremypress we will have to update to node 8, which is pretty widely adopted at Box. I have also been using node 8 for the past few days and it has been fine.