fixed the test

pull/262/head
LianaHus 5 years ago committed by yann300
parent 50d9b675b2
commit 4057e2eb08
  1. 6
      src/app/files/file-explorer.js
  2. 4
      src/app/tabs/test-tab.js
  3. 6
      test-browser/tests/fileExplorer.test.js
  4. 1
      test-browser/tests/generalSettings.test.js
  5. 2
      test-browser/tests/gist.test.js

@ -104,8 +104,8 @@ function fileExplorer (localRegistry, files, menuItems) {
self.ensureRoot(() => { self.ensureRoot(() => {
const folderpath = filepath.split('/').slice(0, -1).join('/') const folderpath = filepath.split('/').slice(0, -1).join('/')
const currentTree = self.treeView.nodeAt(folderpath) const currentTree = self.treeView.nodeAt(folderpath)
if (!self.treeView.isExpanded(folderpath)) self.treeView.expand(folderpath)
if (currentTree && self.treeView.isExpanded(folderpath)) { if (currentTree) {
self.files.resolveDirectory(folderpath, (error, fileTree) => { self.files.resolveDirectory(folderpath, (error, fileTree) => {
if (error) console.error(error) if (error) console.error(error)
if (!fileTree) return if (!fileTree) return
@ -136,7 +136,7 @@ function fileExplorer (localRegistry, files, menuItems) {
if (!fileTree) return if (!fileTree) return
fileTree = normalize(folderpath, fileTree) fileTree = normalize(folderpath, fileTree)
self.treeView.updateNodeFromJSON(folderpath, fileTree, true) self.treeView.updateNodeFromJSON(folderpath, fileTree, true)
self.treeview.expand(folderpath) if (!self.treeView.isExpanded(folderpath)) self.treeView.expand(folderpath)
}) })
}) })
} }

@ -494,10 +494,11 @@ module.exports = class TestTab extends ViewPlugin {
this.testsExecutionStopped = yo`<label class="text-warning h6" data-id="testTabTestsExecutionStopped">The test execution has been stopped</label>` this.testsExecutionStopped = yo`<label class="text-warning h6" data-id="testTabTestsExecutionStopped">The test execution has been stopped</label>`
this.testsExecutionStoppedError = yo`<label class="text-danger h6" data-id="testTabTestsExecutionStoppedError">The test execution has been stopped because of error(s) in your test file</label>` this.testsExecutionStoppedError = yo`<label class="text-danger h6" data-id="testTabTestsExecutionStoppedError">The test execution has been stopped because of error(s) in your test file</label>`
this.uiPathList = yo`<datalist id="utPathList"></datalist>` this.uiPathList = yo`<datalist id="utPathList"></datalist>`
const placeHolderPath = 'browser/tests'
const availablePaths = yo` const availablePaths = yo`
<div> <div>
<input <input
placeholder="browser/tests" placeholder=${placeHolderPath}
list="utPathList" list="utPathList"
class="custom-select" class="custom-select"
id="utPath" id="utPath"
@ -544,6 +545,7 @@ module.exports = class TestTab extends ViewPlugin {
</div> </div>
` `
this._view.el = el this._view.el = el
this.testTabLogic.setCurrentPath(placeHolderPath)
this.updateForNewCurrent(this.fileManager.currentFile()) this.updateForNewCurrent(this.fileManager.currentFile())
return el return el
} }

@ -22,8 +22,7 @@ module.exports = {
.waitForElementVisible('*[data-id="modalDialogContainer"]') .waitForElementVisible('*[data-id="modalDialogContainer"]')
.setValue('*[data-id="modalDialogCustomPromptText"]', '5_New_contract.sol') .setValue('*[data-id="modalDialogCustomPromptText"]', '5_New_contract.sol')
.modalFooterOKClick() .modalFooterOKClick()
.pause(2000) .waitForElementVisible('*[data-id="treeViewLibrowser/5_New_contract.sol"]', 7000)
.waitForElementVisible('*[data-id="treeViewLibrowser/5_New_contract.sol"]')
}, },
'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol': function (browser) { 'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol': function (browser) {
@ -86,8 +85,7 @@ module.exports = {
.click('*[data-id="fileExplorerNewFilepublishToGist"]') .click('*[data-id="fileExplorerNewFilepublishToGist"]')
.waitForElementVisible('*[data-id="modalDialogContainer"]') .waitForElementVisible('*[data-id="modalDialogContainer"]')
.modalFooterOKClick() .modalFooterOKClick()
.pause(10000) .waitForElementVisible('*[data-id="modalDialogContainer"]', 7000)
.waitForElementVisible('*[data-id="modalDialogContainer"]')
.modalFooterOKClick() .modalFooterOKClick()
.pause(2000) .pause(2000)
.perform((done) => { .perform((done) => {

@ -37,7 +37,6 @@ module.exports = {
.click('*[data-id="compilerContainerCompileBtn"]') .click('*[data-id="compilerContainerCompileBtn"]')
.pause(3000) .pause(3000)
.click('*[data-id="verticalIconsKindfileExplorers"]') .click('*[data-id="verticalIconsKindfileExplorers"]')
.openFile('browser/artifacts')
.openFile('browser/artifacts/Ballot.json') .openFile('browser/artifacts/Ballot.json')
}, },

@ -45,7 +45,6 @@ module.exports = {
.modalFooterCancelClick() .modalFooterCancelClick()
.executeScript(`remix.loadgist('${gistid}')`) .executeScript(`remix.loadgist('${gistid}')`)
.perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('browser/gists') } done() }) .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('browser/gists') } done() })
.openFile(`browser/gists/${gistid}`)
.openFile(`browser/gists/${gistid}/1_Storage.sol`) .openFile(`browser/gists/${gistid}/1_Storage.sol`)
.perform(done) .perform(done)
} }
@ -86,7 +85,6 @@ module.exports = {
.waitForElementVisible('*[data-id="modalDialogCustomPromptText"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptText"]')
.setValue('*[data-id="modalDialogCustomPromptText"]', testData.validGistId) .setValue('*[data-id="modalDialogCustomPromptText"]', testData.validGistId)
.modalFooterOKClick() .modalFooterOKClick()
.openFile(`browser/gists/${testData.validGistId}`)
.openFile(`browser/gists/${testData.validGistId}/ApplicationRegistry`) .openFile(`browser/gists/${testData.validGistId}/ApplicationRegistry`)
.waitForElementVisible(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry']`) .waitForElementVisible(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry']`)
.assert.containsText(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry'] > span`, 'ApplicationRegistry') .assert.containsText(`div[title='browser/gists/${testData.validGistId}/ApplicationRegistry'] > span`, 'ApplicationRegistry')

Loading…
Cancel
Save