pull/7/head
yann300 8 years ago
parent befe8fdd4c
commit 39a0ec92e7
  1. 5
      .travis.yml
  2. 26
      ci/browser_tests.sh
  3. 42
      nightwatch.js
  4. 7
      package.json
  5. 4
      src/ASMCode.js
  6. 2
      test-browser/init.js

@ -3,10 +3,7 @@ node_js:
- stable - stable
script: script:
- npm run test - npm run test
- npm run build - bash ci/browser_tests.sh
- npm run serve &
- npm run nightwatch_local
- npm run test
deploy: deploy:
provider: script provider: script
script: ci/deploy_from_travis.sh script: ci/deploy_from_travis.sh

@ -0,0 +1,26 @@
#!/bin/bash
set -e
SAUCECONNECT_URL="http://saucelabs.com/downloads/sc-4.3.16-linux.tar.gz"
SAUCECONNECT_USERNAME="yann300"
SAUCECONNECT_ACCESSKEY="e6f430f2-daa0-48bb-90fd-8bee20f429eb"
SAUCECONNECT_JOBIDENTIFIER="remix_tests_${TRAVIS_JOB_NUMBER}"
SAUCECONNECT_READYFILE="sc.ready"
npm run build
npm run serve &
wget $SAUCECONNECT_URL
tar -zxvf sc-4.3.16-linux.tar.gz
./sc-4.3.16-linux/bin/sc -u $SAUCECONNECT_USERNAME -k $SAUCECONNECT_ACCESSKEY -i $SAUCECONNECT_JOBIDENTIFIER --readyfile $SAUCECONNECT_READYFILE &
while [ ! -f $SAUCECONNECT_READYFILE ]; do
sleep .5
done
npm run nightwatch_remote_firefox
npm run nightwatch_remote_chrome
npm run nightwatch_remote_safari
npm run nightwatch_remote_ie
curl -X delete "http://saucelabs.com/rest/v1/${SAUCECONNECT_USERNAME}/tunnels/${SAUCECONNECT_JOBIDENTIFIER}"

@ -43,8 +43,38 @@ module.exports = {
'browserName': 'firefox', 'browserName': 'firefox',
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true, 'acceptSslCerts': true,
'build': `build-${TRAVIS_JOB_NUMBER}`, 'build': 'build-' + TRAVIS_JOB_NUMBER,
'tunnel-identifier': TRAVIS_JOB_NUMBER 'tunnel-identifier': 'remix_tests_' + TRAVIS_JOB_NUMBER
}
},
'chrome': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
'build': 'build-' + TRAVIS_JOB_NUMBER,
'tunnel-identifier': 'remix_tests_' + TRAVIS_JOB_NUMBER
}
},
'safari': {
'desiredCapabilities': {
'browserName': 'safari',
'javascriptEnabled': true,
'acceptSslCerts': true,
'build': 'build-' + TRAVIS_JOB_NUMBER,
'tunnel-identifier': 'remix_tests_' + TRAVIS_JOB_NUMBER
}
},
'internetexplorer': {
'desiredCapabilities': {
'browserName': 'internetexplorer',
'javascriptEnabled': true,
'acceptSslCerts': true,
'build': 'build-' + TRAVIS_JOB_NUMBER,
'tunnel-identifier': 'remix_tests_' + TRAVIS_JOB_NUMBER
} }
}, },
@ -62,14 +92,6 @@ module.exports = {
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true 'acceptSslCerts': true
} }
},
'chrome': {
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
}
} }
} }
} }

@ -30,8 +30,11 @@
"build": "mkdir -p build; browserify src/index.js -o build/app.js", "build": "mkdir -p build; browserify src/index.js -o build/app.js",
"test": "standard && tape ./test/tests.js", "test": "standard && tape ./test/tests.js",
"serve": "http-server .", "serve": "http-server .",
"nightwatch_remote": "nightwatch --config nightwatch.js --env default", "nightwatch_local": "nightwatch --config nightwatch.js --env local",
"nightwatch_local": "nightwatch --config nightwatch.js --env local" "nightwatch_remote_firefox": "nightwatch --config nightwatch.js --env default",
"nightwatch_remote_chrome": "nightwatch --config nightwatch.js --env chrome",
"nightwatch_remote_safari": "nightwatch --config nightwatch.js --env safari",
"nightwatch_remote_ie": "nightwatch --config nightwatch.js --env ie"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

@ -51,9 +51,7 @@ ASMCode.prototype.codeChanged = function (code, address, index) {
ASMCode.prototype.renderAssemblyItems = function () { ASMCode.prototype.renderAssemblyItems = function () {
if (this.code) { if (this.code) {
this.codeView = this.code.map(function (item, i) { this.codeView = this.code.map(function (item, i) {
return yo`<option key=${i} value=${i}> return yo`<option key=${i} value=${i}>${item}</option>`
${item}
</option>`
}) })
return this.codeView return this.codeView
} }

@ -42,7 +42,7 @@ function injectScript (file, browser, callback) {
function extendBrowser (browser) { function extendBrowser (browser) {
browser.assertCurrentSelectedItem = function (expected) { browser.assertCurrentSelectedItem = function (expected) {
browser.getValue('#asmitems', function (result) { browser.getValue('#asmitems', function (result) {
browser.assert.containsText('#asmitems option[value="' + result.value + '"]', expected) browser.expect.element('#asmitems option[value="' + result.value + '"]').text.to.equal(expected)
}) })
return browser return browser
} }

Loading…
Cancel
Save