added test for switch workspace

pull/5370/head
lianahus 4 years ago committed by Aniket
parent f38531705a
commit 0224b5fa77
  1. 18
      apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
  2. 3
      apps/remix-ide/src/app/tabs/test-tab.js

@ -144,6 +144,24 @@ module.exports = {
.click('*[data-id="testTabGenerateTestFolder"]')
},
'Changing current path when workspace changed': function (browser: NightwatchBrowser) {
browser
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.clickLaunchIcon('solidityUnitTesting')
.clearValue('*[data-id="uiPathInput"]')
.setValue('*[data-id="uiPathInput"]', 'tests1')
.click('*[data-id="testTabGenerateTestFolder"]')
.clickLaunchIcon('filePanel')
.click('*[data-id="workspaceCreate"]') // create workspace_name
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
// eslint-disable-next-line dot-notation
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_new' })
.click('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok')
.clickLaunchIcon('solidityUnitTesting')
.assert.containsText('*[data-id="uiPathInput"]', 'tests')
},
'Solidity Unittests': function (browser: NightwatchBrowser) {
runTests(browser)
}

@ -595,7 +595,6 @@ module.exports = class TestTab extends ViewPlugin {
if (testDirInput) {
if (testDirInput.endsWith('/')) {
// check if the options list already contains the options
if (this.testTabLogic.currentPath === testDirInput.substr(0, testDirInput.length - 1)) {
this.createTestFolder.disabled = true
this.updateGenerateFileAction().disabled = true
@ -603,7 +602,7 @@ module.exports = class TestTab extends ViewPlugin {
this.updateDirList(testDirInput)
} else {
// If there is no matching folder in the workspace with entered text, enable Create button
if (this.pathAdded(testDirInput)) {
if (this.testTabLogic.pathExists(testDirInput)) {
this.createTestFolder.disabled = true
this.updateGenerateFileAction().disabled = false
} else {

Loading…
Cancel
Save