Merge pull request #1227 from jrbenny35/run-download-tests-on-ci
Update config for running download tests on CI
This commit is contained in:
commit
677ff65e8d
6 changed files with 43 additions and 9 deletions
|
@ -35,8 +35,7 @@ jobs:
|
|||
path: coverage
|
||||
integration_tests:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
- image: selenium/standalone-firefox
|
||||
- image: circleci/node:10-browsers
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
@ -46,7 +45,9 @@ jobs:
|
|||
key: send-int-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- node_modules
|
||||
- run: npm run circleci-test-integration
|
||||
- run:
|
||||
name: Run integration test
|
||||
command: ./scripts/bin/run-integration-test-circleci.sh
|
||||
deploy_dev:
|
||||
machine: true
|
||||
steps:
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
"wdio-firefox-profile-service": "^0.1.3",
|
||||
"wdio-mocha-framework": "^0.6.3",
|
||||
"wdio-sauce-service": "^0.4.14",
|
||||
"wdio-selenium-standalone-service": "0.0.12",
|
||||
"wdio-spec-reporter": "^0.1.5",
|
||||
"webdriverio": "^4.14.3",
|
||||
"webpack": "4.28.4",
|
||||
|
@ -152,6 +153,7 @@
|
|||
"node-fetch": "^2.3.0",
|
||||
"raven": "^2.6.4",
|
||||
"redis": "^2.8.0",
|
||||
"selenium-standalone": "^6.15.6",
|
||||
"ua-parser-js": "^0.7.19",
|
||||
"websocket-stream": "^5.1.2"
|
||||
},
|
||||
|
|
28
scripts/bin/run-integration-test-circleci.sh
Executable file
28
scripts/bin/run-integration-test-circleci.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
GECKODRIVER_URL=$(
|
||||
curl -s 'https://api.github.com/repos/mozilla/geckodriver/releases/latest' |
|
||||
python -c "import sys, json; r = json.load(sys.stdin); print([a for a in r['assets'] if 'linux64' in a['name']][0]['browser_download_url']);"
|
||||
);
|
||||
|
||||
|
||||
curl -L -o geckodriver.tar.gz $GECKODRIVER_URL
|
||||
gunzip -c geckodriver.tar.gz | tar xopf -
|
||||
chmod +x geckodriver
|
||||
sudo mv geckodriver /bin
|
||||
geckodriver --version
|
||||
# Install pip
|
||||
sudo apt-get install python-pip
|
||||
sudo pip install --upgrade pip
|
||||
|
||||
sudo pip install mozdownload mozinstall==1.15
|
||||
|
||||
mkdir -p ~/project/firefox-downloads/
|
||||
find ~/project/firefox-downloads/ -type f -mtime +90 -delete
|
||||
mozdownload --version latest --type daily --destination ~/project/firefox-downloads/firefox_nightly/
|
||||
|
||||
export PATH=~/project/firefox:$PATH
|
||||
mozinstall $(ls -t firefox-downloads/firefox_nightly/*.tar.bz2 | head -1)
|
||||
firefox --version
|
||||
npm run circleci-test-integration
|
|
@ -51,9 +51,10 @@ describe('Firefox Send', function() {
|
|||
browser.waitForExist(downloadPage.downloadComplete);
|
||||
browser.back();
|
||||
browser.waitForExist('send-archive');
|
||||
assert.equal(
|
||||
browser.getText('send-archive > div:first-of-type').substring(0, 24),
|
||||
'Expires after 1 download'
|
||||
assert(
|
||||
browser
|
||||
.getText('send-archive > div:first-of-type')
|
||||
.includes('Expires after 1 download')
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,12 +3,16 @@ const assert = require('assert');
|
|||
const HomePage = require('./pages/desktop/home_page');
|
||||
|
||||
describe('Firefox Send homepage', function() {
|
||||
this.retries(2);
|
||||
const homePage = new HomePage();
|
||||
const baseUrl = browser.options['baseUrl'];
|
||||
const footerLinks = ['mozilla', 'legal', 'legal', 'cookies', 'github'];
|
||||
|
||||
beforeEach(function() {
|
||||
homePage.open();
|
||||
if (process.env.ANDROID) {
|
||||
this.skip();
|
||||
}
|
||||
});
|
||||
|
||||
it('should have the right title', function() {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// eslint-disable-next-line node/no-extraneous-require
|
||||
const ip = require('ip');
|
||||
const path = require('path');
|
||||
const common = require('./wdio.common.conf');
|
||||
|
||||
/*/
|
||||
|
@ -11,8 +10,7 @@ Config for running selenium from a circleci docker container against localhost
|
|||
|
||||
exports.config = Object.assign({}, common.config, {
|
||||
baseUrl: `http://${ip.address()}:8000`,
|
||||
exclude: [path.join(__dirname, './integration/download-tests.js')],
|
||||
maxInstances: 1,
|
||||
bail: 1,
|
||||
services: [require('./testServer')]
|
||||
services: [require('./testServer'), 'selenium-standalone']
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue