Commit 44a736af authored by ioedeveloper's avatar ioedeveloper

Include negative test for missing gist token

parent aea6b63f
...@@ -74,10 +74,6 @@ module.exports = { ...@@ -74,10 +74,6 @@ module.exports = {
.modalFooterCancelClick() .modalFooterCancelClick()
}, },
'Display Error Message For Missing Gist Token': function (browser: NightwatchBrowser) {
},
'Display Error Message For Invalid Gist ID': function (browser: NightwatchBrowser) { 'Display Error Message For Invalid Gist ID': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
...@@ -91,9 +87,32 @@ module.exports = { ...@@ -91,9 +87,32 @@ module.exports = {
.modalFooterOKClick() .modalFooterOKClick()
}, },
'Display Error Message For Missing Gist Token When Publishing': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('settings')
.waitForElementVisible('[data-id="settingsTabRemoveGistToken"]')
.click('[data-id="settingsTabRemoveGistToken"]')
.clickLaunchIcon('fileExplorers')
.waitForElementVisible('*[data-id="fileExplorerNewFilepublishToGist"]')
.click('*[data-id="fileExplorerNewFilepublishToGist"]')
.waitForElementVisible('*[data-id="browserModalDialogContainer-react"]')
.pause(2000)
.click('.modal-ok')
.pause(10000)
.getText('[data-id="browserModalDialogModalBody-react"]', (result) => {
browser.assert.ok(result.value === 'Remix requires an access token (which includes gists creation permission). Please go to the settings tab to create one.', 'Assert failed. Gist token error message not displayed.')
})
.click('[data-id="browser-modal-footer-cancel-react"]')
},
'Import From Gist For Valid Gist ID': function (browser: NightwatchBrowser) { 'Import From Gist For Valid Gist ID': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('settings')
.click('*[data-id="settingsTabGenerateContractMetadataLabel"]')
.setValue('[data-id="settingsTabGistAccessToken"]', process.env.gist_token)
.click('[data-id="settingsTabSaveGistToken"]')
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.scrollAndClick('*[data-id="landingPageImportFromGistButton"]') .scrollAndClick('*[data-id="landingPageImportFromGistButton"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptText"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptText"]')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment