user circle-ci for running browser test

pull/3094/head
yann300 6 years ago
parent 2f49db4036
commit fe52797f99
  1. 11
      .circleci/config.yml
  2. 24
      ci/browser_tests.sh
  3. 32
      nightwatch.js
  4. 1
      test-browser/helpers/contracts.js
  5. 2
      test-browser/tests/generalTests.js
  6. 10
      test-browser/tests/sauce.js
  7. 5
      test-browser/tests/sharedFolderExplorer.js

@ -7,7 +7,7 @@ jobs:
remix-ide: remix-ide:
docker: docker:
# specify the version you desire here # specify the version you desire here
- image: circleci/node:9.11.2 - image: circleci/node:9.11.2-browsers
# Specify service dependencies here if necessary # Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images # CircleCI maintains a library of pre-built images
@ -32,7 +32,14 @@ jobs:
key: dep-bundle-29-{{ checksum "package.json" }} key: dep-bundle-29-{{ checksum "package.json" }}
paths: paths:
- ~/repo/node_modules - ~/repo/node_modules
- run: npm run lint && npm run test && npm run make-mock-compiler && npm run build - run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Download Selenium
command: wget http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar
- run:
name: Start Selenium
command: java -jar selenium-server-standalone-3.5.3.jar
background: true
- run: ./ci/browser_tests.sh - run: ./ci/browser_tests.sh
workflows: workflows:

@ -11,37 +11,17 @@ setupRemixd () {
cd .. cd ..
} }
if test $(uname -s) = "Darwin"
then
OS="osx"
FILEFORMAT="zip"
else
OS="linux"
FILEFORMAT="tar.gz"
fi
SC_VERSION="4.5.1"
SAUCECONNECT_URL="https://saucelabs.com/downloads/sc-$SC_VERSION-$OS.$FILEFORMAT"
SAUCECONNECT_USERNAME="yanneth"
SAUCECONNECT_ACCESSKEY="1f5a4560-b02b-41aa-b52b-f033aad30870"
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID" echo "$BUILD_ID"
SAUCECONNECT_JOBIDENTIFIER="browsersolidity_tests_${BUILD_ID}"
SAUCECONNECT_READYFILE="sc.ready"
TEST_EXITCODE=0 TEST_EXITCODE=0
npm run serve & npm run serve &
setupRemixd setupRemixd
wget "$SAUCECONNECT_URL" sleep 5
tar -zxvf sc-"$SC_VERSION"-"$OS"."$FILEFORMAT"
./sc-"$SC_VERSION"-"$OS"/bin/sc -u "$SAUCECONNECT_USERNAME" -k "$SAUCECONNECT_ACCESSKEY" -i "$SAUCECONNECT_JOBIDENTIFIER" --no-ssl-bump-domains all --readyfile "$SAUCECONNECT_READYFILE" &
while [ ! -f "$SAUCECONNECT_READYFILE" ]; do
sleep .5
done
npm run nightwatch_remote_chrome || TEST_EXITCODE=1 npm run nightwatch_remote_chrome || TEST_EXITCODE=1
npm run nightwatch_remote_firefox || TEST_EXITCODE=1 # npm run nightwatch_remote_firefox || TEST_EXITCODE=1
# npm run nightwatch_remote_safari || TEST_EXITCODE=1 # npm run nightwatch_remote_safari || TEST_EXITCODE=1
# npm run nightwatch_remote_ie || TEST_EXITCODE=1 # npm run nightwatch_remote_ie || TEST_EXITCODE=1
# npm run nightwatch_remote_parallel || TEST_EXITCODE=1 # npm run nightwatch_remote_parallel || TEST_EXITCODE=1

