Skip to content

Commit

Permalink
feat: use headless chromium and circle ci for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNech committed Oct 8, 2019
1 parent e96a8c0 commit 1523b2c
Show file tree
Hide file tree
Showing 6 changed files with 874 additions and 32 deletions.
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:8.6.0-browsers

steps:
- checkout

- run: npm install

- run:
name: Download Selenium
command: sudo npm install selenium-standalone@latest -g
- run:
name: Start Selenium
command: selenium-standalone install && selenium-standalone start
background: true

- run:
name: Unit tests
command: npm test

- run:
name: Functional tests
command: npm run test-func

- store_artifacts:
path: hermione-report/
destination: /hermione-report
22 changes: 8 additions & 14 deletions .hermione.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,8 @@ global.assert = chai.assert;
const serverPort = 8080;
const fixturesPath = 'test/func/fixtures/report';

const getGridUrl = () => {
const {SAUCE_USERNAME, SAUCE_ACCESS_KEY} = process.env;

if (SAUCE_USERNAME && SAUCE_ACCESS_KEY) {
return `http://${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY}@ondemand.saucelabs.com/wd/hub`;
}

console.warn('No "SAUCE_USERNAME" and "SAUCE_ACCESS_KEY" env was found. Local grid will be used.');

return 'http://localhost:4444/wd/hub';
};

module.exports = {
baseUrl: `http://localhost:${serverPort}/${fixturesPath}/index.html`,
gridUrl: getGridUrl(),

screenshotsDir: 'test/func/main/screens',

Expand All @@ -38,7 +25,10 @@ module.exports = {
windowSize: '1280x1024',
desiredCapabilities: {
browserName: 'chrome',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
chromeOptions: {
mobileEmulation: {deviceMetrics: {pixelRatio: 1}}
}
}
}
},
Expand All @@ -52,6 +42,10 @@ module.exports = {
enabled: true,
path: 'hermione-report',
scaleImages: true
},
'hermione-headless-chrome': {
browserId: 'chrome',
version: '77'
}
}
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Run [hermione](https://github.com/gemini-testing/hermione) (integration) tests:
npm run test-func
```

Before run integration tests on local machine you should run [sauce-connect](https://wiki.saucelabs.com/display/DOCS/Basic+Sauce+Connect+Proxy+Setup)
Integration tests run on Chromium in headless mode.

## Api

Expand Down
Loading

0 comments on commit 1523b2c

Please sign in to comment.