From af3647ae03657f0b4273e09b2902482a419361e1 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 11 Dec 2023 17:02:39 +0100 Subject: [PATCH] fix url test --- apps/remix-ide-e2e/src/tests/url.test.ts | 23 +++++++++++++------ .../src/lib/compiler-container.tsx | 12 +++++----- .../src/lib/components/compiler-dropdown.tsx | 22 +++++++++--------- .../src/lib/solidity-compiler.tsx | 2 +- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 80405d41a8..adf800ab0b 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -224,8 +224,10 @@ module.exports = { .clickLaunchIcon('solidity') .click('*[data-id="scConfigExpander"]') - .waitForElementVisible('#versionSelector option[data-id="selected"]') - .assert.containsText('#versionSelector option[data-id="selected"]', '0.8.16+commit.07a7930e') + .waitForElementVisible({ + selector: "//*[@data-id='selectedVersion' and contains(.,'0.8.16+commit.07a7930e')]", + locateStrategy: 'xpath' + }) .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'istanbul') .assert.containsText('#compilierLanguageSelector option[data-id="selected"]', 'Yul') .verify.elementPresent('#optimize:checked') @@ -235,14 +237,18 @@ module.exports = { .refreshPage() .clickLaunchIcon('solidity') - .waitForElementVisible('#versionSelector option[data-id="selected"]') - .assert.containsText('#versionSelector option[data-id="selected"]', '0.8.7+commit.e28d00a7') + .waitForElementVisible({ + selector: "//*[@data-id='selectedVersion' and contains(.,'0.8.7+commit.e28d00a7')]", + locateStrategy: 'xpath' + }) .url('http://127.0.0.1:8080/#version=0.8.15+commit.e14f2714') .refreshPage() .pause(3000) .clickLaunchIcon('solidity') - .waitForElementVisible('#versionSelector option[data-id="selected"]') - .assert.containsText('#versionSelector option[data-id="selected"]', '0.8.15+commit.e14f2714') + .waitForElementVisible({ + selector: "//*[@data-id='selectedVersion' and contains(.,'0.8.15+commit.e14f2714')]", + locateStrategy: 'xpath' + }) }, 'Should load using compiler from link passed in remix URL #group3': function (browser: NightwatchBrowser) { @@ -253,7 +259,10 @@ module.exports = { .clickLaunchIcon('solidity') .click('*[data-id="scConfigExpander"]') - .assert.containsText('#versionSelector option[data-id="selected"]', 'custom') + .waitForElementVisible({ + selector: "//*[@data-id='selectedVersion' and contains(.,'custom')]", + locateStrategy: 'xpath' + }) // default values .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default') .verify.elementPresent('#optimize') diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index a725276ef5..15cad845ab 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -798,12 +798,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => { {platform === appPlatformTypes.desktop ? -
- - -
:null} +
+ + +
:null}
void, - _shouldBeAdded: (version: string) => {}, + _shouldBeAdded: (version: string) => boolean, onlyDownloaded: boolean } @@ -26,22 +26,22 @@ export const CompilerDropdown = (props: compilerDropdownProps) => {
-
- {customVersions.map((url, i) => { - if (selectedVersion === url) return (custom) - })} - {allversions.map((build, i) => { +
+ {customVersions.map((url, i) => { + if (selectedVersion === url) return (custom) + })} + {allversions.map((build, i) => { - if ((selectedVersion || defaultVersion) === build.path) { - return ({build.longVersion}) - } - })} + if ((selectedVersion || defaultVersion) === build.path) { + return ({build.longVersion}) + } + })}
- {allversions.length <= 0 && ( + {allversions.length <= 0 && ( { prerelease: '' } const binVersions = data.binList - let selectorList = binVersions + const selectorList = binVersions const wasmVersions = data.wasmList selectorList.forEach((compiler, index) => {