From bd5c4521167e728c9840c7d3a71082a0332a75be Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 14 Jan 2021 14:34:08 +0100 Subject: [PATCH] Update gist test --- apps/remix-ide-e2e/src/tests/gist.test.ts | 24 +++++++++++-------- .../src/lib/remix-ui-modal-dialog.tsx | 1 + 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/gist.test.ts b/apps/remix-ide-e2e/src/tests/gist.test.ts index 9c75fced9a..5c4901f8a4 100644 --- a/apps/remix-ide-e2e/src/tests/gist.test.ts +++ b/apps/remix-ide-e2e/src/tests/gist.test.ts @@ -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) } }) }, diff --git a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx index 929c23786b..154863fd44 100644 --- a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx +++ b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx @@ -88,6 +88,7 @@ export const ModalDialog = (props: ModalDialogProps) => { } { props.cancel && {