From 80241de051ea645b7009fa02e8b83cc7e8fa1234 Mon Sep 17 00:00:00 2001 From: lianahus Date: Fri, 17 Mar 2023 15:33:39 +0100 Subject: [PATCH] e2e --- apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts | 2 +- apps/remix-ide-e2e/src/tests/importFromGithub.test.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts b/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts index 81164cb97a..f89f4a36ef 100644 --- a/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts +++ b/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts @@ -4,7 +4,7 @@ import EventEmitter from 'events' class CurrentSelectedFileIs extends EventEmitter { command (this: NightwatchBrowser, value: string): NightwatchBrowser { this.api - .waitForElementContainsText('*[data-id="tabs-component"] *[data-id="tab-active"]', value) + .waitForElementContainsText('*[data-id="tabs-component"] *[data-id="activeTabTitle"]', value) .perform(() => { this.emit('complete') }) diff --git a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts index cf163dbb94..9ff05a5b4c 100644 --- a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts +++ b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts @@ -18,7 +18,7 @@ module.exports = { browser.clickLaunchIcon('home') .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .clickLaunchIcon('filePanel') - .click('div[title="home"]') + .click('div[title="Home"]') .waitForElementVisible('button[data-id="landingPageImportFromGitHubButton"]') .pause(1000) .click('button[data-id="landingPageImportFromGitHubButton"]') @@ -57,7 +57,10 @@ module.exports = { .waitForElementVisible('*[data-id="homeTab-modal-footer-ok-react"]') .click('[data-id="homeTab-modal-footer-ok-react"]') .openFile('github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol') - .waitForElementVisible("div[title='default_workspace/github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol'") + .waitForElementVisible({ + selector: `//*[@data-id='activeTabTitle' and contains(., "default_workspace/github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol")]`, + locateStrategy: 'xpath' + }) .getEditorValue((content) => { browser.assert.ok(content.indexOf('library Roles {') !== -1, 'content does contain "library Roles {"') })