added data-id to addFile click event

pull/1342/head
davidzagi93@gmail.com 3 years ago
parent 472486c818
commit 5395fe515a
  1. 8
      apps/remix-ide-e2e/src/commands/addFile.ts
  2. 3
      apps/remix-ide-e2e/src/tests/workspace.test.ts

@ -16,11 +16,9 @@ class AddFile extends EventEmitter {
function addFile (browser: NightwatchBrowser, name: string, content: NightwatchContractContent, done: VoidFunction) { function addFile (browser: NightwatchBrowser, name: string, content: NightwatchContractContent, done: VoidFunction) {
browser.clickLaunchIcon('udapp') browser.clickLaunchIcon('udapp')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.pause(1000) .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory
.click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // .click('.newFile')
.pause(1000) // focus on root directory .click('[data-id="fileExplorerNewFilecreateNewFile"]')
.click('.newFile')
.pause(2000)
.waitForElementContainsText('*[data-id$="/blank"]', '', 60000) .waitForElementContainsText('*[data-id$="/blank"]', '', 60000)
.sendKeys('*[data-id$="/blank"] .remixui_items', name) .sendKeys('*[data-id$="/blank"] .remixui_items', name)
.sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER)

@ -37,7 +37,7 @@ module.exports = {
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name' }) .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"]') .click('span[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.pause(1000) .pause(1000)
@ -49,6 +49,7 @@ module.exports = {
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name_1' }) .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name_1' })
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span') .click('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.pause(5000)
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]')
.pause(5000) .pause(5000)
.click('*[data-id="workspacesSelect"] option[value="workspace_name"]') .click('*[data-id="workspacesSelect"] option[value="workspace_name"]')

Loading…
Cancel
Save