done when error

pull/5370/head
bunsenstraat 3 months ago committed by bunsenstraat
parent 5530845ef5
commit 833dcffc66
  1. 60
      apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts

@ -41,17 +41,24 @@ module.exports = {
.perform((done) => { .perform((done) => {
browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' }, browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' },
(el: any) => { (el: any) => {
const id = (el as any).value.getId() try {
browser const id = (el as any).value.getId();
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') browser
.dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]')
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id)
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') .execute(function () {
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click();
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') })
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]')
.perform(() => done()) .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]')
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]')
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]')
.perform(() => done())
} catch (error) {
console.error('An error occurred:', error)
done(error);
}
}) })
}) })
} }
@ -77,18 +84,25 @@ module.exports = {
.perform((done) => { .perform((done) => {
browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' }, browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' },
(el: any) => { (el: any) => {
const id = (el as any).value.getId() try {
browser const id = (el as any).value.getId();
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') browser
.dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]')
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id)
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) .execute(function () {
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click();
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) })
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000)
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000)
.perform(() => done()) .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000)
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]')
.waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]')
.perform(() => done())
} catch (error) {
console.error('An error occurred:', error)
done(error)
}
}) })
}) })
} }

Loading…
Cancel
Save