Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed May 2, 2024
1 parent 4541632 commit b95c21a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apps/remix-ide-e2e/src/commands/selectFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { NightwatchBrowser } from "nightwatch"
class SelectFiles extends EventEmitter {
command (this: NightwatchBrowser, selectedElements: any[]): NightwatchBrowser {
const browser = this.api

const self = this
browser.perform(function () {
const actions = this.actions({ async: true })
actions.keyDown(this.Keys.SHIFT)
for(let i = 0; i < selectedElements.length; i++) {
actions.click(selectedElements[i].value)
}
self.emit('complete')
return actions.contextClick(selectedElements[0].value)
})
this.emit('complete')
})
return this
}
}
Expand Down
16 changes: 12 additions & 4 deletions apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,19 @@ module.exports = {
browser
.clickLaunchIcon('filePanel')
.click({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' })
.findElement({ selector: '//*[@data-id="treeViewDivtreeViewItemREADME.txt"]', locateStrategy: 'xpath' }, (el) => {
selectedElements.push(el)
.perform((done) => {
browser.findElement({ selector: '//*[@data-id="treeViewDivtreeViewItemREADME.txt"]', locateStrategy: 'xpath' }, (el) => {
selectedElements.push(el)
done()
})
})
.perform((done) => {
console.log('selectFiles', selectedElements)
browser.selectFiles(selectedElements)
done()
})
browser.selectFiles(selectedElements)
browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' },
.selectFiles(selectedElements)
.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' },
(el: any) => {
const id = (el as any).value.getId()
browser
Expand Down

0 comments on commit b95c21a

Please sign in to comment.