pull/5370/head
yann300 4 years ago
parent 2378304cd0
commit 7827a965a4
  1. 6
      apps/remix-ide-e2e/src/tests/fileExplorer.test.ts
  2. 14
      apps/remix-ide-e2e/src/tests/workspace.test.ts
  3. 4
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -40,11 +40,7 @@ module.exports = {
'Should delete file `5_Renamed_Contract.sol` from file explorer': function (browser: NightwatchBrowser) { 'Should delete file `5_Renamed_Contract.sol` from file explorer': function (browser: NightwatchBrowser) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]')
.rightClick('[data-path="5_Renamed_Contract.sol"]') .removeFile('5_Renamed_Contract.sol', 'default_workspace')
.click('*[id="menuitemdelete"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"')
}, },

@ -34,18 +34,16 @@ module.exports = {
browser browser
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.click('*[data-id="workspaceCreate"]') // create workspace_name .click('*[data-id="workspaceCreate"]') // create workspace_name
.waitForElementVisible('*[data-id="modalDialogCustomPromptText"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
.clearValue('*[data-id="modalDialogCustomPromptText"]') .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name' })
.setValue('*[data-id="modalDialogCustomPromptText"]', 'workspace_name') .click('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.modalFooterOKClick()
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.addFile('test.sol', { content: 'test' }) .addFile('test.sol', { content: 'test' })
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]')
.click('*[data-id="workspaceCreate"]') // create workspace_name_1 .click('*[data-id="workspaceCreate"]') // create workspace_name_1
.waitForElementVisible('*[data-id="modalDialogCustomPromptText"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
.clearValue('*[data-id="modalDialogCustomPromptText"]') .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name_1' })
.setValue('*[data-id="modalDialogCustomPromptText"]', 'workspace_name_1') .click('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.modalFooterOKClick()
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]')
.click('*[data-id="workspacesSelect"] option[value="workspace_name"]') .click('*[data-id="workspacesSelect"] option[value="workspace_name"]')

@ -259,7 +259,7 @@ export const Workspace = (props: WorkspaceProps) => {
return ( return (
<> <>
<span>{ state.modal.message }</span> <span>{ state.modal.message }</span>
<input data-id="modalDialogCustomPromptText" placeholder={`workspace_${Date.now()}`} ref={workspaceCreateInput} className="form-control" /> <input type="text" data-id="modalDialogCustomPromptTextCreate" placeholder={`workspace_${Date.now()}`} ref={workspaceCreateInput} className="form-control" />
</> </>
) )
} }
@ -268,7 +268,7 @@ export const Workspace = (props: WorkspaceProps) => {
return ( return (
<> <>
<span>{ state.modal.message }</span> <span>{ state.modal.message }</span>
<input data-id="modalDialogCustomPromptText" placeholder={ state.currentWorkspace } ref={workspaceRenameInput} className="form-control" /> <input type="text" data-id="modalDialogCustomPromptTextRename" placeholder={ state.currentWorkspace } ref={workspaceRenameInput} className="form-control" />
</> </>
) )
} }

Loading…
Cancel
Save