Commit ce366632 authored by ioedeveloper's avatar ioedeveloper Committed by yann300

Separate nightwatch config for running Run and Deploy Tests

parent 126154fd
...@@ -21,7 +21,7 @@ setupRemixd ...@@ -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,7 +30,8 @@ module.exports = { ...@@ -30,7 +30,8 @@ module.exports = {
'browserName': 'firefox', 'browserName': 'firefox',
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true 'acceptSslCerts': true
} },
'exclude': ['./test-browser/tests/runAndDeploy.js']
}, },
'chrome': { 'chrome': {
...@@ -39,6 +40,17 @@ module.exports = { ...@@ -39,6 +40,17 @@ module.exports = {
'javascriptEnabled': true, 'javascriptEnabled': true,
'acceptSslCerts': true, 'acceptSslCerts': true,
'goog:chromeOptions': { 'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen']
}
}
},
'chrome-runAndDeploy': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true,
'goog:chromeOptions': {
'args': ['window-size=2560,1440', 'start-fullscreen'], 'args': ['window-size=2560,1440', 'start-fullscreen'],
'extensions': [metamaskExtension] 'extensions': [metamaskExtension]
} }
......
...@@ -185,7 +185,7 @@ ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment