From 9dbb4d02102116901d3341dd8448ed5c9c27a2c9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 24 Sep 2021 23:27:07 +0200 Subject: [PATCH] fix e2e --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 20 +++++++++++++------ package.json | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index a9d010fe20..0f2f0928e7 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -111,20 +111,28 @@ module.exports = { 'Deploy "Owner" using an ether.js script, listen to event and check event are logged in the terminal': function (browser: NightwatchBrowser) { browser + .clickLaunchIcon('settings') + .clickLaunchIcon('udapp') + .click('*[data-id="settingsVMLondonMode"]') .click('*[data-id="terminalClearConsole"]') // clear the terminal - .openFile('contracts/2_Owner.sol') - .clickLaunchIcon('solidity') - .click('*[data-id="compilerContainerCompileBtn"]') // compile Owner + .clickLaunchIcon('filePanel') + .click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder .addFile('deployWithEthersJs.js', { content: deployWithEthersJs }) .openFile('deployWithEthersJs.js') .pause(1000) + .openFile('contracts/2_Owner.sol') + .clickLaunchIcon('solidity') + .click('*[data-id="compilerContainerCompileBtn"]') // compile Owner .executeScript('remix.execute(\'deployWithEthersJs.js\')') + .waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address: 0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Deployment successful.', 60000) - .addAtAddressInstance('0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', true, true) + .addAtAddressInstance('0xd9145CCE52D386f254917e481eB44e9943F39138', true, true) .click('*[data-id="terminalClearConsole"]') // clear the terminal + .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) + .click('*[data-id="universalDappUiTitleExpander"]') .clickFunction('changeOwner - transact (not payable)', { types: 'address newOwner', values: '0xd9145CCE52D386f254917e481eB44e9943F39138' }) // execute the "changeOwner" function - .waitForElementContainsText('*[data-id="terminalJournal"]', 'previousOwner 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', 60000) // check that the script is logging the event - .waitForElementContainsText('*[data-id="terminalJournal"]', 'newOwner 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', 60000) + .waitForElementContainsText('*[data-id="terminalJournal"]', 'previousOwner0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', 60000) // check that the script is logging the event + .waitForElementContainsText('*[data-id="terminalJournal"]', 'newOwner0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) .end() } } diff --git a/package.json b/package.json index 7560f7e22e..1cc28b8aef 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", - "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", + "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=firefox", "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=chrome", "nightwatch_local_workspace": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/workspace.test.js --env=chrome", "nightwatch_local_defaultLayout": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/defaultLayout.test.js --env=chrome",