@ -1,7 +1,5 @@
'use strict' 'use strict'
var buildId = process.env.CIRCLE_BUILD_NUM || process.env.TRAVIS_JOB_NUMBER
module.exports = { module.exports = {
'src_folders': ['test-browser/tests'], 'src_folders': ['test-browser/tests'],
'output_folder': 'reports', 'output_folder': 'reports',
@ -12,13 +10,8 @@ module.exports = {
'test_settings': { 'test_settings': {
'default': { 'default': {
'launch_url': 'http://ondemand.saucelabs.com:80', 'selenium_port': 4444,
'selenium_host': 'ondemand.saucelabs.com', 'selenium_host': 'localhost',
'selenium_port': 80,
'silent': true,
'username': 'yanneth',
'access_key': '1f5a4560-b02b-41aa-b52b-f033aad30870',
'use_ssl': false,
'globals': { 'globals': {
'waitForConditionTimeout': 10000, 'waitForConditionTimeout': 10000,
'asyncHookTimeout': 100000 'asyncHookTimeout': 100000
@ -30,9 +23,7 @@ module.exports = {
'desiredCapabilities': { 'desiredCapabilities': {
'browserName': 'firefox', 'browserName': 'firefox',
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true, 'acceptSslCerts': true
'build': 'build-' + buildId,
'tunnel-identifier': 'browsersolidity_tests_' + buildId
} }
}, },
@ -41,8 +32,6 @@ module.exports = {
'browserName': 'chrome', 'browserName': 'chrome',
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true, 'acceptSslCerts': true,
'build': 'build-' + buildId,
'tunnel-identifier': 'browsersolidity_tests_' + buildId,
'chromeOptions': { 'chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen'] 'args': ['window-size=2560,1440', 'start-fullscreen']
} }
@ -53,11 +42,7 @@ module.exports = {
'desiredCapabilities': { 'desiredCapabilities': {
'browserName': 'safari', 'browserName': 'safari',
'javascriptEnabled': true, 'javascriptEnabled': true,
'platform': 'macOS 10.13', 'acceptSslCerts': true
'version': '11.0',
'acceptSslCerts': true,
'build': 'build-' + buildId,
'tunnel-identifier': 'browsersolidity_tests_' + buildId
} }
}, },
@ -65,18 +50,11 @@ module.exports = {
'desiredCapabilities': { 'desiredCapabilities': {
'browserName': 'internet explorer', 'browserName': 'internet explorer',
'javascriptEnabled': true, 'javascriptEnabled': true,
'platform': 'Windows 10', 'acceptSslCerts': true
'acceptSslCerts': true,
'version': '11.103',
'build': 'build-' + buildId,
'tunnel-identifier': 'browsersolidity_tests_' + buildId
} }
}, },
'local': { 'local': {
'launch_url': 'http://localhost:8080',
'selenium_port': 4444,
'selenium_host': 'localhost',
'desiredCapabilities': { 'desiredCapabilities': {
'browserName': 'chrome', 'browserName': 'chrome',
'javascriptEnabled': true, 'javascriptEnabled': true,

@ -125,6 +125,7 @@ function verifyCallReturnValue (browser, address, checks, done) {
} }
return ret return ret
}, [address], function (result) { }, [address], function (result) {
console.log('verifyCallReturnValue', result)
for (var k in checks) { for (var k in checks) {
browser.assert.equal(result.value[k], checks[k]) browser.assert.equal(result.value[k], checks[k])
} }

@ -180,7 +180,7 @@ function testSignature (browser, callback) {
.getAttribute(instanceSelector, 'id', (result) => { .getAttribute(instanceSelector, 'id', (result) => {
// skip 'instance' part of e.g. 'instance0x692a70d2e424a56d2c6c27aa97d1a86395877b3a' // skip 'instance' part of e.g. 'instance0x692a70d2e424a56d2c6c27aa97d1a86395877b3a'
const address = result.value.slice('instance'.length) const address = result.value.slice('instance'.length)
browser.clickFunction('ecrecovery - call', {types: 'bytes32 hash, bytes sig', values: `"${hash.value}","${signature.value}"`}).perform( browser.clickFunction('ecrecovery - call', {types: 'bytes32 hash, bytes sig', values: `"${hash.value}","${signature.value}"`}).pause(1000).perform(
() => { () => {
contractHelper.verifyCallReturnValue( contractHelper.verifyCallReturnValue(
browser, browser,

@ -1,17 +1,14 @@
const https = require('https') // const https = require('https')
module.exports = function sauce (callback) { module.exports = function sauce (callback) {
return callback()
/*
const currentTest = this.client.currentTest const currentTest = this.client.currentTest
const username = this.client.options.username const username = this.client.options.username
const sessionId = this.client.capabilities['webdriver.remote.sessionid'] const sessionId = this.client.capabilities['webdriver.remote.sessionid']
const accessKey = this.client.options.accessKey const accessKey = this.client.options.accessKey
if (!this.client.launch_url.match(/saucelabs/)) {
console.log('Not saucelabs ...')
return callback()
}
if (!username || !accessKey || !sessionId) { if (!username || !accessKey || !sessionId) {
console.log(this.client) console.log(this.client)
console.log('No username, accessKey or sessionId') console.log('No username, accessKey or sessionId')
@ -59,4 +56,5 @@ module.exports = function sauce (callback) {
console.log('Error', error) console.log('Error', error)
callback() callback()
} }
*/
} }

@ -59,11 +59,6 @@ function runTests (browser, testData) {
browser.end() browser.end()
return return
} }
if (browserName === 'chrome') {
console.log('do not run remixd test for ' + browserName + ': TODO to reenable later')
browser.end()
return
}
if (browserName === 'firefox') { if (browserName === 'firefox') {
console.log('do not run remixd test for ' + browserName + ': TODO to reenable later') console.log('do not run remixd test for ' + browserName + ': TODO to reenable later')
browser.end() browser.end()

Loading…
Cancel
Save