From a3c65d5815779417c53ae47349eb04718c4014c2 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 7 Dec 2020 18:28:24 +0530 Subject: [PATCH] contract files path updated in e2e tests --- .../src/tests/defaultLayout.test.ts | 6 +++--- apps/remix-ide-e2e/src/tests/editor.test.ts | 18 +++++++++--------- .../src/tests/fileExplorer.test.ts | 4 ++-- .../src/tests/fileManager_api.test.ts | 6 +++--- .../src/tests/generalSettings.test.ts | 6 +++--- apps/remix-ide-e2e/src/tests/gist.test.ts | 2 +- .../src/tests/publishContract.test.ts | 6 +++--- .../src/tests/solidityUnittests.test.ts | 2 +- apps/remix-ide-e2e/src/tests/terminal.test.ts | 4 ++-- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts index 22ad99fa1d..1ef5c112a1 100644 --- a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts +++ b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts @@ -20,7 +20,7 @@ module.exports = { browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORERS') .waitForElementVisible('div[data-id="filePanelFileExplorerTree"]') - .waitForElementVisible('li[key="browser/3_Ballot.sol"]') + .waitForElementVisible('li[key="browser/contracts/3_Ballot.sol"]') }, 'Loads Main View': function (browser: NightwatchBrowser) { @@ -68,8 +68,8 @@ module.exports = { 'Switch Tabs using tabs icon': function (browser: NightwatchBrowser) { browser .waitForElementVisible('div[data-id="filePanelFileExplorerTree"]') - .openFile('browser/3_Ballot.sol') - .assert.containsText('div[title="browser/3_Ballot.sol"]', '3_Ballot.sol') + .openFile('browser/contracts/3_Ballot.sol') + .assert.containsText('div[title="browser/contracts/3_Ballot.sol"]', '3_Ballot.sol') .click('span[class^=dropdownCaret]') .click('#homeItem') .assert.containsText('div[title="home"]', 'Home') diff --git a/apps/remix-ide-e2e/src/tests/editor.test.ts b/apps/remix-ide-e2e/src/tests/editor.test.ts index 8ac886a3ad..4cbca46dc4 100644 --- a/apps/remix-ide-e2e/src/tests/editor.test.ts +++ b/apps/remix-ide-e2e/src/tests/editor.test.ts @@ -12,7 +12,7 @@ module.exports = { 'Should zoom in editor': function (browser: NightwatchBrowser) { browser.waitForElementVisible('div[data-id="mainPanelPluginsContainer"]') - .openFile('browser/1_Storage.sol') + .openFile('browser/contracts/1_Storage.sol') .waitForElementVisible('*[data-id="editorInput"]') .checkElementStyle('*[data-id="editorInput"]', 'font-size', '12px') .click('*[data-id="tabProxyZoomIn"]') @@ -97,8 +97,8 @@ module.exports = { .click('li[key="browser/removeSourcehighlightScript.js"]') .pause(2000) .executeScript('remix.exeCurrent()') - .waitForElementVisible('li[key="browser/3_Ballot.sol"]') - .click('li[key="browser/3_Ballot.sol"]') + .waitForElementVisible('li[key="browser/contracts/3_Ballot.sol"]') + .click('li[key="browser/contracts/3_Ballot.sol"]') .pause(2000) .waitForElementNotPresent('.highlightLine32') .checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)') @@ -110,8 +110,8 @@ module.exports = { .click('li[key="browser/removeAllSourcehighlightScript.js"]') .pause(2000) .executeScript('remix.exeCurrent()') - .waitForElementVisible('li[key="browser/3_Ballot.sol"]') - .click('li[key="browser/3_Ballot.sol"]') + .waitForElementVisible('li[key="browser/contracts/3_Ballot.sol"]') + .click('li[key="browser/contracts/3_Ballot.sol"]') .pause(2000) .waitForElementNotPresent('.highlightLine32') .waitForElementNotPresent('.highlightLine40') @@ -151,7 +151,7 @@ const sourcehighlightScript = { column: 20 } } - await remix.call('editor', 'highlight', pos, 'browser/3_Ballot.sol') + await remix.call('editor', 'highlight', pos, 'browser/contracts/3_Ballot.sol') const pos2 = { start: { @@ -163,7 +163,7 @@ const sourcehighlightScript = { column: 20 } } - await remix.call('editor', 'highlight', pos2, 'browser/3_Ballot.sol') + await remix.call('editor', 'highlight', pos2, 'browser/contracts/3_Ballot.sol') const pos3 = { start: { @@ -175,7 +175,7 @@ const sourcehighlightScript = { column: 20 } } - await remix.call('editor', 'highlight', pos3, 'browser/3_Ballot.sol') + await remix.call('editor', 'highlight', pos3, 'browser/contracts/3_Ballot.sol') } catch (e) { console.log(e.message) } @@ -187,7 +187,7 @@ const removeSourcehighlightScript = { content: ` (async () => { try { - await remix.call('editor', 'discardHighlightAt', 32, 'browser/3_Ballot.sol') + await remix.call('editor', 'discardHighlightAt', 32, 'browser/contracts/3_Ballot.sol') } catch (e) { console.log(e.message) } diff --git a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts index 5eefef2037..e82b214b43 100644 --- a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts @@ -46,8 +46,8 @@ module.exports = { 'Should create a new folder': function (browser: NightwatchBrowser) { browser - .waitForElementVisible('*[data-id="treeViewLibrowser/1_Storage.sol"]') - .rightClick('[data-path="browser/1_Storage.sol"]') + .waitForElementVisible('*[data-id="treeViewLibrowser/contracts/1_Storage.sol"]') + .rightClick('[data-path="browser/contracts/1_Storage.sol"]') .click('*[id="menuitemcreate folder"]') .waitForElementVisible('*[data-id="modalDialogContainer"]') .setValue('*[data-id="modalDialogCustomPromptText"]', 'Browser_Tests') diff --git a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts b/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts index 2f822f735b..167f0caca3 100644 --- a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts @@ -30,7 +30,7 @@ module.exports = { .addFile('open.js', { content: executeOpen }) .executeScript(`remix.exeCurrent()`) .pause(2000) - .journalLastChildIncludes('browser/3_Ballot.sol') + .journalLastChildIncludes('browser/contracts/3_Ballot.sol') }, 'Should execute `writeFile` api from file manager external api': function (browser: NightwatchBrowser) { @@ -118,7 +118,7 @@ const executeExists = ` const executeOpen = ` const run = async () => { - await remix.call('fileManager', 'open', 'browser/3_Ballot.sol') + await remix.call('fileManager', 'open', 'browser/contracts/3_Ballot.sol') const result = await remix.call('fileManager', 'file') console.log(result) @@ -147,7 +147,7 @@ const executeReadFile = ` const executeCopyFile = ` const run = async () => { - await remix.call('fileManager', 'copyFile', 'browser/3_Ballot.sol', 'browser/new_contract.sol') + await remix.call('fileManager', 'copyFile', 'browser/contracts/3_Ballot.sol', 'browser/new_contract.sol') const result = await remix.call('fileManager', 'readFile', 'browser/new_contract.sol') console.log(result) diff --git a/apps/remix-ide-e2e/src/tests/generalSettings.test.ts b/apps/remix-ide-e2e/src/tests/generalSettings.test.ts index cff0a64686..6cf937e8e1 100644 --- a/apps/remix-ide-e2e/src/tests/generalSettings.test.ts +++ b/apps/remix-ide-e2e/src/tests/generalSettings.test.ts @@ -20,14 +20,14 @@ module.exports = { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 5000) .waitForElementVisible('*[data-id="settingsTabGenerateContractMetadataLabel"]', 5000) .click('*[data-id="verticalIconsFileExplorerIcons"]') - .openFile('browser/3_Ballot.sol') + .openFile('browser/contracts/3_Ballot.sol') .click('*[data-id="verticalIconsKindsolidity"]') .pause(2000) .click('*[data-id="compilerContainerCompileBtn"]') .pause(3000) .click('*[data-id="verticalIconsKindfileExplorers"]') - .openFile('browser/artifacts/Ballot.json') - .openFile('browser/artifacts/Ballot_metadata.json') + .openFile('browser/contracts/artifacts/Ballot.json') + .openFile('browser/contracts/artifacts/Ballot_metadata.json') .getEditorValue((content) => { const metadata = JSON.parse(content) browser.assert.equal(metadata.language, 'Solidity') diff --git a/apps/remix-ide-e2e/src/tests/gist.test.ts b/apps/remix-ide-e2e/src/tests/gist.test.ts index 4bcaae4ea5..f459fb7027 100644 --- a/apps/remix-ide-e2e/src/tests/gist.test.ts +++ b/apps/remix-ide-e2e/src/tests/gist.test.ts @@ -26,7 +26,7 @@ module.exports = { browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .clickLaunchIcon('fileExplorers') - .rightClick('[data-path="browser/1_Storage.sol"]') + .rightClick('[data-path="browser/contracts/1_Storage.sol"]') .click('*[id="menuitemcreate folder"]') .waitForElementVisible('*[data-id="modalDialogContainer"]') .setValue('*[data-id="modalDialogCustomPromptText"]', 'Browser_Tests') diff --git a/apps/remix-ide-e2e/src/tests/publishContract.test.ts b/apps/remix-ide-e2e/src/tests/publishContract.test.ts index 3fa9e6c239..193d2ea20b 100644 --- a/apps/remix-ide-e2e/src/tests/publishContract.test.ts +++ b/apps/remix-ide-e2e/src/tests/publishContract.test.ts @@ -16,7 +16,7 @@ module.exports = { browser .waitForElementVisible('#icon-panel', 10000) .clickLaunchIcon('fileExplorers') - .openFile('browser/3_Ballot.sol') + .openFile('browser/contracts/3_Ballot.sol') .verifyContracts(['Ballot']) .click('#publishOnIpfs') .getModalBody((value, done) => { @@ -42,7 +42,7 @@ module.exports = { browser .waitForElementVisible('#icon-panel') .clickLaunchIcon('fileExplorers') - .openFile('browser/1_Storage.sol') + .openFile('browser/contracts/1_Storage.sol') .clickLaunchIcon('udapp') .waitForElementPresent('*[data-id="contractDropdownIpfsCheckbox"]') .click('*[data-id="contractDropdownIpfsCheckbox"]') @@ -55,7 +55,7 @@ module.exports = { 'Should remember choice after page refresh': function (browser: NightwatchBrowser) { browser .refresh() - .openFile('browser/1_Storage.sol') + .openFile('browser/contracts/1_Storage.sol') .clickLaunchIcon('udapp') .waitForElementPresent('*[data-id="contractDropdownIpfsCheckbox"]') .verify.elementPresent('*[data-id="contractDropdownIpfsCheckbox"]:checked') diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 512c00a1bd..a76a3ef3ba 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -167,7 +167,7 @@ function runTests (browser: NightwatchBrowser) { browser .waitForElementPresent('*[data-id="verticalIconsKindfileExplorers"]') .clickLaunchIcon('fileExplorers') - .openFile('browser/3_Ballot.sol') + .openFile('browser/contracts/3_Ballot.sol') .clickLaunchIcon('solidityUnitTesting') .pause(500) .scrollAndClick('#runTestsTabRunAction') diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 862794d89b..57edb3c1cd 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -152,7 +152,7 @@ const asyncAwaitWithFileManagerAccess = ` var run = async () => { console.log('Waiting Promise') var result = await p() - let text = await remix.call('fileManager', 'readFile', 'browser/3_Ballot.sol') + let text = await remix.call('fileManager', 'readFile', 'browser/contracts/3_Ballot.sol') console.log('result - ', text) } @@ -185,7 +185,7 @@ const resolveUrl = ` (async () => { try { console.log('start') - console.log(await remix.call('contentImport', 'resolveAndSave', 'browser/3_Ballot.sol')) + console.log(await remix.call('contentImport', 'resolveAndSave', 'browser/contracts/3_Ballot.sol')) } catch (e) { console.log(e.message) }