From 6a200ae4c3196432ebfac59c4b11438307bdee62 Mon Sep 17 00:00:00 2001 From: "davidzagi93@gmail.com" Date: Thu, 9 Sep 2021 01:21:10 +0100 Subject: [PATCH] added data-id to addFile click event --- apps/remix-ide-e2e/src/commands/addFile.ts | 8 +++----- apps/remix-ide-e2e/src/tests/workspace.test.ts | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 3e7950e10d..8254291d34 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -16,11 +16,9 @@ class AddFile extends EventEmitter { function addFile (browser: NightwatchBrowser, name: string, content: NightwatchContractContent, done: VoidFunction) { browser.clickLaunchIcon('udapp') .clickLaunchIcon('filePanel') - .pause(1000) - .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') - .pause(1000) // focus on root directory - .click('.newFile') - .pause(2000) + .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory + // .click('.newFile') + .click('[data-id="fileExplorerNewFilecreateNewFile"]') .waitForElementContainsText('*[data-id$="/blank"]', '', 60000) .sendKeys('*[data-id$="/blank"] .remixui_items', name) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index feaf312166..200f73d1e0 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -37,7 +37,7 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') // eslint-disable-next-line dot-notation .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name' }) - .waitForElementPresent('span[data-id="workspacesModalDialog-modal-footer-ok-react"]') + .waitForElementVisible('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span') .click('span[data-id="workspacesModalDialog-modal-footer-ok-react"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(1000) @@ -49,6 +49,7 @@ module.exports = { .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name_1' }) .click('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .pause(5000) .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') .pause(5000) .click('*[data-id="workspacesSelect"] option[value="workspace_name"]')