pull/5370/head
yann300 4 years ago
parent a6bbd39193
commit ba744311ba
  1. 10
      apps/remix-ide-e2e/src/commands/removeFile.ts
  2. 3
      apps/remix-ide-e2e/src/tests/fileExplorer.test.ts
  3. 2
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  4. 2
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  5. 2
      apps/remix-ide-e2e/src/types/index.d.ts

@ -3,9 +3,9 @@ import { NightwatchBrowser } from 'nightwatch'
const EventEmitter = require('events')
class RemoveFile extends EventEmitter {
command (this: NightwatchBrowser, path: string): NightwatchBrowser {
command (this: NightwatchBrowser, path: string, workspace: string): NightwatchBrowser {
this.api.perform((done) => {
removeFile(this.api, path, () => {
removeFile(this.api, path, workspace, () => {
done()
this.emit('complete')
})
@ -14,7 +14,7 @@ class RemoveFile extends EventEmitter {
}
}
function removeFile (browser: NightwatchBrowser, path: string, done: VoidFunction) {
function removeFile (browser: NightwatchBrowser, path: string, workspace: string, done: VoidFunction) {
browser.execute(function (path) {
function contextMenuClick (element) {
const evt = element.ownerDocument.createEvent('MouseEvents')
@ -39,8 +39,8 @@ function removeFile (browser: NightwatchBrowser, path: string, done: VoidFunctio
.pause(2000)
.perform(() => {
console.log(path, 'to remove')
browser.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
.click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
browser.waitForElementVisible('*[data-id="' + workspace + 'ModalDialogContainer-react"] .modal-ok')
.click('*[data-id="' + workspace + 'ModalDialogContainer-react"] .modal-ok')
.waitForElementNotPresent('[data-path="' + path + '"]')
done()
})

@ -43,7 +43,8 @@ module.exports = {
.rightClick('[data-path="5_Renamed_Contract.sol"]')
.click('*[id="menuitemdelete"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.click('*[data-id="default_workspace-modal-footer-ok-react"]')
.waitForElementVisible('*[data-id="default_workspaceModalDialogContainer-react"]')
.click('*[data-id="default_workspaceModalDialogContainer-react"] .modal-ok')
.waitForElementNotPresent('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"')
},

@ -125,7 +125,7 @@ function runTests (browser: NightwatchBrowser) {
.pause(1000)
.renamePath('folder1/contract_' + browserName + '.sol', 'renamed_contract_' + browserName + '.sol', 'folder1/renamed_contract_' + browserName + '.sol')
.pause(1000)
.removeFile('folder1/contract_' + browserName + '_toremove.sol')
.removeFile('folder1/contract_' + browserName + '_toremove.sol', 'localhost')
.perform(function (done) {
testImportFromRemixd(browser, () => { done() })
})

@ -37,7 +37,7 @@ module.exports = {
.clickLaunchIcon('fileExplorers')
.pause(10000)
.openFile('tests/simple_storage_test.sol')
.removeFile('tests/simple_storage_test.sol')
.removeFile('tests/simple_storage_test.sol', 'default_workspace')
},
'Should run simple unit test `simple_storage_test.sol` ': function (browser: NightwatchBrowser) {

@ -41,7 +41,7 @@ declare module "nightwatch" {
getInstalledPlugins(cb: (plugins: string[]) => void): NightwatchBrowser,
verifyCallReturnValue(address: string, checks: string[]): NightwatchBrowser,
testEditorValue(testvalue: string): NightwatchBrowser,
removeFile(path: string): NightwatchBrowser,
removeFile(path: string, workspace: string): NightwatchBrowser,
switchBrowserWindow(url: string, windowName: string, cb: (browser: NightwatchBrowser, window?: NightwatchCallbackResult<Window>) => void): NightwatchBrowser,
setupMetamask(passphrase: string, password: string): NightwatchBrowser,
signMessage(msg: string, callback: (hash: { value: string }, signature: { value: string }) => void): NightwatchBrowser,

Loading…
Cancel
Save