remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/apps/remixdesktop/test/tests/app/gist.test.ts

33 lines
1.3 KiB

import { NightwatchBrowser } from 'nightwatch'
const gist_id = '02a847917a6a7ecaf4a7e0d4e68715bf'
const tests = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
done()
},
'start gist': !function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.waitForElementVisible('*[data-id="landingPageImportFromGist"]')
.click('*[data-id="landingPageImportFromGist"]')
.waitForElementVisible('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]')
.execute(function () {
(document.querySelector('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]') as any).focus()
})
.setValue('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]', gist_id)
.modalFooterOKClick('gisthandler')
.pause(3000)
.windowHandles(function (result) {
console.log(result.value)
browser.switchWindow(result.value[1])
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemREADME.txt"]')
})
.click('[data-id="treeViewLitreeViewItemcontracts"]')
.openFile('contracts/3_Ballot.sol')
.end()
}
}
module.exports = {
...tests
}