From 16993fa377daaabb2fea91ecce24a00573b44823 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 Mar 2022 16:53:08 +0100 Subject: [PATCH] fix tests --- apps/remix-ide-e2e/src/commands/openFile.ts | 2 +- apps/remix-ide-e2e/src/tests/url.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/openFile.ts b/apps/remix-ide-e2e/src/commands/openFile.ts index d1cf4aa0e4..baf0a89ea2 100644 --- a/apps/remix-ide-e2e/src/commands/openFile.ts +++ b/apps/remix-ide-e2e/src/commands/openFile.ts @@ -15,7 +15,7 @@ class OpenFile extends EventEmitter { // click on fileExplorer can toggle it. We go through settings to be sure FE is open function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) { - browser.clickLaunchIcon('settings').clickLaunchIcon('filePanel') + browser.clickLaunchIcon('settings').pause(500).clickLaunchIcon('filePanel') .waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000) .click('li[data-id="treeViewLitreeViewItem' + name + '"') .pause(2000) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index b104ddf42e..e6233ae2e7 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -31,7 +31,7 @@ module.exports = { .assert.containsText('*[data-id="compilerContainerCompileBtn"]', 'contract-76747f6e19.sol') .currentWorkspaceIs('code-sample') .getEditorValue((content) => { - browser.assert.ok(content.indexOf( + browser.assert.ok(content && content.indexOf( 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1, 'code has not been loaded') }) @@ -45,7 +45,7 @@ module.exports = { .pause(5000) .currentWorkspaceIs('code-sample') .getEditorValue((content) => { - browser.assert.ok(content.indexOf( + browser.assert.ok(content && content.indexOf( 'proposals.length = _numProposals;') !== -1, 'url has not been loaded') }) @@ -59,7 +59,7 @@ module.exports = { .pause(5000) .currentWorkspaceIs('code-sample') .getEditorValue((content) => { - browser.assert.ok(content.indexOf( + browser.assert.ok(content && content.indexOf( 'proposals.length = _numProposals;') !== -1, 'code has not been loaded') })