-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: No client side tests (#1001)
Solution: Implement webdriverio + headless chrome client side tests in Travis CI and include an example test for the home page. (`homepage.spec.js`)
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const assert = require('assert') | ||
|
||
const baseUrl = 'http://localhost:3000' // baseUrl of the app we are testing, it's localhost here, as we're starting a local server in Travis CI cycle | ||
|
||
// see the full webdriverio browser API here: http://webdriver.io/api.html | ||
describe('Home page', function () { | ||
it('Currencies should render properly', function () { | ||
browser.url(`${baseUrl}/`) // navigate to the home route `/` | ||
browser.pause(2000) // let it load, wait for 2 seconds | ||
assert(browser.isExisting('.currency-card'), true) // check if at least one currency card has rendered, isExisting === $() !== undefined | ||
assert(browser.isVisible('.currency-card'), true) // check if at least one currency card is visible on the page isVisible === $().is(':visible') | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,27 @@ | ||
exports.config = { | ||
specs: ['./imports/**/*.ui-test.js'], | ||
exclude: [], | ||
maxInstances: 10, | ||
capabilities: [{ | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
args: ['--headless', '--disable-gpu', '--window-size=1280,800'], | ||
binary: '/usr/bin/google-chrome-stable' | ||
} | ||
}], | ||
sync: true, | ||
logLevel: 'silent', | ||
coloredLogs: true, | ||
deprecationWarnings: true, | ||
bail: 0, | ||
screenshotPath: './screens/', | ||
baseUrl: 'http://localhost:3000', | ||
waitforTimeout: 10000, | ||
connectionRetryTimeout: 90000, | ||
connectionRetryCount: 3, | ||
framework: 'mocha', | ||
reporters: ['dot'], | ||
mochaOpts: { | ||
ui: 'bdd' | ||
} | ||
} |