fix url test

pull/4346/head
filip mertens 1 year ago
parent feb7535fd7
commit 1bbe4bbcaf
  1. 23
      apps/remix-ide-e2e/src/tests/url.test.ts
  2. 12
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  3. 22
      libs/remix-ui/solidity-compiler/src/lib/components/compiler-dropdown.tsx
  4. 2
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx

@ -224,8 +224,10 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="scConfigExpander"]') .click('*[data-id="scConfigExpander"]')
.waitForElementVisible('#versionSelector option[data-id="selected"]') .waitForElementVisible({
.assert.containsText('#versionSelector option[data-id="selected"]', '0.8.16+commit.07a7930e') selector: "//*[@data-id='selectedVersion' and contains(.,'0.8.16+commit.07a7930e')]",
locateStrategy: 'xpath'
})
.assert.containsText('#evmVersionSelector option[data-id="selected"]', 'istanbul') .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'istanbul')
.assert.containsText('#compilierLanguageSelector option[data-id="selected"]', 'Yul') .assert.containsText('#compilierLanguageSelector option[data-id="selected"]', 'Yul')
.verify.elementPresent('#optimize:checked') .verify.elementPresent('#optimize:checked')
@ -235,14 +237,18 @@ module.exports = {
.refreshPage() .refreshPage()
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.waitForElementVisible('#versionSelector option[data-id="selected"]') .waitForElementVisible({
.assert.containsText('#versionSelector option[data-id="selected"]', '0.8.7+commit.e28d00a7') 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') .url('http://127.0.0.1:8080/#version=0.8.15+commit.e14f2714')
.refreshPage() .refreshPage()
.pause(3000) .pause(3000)
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.waitForElementVisible('#versionSelector option[data-id="selected"]') .waitForElementVisible({
.assert.containsText('#versionSelector option[data-id="selected"]', '0.8.15+commit.e14f2714') 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) { 'Should load using compiler from link passed in remix URL #group3': function (browser: NightwatchBrowser) {
@ -253,7 +259,10 @@ module.exports = {
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="scConfigExpander"]') .click('*[data-id="scConfigExpander"]')
.assert.containsText('#versionSelector option[data-id="selected"]', 'custom') .waitForElementVisible({
selector: "//*[@data-id='selectedVersion' and contains(.,'custom')]",
locateStrategy: 'xpath'
})
// default values // default values
.assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default') .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default')
.verify.elementPresent('#optimize') .verify.elementPresent('#optimize')

@ -798,12 +798,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
</label> </label>
</div> </div>
{platform === appPlatformTypes.desktop ? {platform === appPlatformTypes.desktop ?
<div className="mb-2 flex-row-reverse remixui_nightlyBuilds custom-control custom-checkbox"> <div className="mb-2 flex-row-reverse remixui_nightlyBuilds custom-control custom-checkbox">
<input className="mr-2 custom-control-input" id="downloadedcompilers" type="checkbox" onChange={handleOnlyDownloadedChange} checked={state.onlyDownloaded} /> <input className="mr-2 custom-control-input" id="downloadedcompilers" type="checkbox" onChange={handleOnlyDownloadedChange} checked={state.onlyDownloaded} />
<label htmlFor="downloadedcompilers" data-id="compilerNightliesBuild" className="form-check-label custom-control-label"> <label htmlFor="downloadedcompilers" data-id="compilerNightliesBuild" className="form-check-label custom-control-label">
<FormattedMessage id="solidity.downloadedCompilers" /> <FormattedMessage id="solidity.downloadedCompilers" />
</label> </label>
</div>:null} </div>:null}
<div className="mt-2 remixui_compilerConfig custom-control custom-checkbox"> <div className="mt-2 remixui_compilerConfig custom-control custom-checkbox">
<input <input
className="remixui_autocompile custom-control-input" className="remixui_autocompile custom-control-input"

@ -15,7 +15,7 @@ interface compilerDropdownProps {
defaultVersion: string, defaultVersion: string,
allversions: compilerVersion[], allversions: compilerVersion[],
handleLoadVersion: (url: string) => void, handleLoadVersion: (url: string) => void,
_shouldBeAdded: (version: string) => {}, _shouldBeAdded: (version: string) => boolean,
onlyDownloaded: boolean onlyDownloaded: boolean
} }
@ -26,22 +26,22 @@ export const CompilerDropdown = (props: compilerDropdownProps) => {
<Dropdown id="versionSelector" data-id="versionSelector"> <Dropdown id="versionSelector" data-id="versionSelector">
<Dropdown.Toggle as={CompilerMenuToggle} id="dropdown-custom-components" className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control" icon={null}> <Dropdown.Toggle as={CompilerMenuToggle} id="dropdown-custom-components" className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control" icon={null}>
<div style={{ flexGrow: 1, overflow: 'hidden', display:'flex', justifyContent:'left' }}> <div style={{ flexGrow: 1, overflow: 'hidden', display:'flex', justifyContent:'left' }}>
<div className="text-truncate"> <div className="text-truncate">
{customVersions.map((url, i) => { {customVersions.map((url, i) => {
if (selectedVersion === url) return (<span key={i}>custom</span>) if (selectedVersion === url) return (<span data-id="selectedVersion" key={i}>custom</span>)
})} })}
{allversions.map((build, i) => { {allversions.map((build, i) => {
if ((selectedVersion || defaultVersion) === build.path) { if ((selectedVersion || defaultVersion) === build.path) {
return (<span key={i}>{build.longVersion}</span>) return (<span data-id="selectedVersion" key={i}>{build.longVersion}</span>)
} }
})} })}
</div> </div>
</div> </div>
</Dropdown.Toggle> </Dropdown.Toggle>
<Dropdown.Menu as={CompilerMenu} className="w-100 custom-dropdown-items overflow-hidden" data-id="custom-dropdown-items"> <Dropdown.Menu as={CompilerMenu} className="w-100 custom-dropdown-items overflow-hidden" data-id="custom-dropdown-items">
{allversions.length <= 0 && ( {allversions.length <= 0 && (
<Dropdown.Item <Dropdown.Item
key={`default`} key={`default`}
data-id='builtin' data-id='builtin'

@ -166,7 +166,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
prerelease: '' prerelease: ''
} }
const binVersions = data.binList const binVersions = data.binList
let selectorList = binVersions const selectorList = binVersions
const wasmVersions = data.wasmList const wasmVersions = data.wasmList
selectorList.forEach((compiler, index) => { selectorList.forEach((compiler, index) => {

Loading…
Cancel
Save