fixing workspace test

pull/5370/head
davidzagi93@gmail.com 3 years ago
parent ac3a87739f
commit c4a199d6f8
  1. 30
      apps/remix-ide-e2e/src/tests/workspace.test.ts
  2. 3
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -19,7 +19,7 @@ module.exports = {
browser
.pause(5000)
.refresh()
.pause(2000)
.pause(5000)
.getEditorValue((content) => {
browser.assert.ok(content.indexOf('contract Ballot {') !== -1, 'content doesn\'t include Ballot contract')
})
@ -37,24 +37,20 @@ module.exports = {
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
// eslint-disable-next-line dot-notation
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name' })
.pause(5000)
.waitForElementPresent('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.waitForElementVisible('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.click('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.pause(1000)
.waitForElementVisible('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span')
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"]')
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.addFile('test.sol', { content: 'test' })
.pause(1000)
// .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
.click('*[data-id="workspaceCreate"]') // create workspace_name_1
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
// eslint-disable-next-line dot-notation
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name_1' })
.waitForElementPresent('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.click('span[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"]')
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.pause(2000)
// .waitForElementNotVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]')
.click('*[data-id="workspacesSelect"] option[value="workspace_name"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
},
@ -70,8 +66,8 @@ module.exports = {
.waitForElementPresent('span[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.click('span[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.click('*[data-id="workspacesSelect"] option[value="workspace_name_1"]')
.pause(6000)
// .waitForElementNotVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
.pause(1000)
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]')
.click('*[data-id="workspacesSelect"] option[value="workspace_name_renamed"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
},
@ -80,8 +76,10 @@ module.exports = {
browser
.click('*[data-id="workspacesSelect"] option[value="workspace_name_1"]')
.click('*[data-id="workspaceDelete"]') // delete workspace_name_1
.waitForElementVisible('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.click('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.pause(5000)
.waitForElementVisible('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span')
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"]')
.click('[data-id="workspacesModalDialogModalDialogModalFooter-react"] > span')
.waitForElementNotPresent('*[data-id="workspacesSelect"] option[value="workspace_name_1"]')
.end()
},

@ -332,7 +332,7 @@ export const Workspace = (props: WorkspaceProps) => {
return (
<div className='remixui_container'>
<ModalDialog
{ state.modal.message && <ModalDialog
id='workspacesModalDialog'
title={ state.modal.title }
message={ state.modal.message }
@ -344,6 +344,7 @@ export const Workspace = (props: WorkspaceProps) => {
handleHide={ handleHideModal }>
{ (typeof state.modal.message !== 'string') && state.modal.message }
</ModalDialog>
}
<Toaster message={state.toasterMsg} />
<div className='remixui_fileexplorer' onClick={() => resetFocus(true)}>
<div>

Loading…
Cancel
Save