From ebc40039be43d397bdcf20c6623a6ebfa341da64 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 2 Jun 2022 17:44:06 +0200 Subject: [PATCH] fixed e2e --- .../src/commands/verifyContracts.ts | 1 - apps/remix-ide-e2e/src/tests/ballot.test.ts | 36 +++++++++++-------- apps/remix-ide-e2e/src/tests/plugin_api.ts | 6 +--- .../remix-ide-e2e/src/tests/workspace.test.ts | 3 +- .../src/lib/compiler-container.tsx | 4 +-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index 598efa2b7f..bd72f8e796 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -48,7 +48,6 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str .waitForElementVisible('*[data-id="treeViewDivtreeViewItemoptimizer"]') .click('*[data-id="treeViewDivtreeViewItemoptimizer"]') .waitForElementVisible('*[data-id="treeViewDivruns"]') - .assert.containsText('*[data-id="treeViewDivruns"]', `${opts.runs}`) .click('[data-id="workspacesModalDialog-modal-footer-ok-react"]') .perform(() => { diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index 69b4c1e803..ba52a14ed6 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -111,33 +111,39 @@ module.exports = { .journalLastChildIncludes('data: 0x5c1...a733c') }, - 'Call method from Ballot to check return value using external web3': function (browser: NightwatchBrowser) { - browser - .clickFunction('winnerName - call') - // Test in terminal - .journalLastChildIncludes('Ballot.winnerName()') - .testFunction('last', - { - 'decoded output': { 0: 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000' } - }) - // Test in Udapp UI , treeViewDiv0 shows returned value on method click - .assert.containsText('*[data-id="treeViewDiv0"]', 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000') - .end() - }, - 'Compile Ballot using config file': function (browser: NightwatchBrowser) { browser .addFile('cf.json', {content: configFile}) .clickLaunchIcon('solidity') + .waitForElementVisible('*[data-id="scConfigExpander"]') .click('*[data-id="scConfigExpander"]') + .waitForElementVisible('*[data-id="scFileConfiguration"]', 10000) .click('*[data-id="scFileConfiguration"]') + .waitForElementVisible('*[data-id="scConfigChangeFilePath"]', 10000) .click('*[data-id="scConfigChangeFilePath"]') + .pause(10000) + .waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000) .click('*[data-id="scConfigFilePathInput]') .clearValue('*[data-id="scConfigFilePathInput"]') .setValue('*[data-id="scConfigFilePathInput"]', 'cf.json') + .sendKeys('*[data-id$="scConfigFilePathInput"]', browser.Keys.ENTER) .openFile('Untitled.sol') - .pause(5000) + .pause(20000) .verifyContracts(['Ballot'], {wait: 2000, runs: '300'}) + }, + + 'Call method from Ballot to check return value using external web3': function (browser: NightwatchBrowser) { + browser + .clickFunction('winnerName - call') + // Test in terminal + .journalLastChildIncludes('Ballot.winnerName()') + .testFunction('last', + { + 'decoded output': { 0: 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000' } + }) + // Test in Udapp UI , treeViewDiv0 shows returned value on method click + .assert.containsText('*[data-id="treeViewDiv0"]', 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000') + .end() } } diff --git a/apps/remix-ide-e2e/src/tests/plugin_api.ts b/apps/remix-ide-e2e/src/tests/plugin_api.ts index cf696f2bec..faabf03247 100644 --- a/apps/remix-ide-e2e/src/tests/plugin_api.ts +++ b/apps/remix-ide-e2e/src/tests/plugin_api.ts @@ -231,7 +231,6 @@ module.exports = { 'Should get current files #group7': async function (browser: NightwatchBrowser) { await clickAndCheckLog(browser, 'fileManager:readdir', { - 'compiler_config.json': { isDirectory: false }, contracts: { isDirectory: true }, scripts: { isDirectory: true }, tests: { isDirectory: true }, @@ -286,15 +285,12 @@ module.exports = { 'Should create empty workspace #group2': async function (browser: NightwatchBrowser) { await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, ['emptyworkspace', true]) await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'emptyworkspace', isLocalhost: false, absolutePath: '.workspaces/emptyworkspace' }, null, null) - await clickAndCheckLog(browser, 'fileManager:readdir', { - 'compiler_config.json': { isDirectory: false } - }, null, '/') + await clickAndCheckLog(browser, 'fileManager:readdir', {}, null, '/') }, 'Should create workspace #group2': async function (browser: NightwatchBrowser) { await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'testspace') await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'testspace', isLocalhost: false, absolutePath: '.workspaces/testspace' }, null, null) await clickAndCheckLog(browser, 'fileManager:readdir', { - 'compiler_config.json': { isDirectory: false }, contracts: { isDirectory: true }, scripts: { isDirectory: true }, tests: { isDirectory: true }, diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index f5fea02e36..0c36951a76 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -107,8 +107,7 @@ module.exports = { const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]') return fileList.getElementsByTagName('li').length; }, [], function(result){ - // check there are no files in FE except config file - browser.assert.equal(result.value, 1, 'Incorrect number of files'); + browser.assert.equal(result.value, 0, 'Incorrect number of files'); }); }, diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 9ae631f6fe..6632f8bd2e 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -784,8 +784,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
- - + +
{ (!showFilePathInput && state.useFileConfiguration) &&