Update gist test

pull/668/head
ioedeveloper 4 years ago
parent e84d81bd7e
commit bd5c452116
  1. 24
      apps/remix-ide-e2e/src/tests/gist.test.ts
  2. 1
      libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx

@ -13,7 +13,7 @@ module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
'UploadToGists': function (browser: NightwatchBrowser) {
UploadToGists: function (browser: NightwatchBrowser) {
/*
- set the access token
- publish to gist
@ -24,18 +24,23 @@ module.exports = {
const runtimeBrowser = browser.options.desiredCapabilities.browserName
browser
.refresh()
.pause(10000)
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('fileExplorers')
.rightClick('[data-path="browser/README.txt"]')
.click('*[id="menuitemcreate folder"]')
.waitForElementVisible('*[data-id="modalDialogContainer"]')
.setValue('*[data-id="modalDialogCustomPromptText"]', 'Browser_Tests')
.modalFooterOKClick()
.click('[data-id="fileExplorerNewFilecreateNewFolder"]')
.pause(1000)
.keys('Browser_Tests')
.keys(browser.Keys.ENTER)
.waitForElementVisible('*[data-id="treeViewLibrowser/Browser_Tests"]')
.addFile('File.sol', { content: '' })
.click('*[data-id="fileExplorerNewFilepublishToGist"]')
.modalFooterOKClick()
.getModalBody((value, done) => {
.waitForElementVisible('*[data-id="modalDialogContainer-react"]')
.pause(2000)
.click('.modal-ok')
.getText('[data-id="modalDialogModalBody-react"]', (result) => {
console.log(result)
const value = typeof result.value === 'string' ? result.value : null
const reg = /gist.github.com\/([^.]+)/
const id = value.match(reg)
@ -45,13 +50,12 @@ module.exports = {
} else {
const gistid = id[1]
browser
.modalFooterCancelClick()
.click('[data-id="modal-footer-cancel-react"]')
.executeScript(`remix.loadgist('${gistid}')`)
.perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('browser/gists') } done() })
.waitForElementVisible(`li[key="browser/gists/${gistid}"]`)
.click(`li[key="browser/gists/${gistid}"]`)
.openFile(`browser/gists/${gistid}/README.txt`)
.perform(done)
}
})
},

@ -88,6 +88,7 @@ export const ModalDialog = (props: ModalDialogProps) => {
}
{ props.cancel &&
<span
data-id='modal-footer-cancel-react'
className={'modal-cancel btn btn-sm ' + (state.toggleBtn ? 'btn-light' : 'btn-dark')}
data-dismiss="modal"
onClick={() => {

Loading…
Cancel
Save