Merge pull request #5151 from ethereum/dragdroptest

file multi select test
pull/5155/head
bunsenstraat 3 months ago committed by GitHub
commit 4f7b466a55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 27
      apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts

@ -43,19 +43,20 @@ module.exports = {
(el: any) => { (el: any) => {
const id = (el as any).value.getId() const id = (el as any).value.getId()
browser browser
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false })
.dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id)
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false })
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]', abortOnFailure: false })
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false })
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false })
.perform(() => done()) .perform(() => done())
}) })
}) })
} }
}, },
'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) {
const selectedElements = [] const selectedElements = []
if (browser.options.desiredCapabilities?.browserName === 'firefox') { if (browser.options.desiredCapabilities?.browserName === 'firefox') {
@ -79,15 +80,15 @@ module.exports = {
(el: any) => { (el: any) => {
const id = (el as any).value.getId() const id = (el as any).value.getId()
browser browser
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts"]', abortOnFailure: false })
.dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id)
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false })
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/tests"]', abortOnFailure: false })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', abortOnFailure: false })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]', abortOnFailure: false })
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false })
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemREADME.txt"]', abortOnFailure: false })
.perform(() => done()) .perform(() => done())
}) })
}) })

Loading…
Cancel
Save