abort on failure false

pull/5151/head
bunsenstraat 3 months ago committed by bunsenstraat
parent 17b218bf7a
commit 12d1d375a1
  1. 72
      apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts

@ -7,7 +7,7 @@ module.exports = {
init(browser, done)
},
'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) {
'Should select multiple items in file explorer #flaky #group1': function (browser: NightwatchBrowser) {
const selectedElements = []
browser
.openFile('contracts')
@ -20,10 +20,11 @@ module.exports = {
selectedElements.push(el)
})
browser.selectFiles(selectedElements)
.assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]')
.assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]')
.assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemtests"]')
.assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false })
.assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false })
.assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false })
},
'Should drag and drop multiple files in file explorer to tests folder #group1': function (browser: NightwatchBrowser) {
const selectedElements = []
if (browser.options.desiredCapabilities?.browserName === 'firefox') {
@ -41,29 +42,23 @@ module.exports = {
.perform((done) => {
browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' },
(el: any) => {
try {
const id = (el as any).value.getId();
browser
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]')
.dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id)
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () {
(document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click();
})
.waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]')
.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)
browser.perform(() =>done(error))
}
const id = (el as any).value.getId()
browser
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false })
.dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id)
.waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false })
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false })
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]', abortOnFailure: false })
.waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false })
.waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false })
.perform(() => done())
})
})
}
},
'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) {
'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) {
const selectedElements = []
if (browser.options.desiredCapabilities?.browserName === 'firefox') {
console.log('Skipping test for firefox')
@ -84,25 +79,18 @@ module.exports = {
.perform((done) => {
browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' },
(el: any) => {
try {
const id = (el as any).value.getId();
browser
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]')
.dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id)
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () {
(document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click();
})
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000)
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000)
.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)
browser.perform(() =>done(error))
}
const id = (el as any).value.getId()
browser
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts"]', abortOnFailure: false })
.dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id)
.waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false })
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/tests"]', abortOnFailure: false })
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', abortOnFailure: false })
.waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]', abortOnFailure: false })
.waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false })
.waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemREADME.txt"]', abortOnFailure: false })
.perform(() => done())
})
})
}

Loading…
Cancel
Save