From 2fe52a1f1dac5f48ea84d71ac3f2c7a3904afa27 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 18 Jun 2021 16:53:02 +0200 Subject: [PATCH] fix e2e --- apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts | 5 +++-- apps/remix-ide-e2e/src/tests/url.spec.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts b/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts index c9cb20e514..a090735f45 100644 --- a/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts +++ b/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts @@ -4,8 +4,9 @@ import EventEmitter from 'events' class CurrentWorkspaceIs extends EventEmitter { command (this: NightwatchBrowser, name: string): NightwatchBrowser { this.api - .execute(() => { - return (document.querySelector('select[data-id="workspacesSelect"]') as any).value + .execute(function () { + const el = document.querySelector('select[data-id="workspacesSelect"]') as HTMLSelectElement + return el.value }, [], (result) => { console.log(result) this.api.assert.equal(result.value, name) diff --git a/apps/remix-ide-e2e/src/tests/url.spec.ts b/apps/remix-ide-e2e/src/tests/url.spec.ts index 8caad7dbf0..898bc311d6 100644 --- a/apps/remix-ide-e2e/src/tests/url.spec.ts +++ b/apps/remix-ide-e2e/src/tests/url.spec.ts @@ -23,7 +23,7 @@ module.exports = { .url('http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0') .refresh() // we do one reload for making sure we already have the default workspace .pause(5000) - .currentWorkspaceIs('code-sample2') + .currentWorkspaceIs('code-sample') .getEditorValue((content) => { browser.assert.ok(content.indexOf( 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1,