abort on failure false

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

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

Loading…
Cancel
Save