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')
.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')

@ -798,12 +798,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
</label>
</div>
{platform === appPlatformTypes.desktop ?
<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} />
<label htmlFor="downloadedcompilers" data-id="compilerNightliesBuild" className="form-check-label custom-control-label">
<FormattedMessage id="solidity.downloadedCompilers" />
</label>
</div>:null}
<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} />
<label htmlFor="downloadedcompilers" data-id="compilerNightliesBuild" className="form-check-label custom-control-label">
<FormattedMessage id="solidity.downloadedCompilers" />
</label>
</div>:null}
<div className="mt-2 remixui_compilerConfig custom-control custom-checkbox">
<input
className="remixui_autocompile custom-control-input"

@ -15,7 +15,7 @@ interface compilerDropdownProps {
defaultVersion: string,
allversions: compilerVersion[],
handleLoadVersion: (url: string) => void,
_shouldBeAdded: (version: string) => {},
_shouldBeAdded: (version: string) => boolean,
onlyDownloaded: boolean
}
@ -26,22 +26,22 @@ export const CompilerDropdown = (props: compilerDropdownProps) => {
<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}>
<div style={{ flexGrow: 1, overflow: 'hidden', display:'flex', justifyContent:'left' }}>
<div className="text-truncate">
{customVersions.map((url, i) => {
if (selectedVersion === url) return (<span key={i}>custom</span>)
})}
{allversions.map((build, i) => {
<div className="text-truncate">
{customVersions.map((url, i) => {
if (selectedVersion === url) return (<span data-id="selectedVersion" key={i}>custom</span>)
})}
{allversions.map((build, i) => {
if ((selectedVersion || defaultVersion) === build.path) {
return (<span key={i}>{build.longVersion}</span>)
}
})}
if ((selectedVersion || defaultVersion) === build.path) {
return (<span data-id="selectedVersion" key={i}>{build.longVersion}</span>)
}
})}
</div>
</div>
</Dropdown.Toggle>
<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
key={`default`}
data-id='builtin'

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

Loading…
Cancel
Save