Separate nightwatch config for running Run and Deploy Tests

pull/1/head
ioedeveloper 5 years ago committed by yann300
parent 126154fd54
commit ce36663249
  1. 2
      ci/browser_tests.sh
  2. 14
      nightwatch.js
  3. 2
      package.json
  4. 2
      test-browser/tests/fileExplorer.js
  5. 2
      test-browser/tests/generalSettings.js
  6. 30
      test-browser/tests/runAndDeploy.js

@ -21,7 +21,7 @@ setupRemixd
sleep 5 sleep 5
npm run nightwatch_parallel || TEST_EXITCODE=1 npm run nightwatch_parallel & nightwatch_local_runAndDeploy || TEST_EXITCODE=1
echo "$TEST_EXITCODE" echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ] if [ "$TEST_EXITCODE" -eq 1 ]

@ -30,10 +30,22 @@ module.exports = {
'browserName': 'firefox', 'browserName': 'firefox',
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true 'acceptSslCerts': true
} },
'exclude': ['./test-browser/tests/runAndDeploy.js']
}, },
'chrome': { 'chrome': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen']
}
}
},
'chrome-runAndDeploy': {
'desiredCapabilities': { 'desiredCapabilities': {
'browserName': 'chrome', 'browserName': 'chrome',
'javascriptEnabled': true, 'javascriptEnabled': true,

@ -185,7 +185,7 @@
"nightwatch_local_fileExplorer": "nightwatch ./test-browser/tests/fileExplorer.js --config nightwatch.js --env chrome ", "nightwatch_local_fileExplorer": "nightwatch ./test-browser/tests/fileExplorer.js --config nightwatch.js --env chrome ",
"nightwatch_local_debugger": "nightwatch ./test-browser/tests/debugger.js --config nightwatch.js --env chrome ", "nightwatch_local_debugger": "nightwatch ./test-browser/tests/debugger.js --config nightwatch.js --env chrome ",
"nightwatch_local_editor": "nightwatch ./test-browser/tests/editor.js --config nightwatch.js --env chrome ", "nightwatch_local_editor": "nightwatch ./test-browser/tests/editor.js --config nightwatch.js --env chrome ",
"nightwatch_local_runAndDeploy": "nightwatch ./test-browser/tests/runAndDeploy.js --config nightwatch.js --env chrome ", "nightwatch_local_runAndDeploy": "nightwatch ./test-browser/tests/runAndDeploy.js --config nightwatch.js --env chrome-runAndDeploy ",
"onchange": "onchange build/app.js -- npm-run-all lint", "onchange": "onchange build/app.js -- npm-run-all lint",
"prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build", "prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build",
"remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080", "remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080",

@ -86,7 +86,7 @@ module.exports = {
.pause(2000) .pause(2000)
.perform((done) => { .perform((done) => {
if (runtimeBrowser === 'chrome') { if (runtimeBrowser === 'chrome') {
browser.switchBrowserTab(2) browser.switchBrowserTab(1)
.assert.urlContains('https://gist.github.com') .assert.urlContains('https://gist.github.com')
} }
done() done()

@ -23,7 +23,7 @@ module.exports = {
.waitForElementVisible('*[data-id="settingsTabGitterChannelButton"]') .waitForElementVisible('*[data-id="settingsTabGitterChannelButton"]')
.click('*[data-id="settingsTabGitterChannelButton"]') .click('*[data-id="settingsTabGitterChannelButton"]')
.pause(2000) .pause(2000)
.perform((done) => { if (runtimeBrowser === 'chrome') { browser.switchBrowserTab(2).assert.urlContains('https://gitter.im/ethereum/remix') } done() }) .perform((done) => { if (runtimeBrowser === 'chrome') { browser.switchBrowserTab(1).assert.urlContains('https://gitter.im/ethereum/remix') } done() })
}, },
'Should activate `generate contract metadata`': function (browser) { 'Should activate `generate contract metadata`': function (browser) {

@ -68,10 +68,7 @@ module.exports = {
}, },
'Should connect to Ropsten Test Network using MetaMask': function (browser) { 'Should connect to Ropsten Test Network using MetaMask': function (browser) {
const runtimeBrowser = browser.capabilities.browserName browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
runtimeBrowser === 'chrome'
? browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.setupMetamask(passphrase, password) .setupMetamask(passphrase, password)
.click('.network-indicator__down-arrow') .click('.network-indicator__down-arrow')
.useXpath().click("//span[text()='Ropsten Test Network']") .useXpath().click("//span[text()='Ropsten Test Network']")
@ -89,14 +86,10 @@ module.exports = {
.waitForElementPresent('.page-container__footer-button:nth-of-type(2)') .waitForElementPresent('.page-container__footer-button:nth-of-type(2)')
.click('.page-container__footer-button:nth-of-type(2)') .click('.page-container__footer-button:nth-of-type(2)')
.switchBrowserTab(0) .switchBrowserTab(0)
: ''
}, },
'Should deploy contract on Ropsten Test Network using MetaMask': function (browser) { 'Should deploy contract on Ropsten Test Network using MetaMask': function (browser) {
const runtimeBrowser = browser.capabilities.browserName browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option')
runtimeBrowser === 'chrome'
? browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option')
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.switchFile('browser/Greet.sol') .switchFile('browser/Greet.sol')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -110,14 +103,10 @@ module.exports = {
.waitForElementPresent('.transaction-status--submitted') .waitForElementPresent('.transaction-status--submitted')
.pause(35000) .pause(35000)
.switchBrowserTab(0) .switchBrowserTab(0)
: ''
}, },
'Should run low level interaction (fallback function) on Ropsten Test Network using MetaMask': function (browser) { 'Should run low level interaction (fallback function) on Ropsten Test Network using MetaMask': function (browser) {
const runtimeBrowser = browser.capabilities.browserName browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
runtimeBrowser === 'chrome'
? browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.waitForElementPresent('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]') .waitForElementPresent('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]')
@ -130,14 +119,10 @@ module.exports = {
.waitForElementPresent('.transaction-status--submitted') .waitForElementPresent('.transaction-status--submitted')
.pause(35000) .pause(35000)
.switchBrowserTab(0) .switchBrowserTab(0)
: ''
}, },
'Should connect to Ethereum Main Network using MetaMask': function (browser) { 'Should connect to Ethereum Main Network using MetaMask': function (browser) {
const runtimeBrowser = browser.capabilities.browserName browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
runtimeBrowser === 'chrome'
? browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.switchBrowserTab(2) .switchBrowserTab(2)
.waitForElementPresent('.network-indicator__down-arrow') .waitForElementPresent('.network-indicator__down-arrow')
.click('.network-indicator__down-arrow') .click('.network-indicator__down-arrow')
@ -152,14 +137,10 @@ module.exports = {
.click('*[data-id="settingsSelectEnvOptions"] option[id="injected-mode"]') .click('*[data-id="settingsSelectEnvOptions"] option[id="injected-mode"]')
.waitForElementPresent('*[data-id="settingsNetworkEnv"]') .waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network') .assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network')
: ''
}, },
'Should deploy contract on Ethereum Main Network using MetaMask': function (browser) { 'Should deploy contract on Ethereum Main Network using MetaMask': function (browser) {
const runtimeBrowser = browser.capabilities.browserName browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option')
runtimeBrowser === 'chrome'
? browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option')
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.switchFile('browser/Greet.sol') .switchFile('browser/Greet.sol')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
@ -169,7 +150,6 @@ module.exports = {
.assert.containsText('*[data-id="modalDialogModalBody"]', 'You are creating a transaction on the main network. Click confirm if you are sure to continue.') .assert.containsText('*[data-id="modalDialogModalBody"]', 'You are creating a transaction on the main network. Click confirm if you are sure to continue.')
.modalFooterCancelClick() .modalFooterCancelClick()
.end() .end()
: browser.end()
}, },
tearDown: sauce tearDown: sauce

Loading…
Cancel
Save