cleanup e2e. clean up comments. add default compiler version

pull/4841/head
Joseph Izang 6 months ago
parent ecdfbbd7d5
commit c26f1d86ca
  1. 51
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  2. 21
      libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx
  3. 17
      libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx
  4. 4
      libs/remix-ui/run-tab/src/lib/run-tab.tsx

@ -167,7 +167,7 @@ module.exports = {
}, },
'Should print hardhat logs #group4': function (browser: NightwatchBrowser) { 'Should print hardhat logs #group4': function (browser: NightwatchBrowser) {
browser browser
.addFile('printHardhatlog.sol', { content: hardhatLog }) .addFile('printHardhatlog.sol', { content: hardhatLog })
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.waitForElementVisible('[for="autoCompile"]') .waitForElementVisible('[for="autoCompile"]')
@ -266,22 +266,22 @@ module.exports = {
if (Array.isArray(result.value) && result.value.length > 0) { if (Array.isArray(result.value) && result.value.length > 0) {
console.log('Found ' + result.value.length + ' transactions') console.log('Found ' + result.value.length + ' transactions')
browser browser
.click({ .click({
selector: '[data-id="listenNetworkCheckInput"]', selector: '[data-id="listenNetworkCheckInput"]',
}) })
.click({ .click({
selector: '*[data-id="terminalClearConsole"]', selector: '*[data-id="terminalClearConsole"]',
}) })
.click({ .click({
selector: '*[data-id="compilerContainerCompileAndRunBtn"]', selector: '*[data-id="compilerContainerCompileAndRunBtn"]',
}) })
.pause(10000) .pause(10000)
.waitForElementNotPresent({ .waitForElementNotPresent({
locateStrategy: 'xpath', locateStrategy: 'xpath',
selector: "//*[@class='remix_ui_terminal_log' and contains(.,'to:') and contains(.,'from:')]", selector: "//*[@class='remix_ui_terminal_log' and contains(.,'to:') and contains(.,'from:')]",
timeout: 120000 timeout: 120000
}) })
.end() .end()
} else { } else {
browser browser
.assert.fail('No transaction found') .assert.fail('No transaction found')
@ -309,7 +309,7 @@ module.exports = {
.switchEnvironment('vm-custom-fork') .switchEnvironment('vm-custom-fork')
.waitForElementVisible('[data-id="vm-custom-fork-modal-footer-ok-react"]') .waitForElementVisible('[data-id="vm-custom-fork-modal-footer-ok-react"]')
.execute(() => { .execute(() => {
(document.querySelector('*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkNodeUrl"]') as any).focus() (document.querySelector('*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkNodeUrl"]') as any).focus()
}, [], () => { }) }, [], () => { })
.clearValue('*[data-id="CustomForkNodeUrl"]').pause(1000).setValue('*[data-id="CustomForkNodeUrl"]', 'https://go.getblock.io/ee42d0a88f314707be11dd799b122cb9') .clearValue('*[data-id="CustomForkNodeUrl"]').pause(1000).setValue('*[data-id="CustomForkNodeUrl"]', 'https://go.getblock.io/ee42d0a88f314707be11dd799b122cb9')
.execute(() => { .execute(() => {
@ -371,9 +371,9 @@ module.exports = {
.perform(function () { .perform(function () {
const actions = this.actions({ async: true }); const actions = this.actions({ async: true });
return actions return actions
.keyDown(this.Keys.SHIFT) .keyDown(this.Keys.SHIFT)
.keyDown(this.Keys.ALT) .keyDown(this.Keys.ALT)
.sendKeys('r') .sendKeys('r')
}) })
.useCss() .useCss()
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 120000) .waitForElementContainsText('*[data-id="terminalJournal"]', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 120000)
@ -398,18 +398,15 @@ module.exports = {
.perform(function () { .perform(function () {
const actions = this.actions({ async: true }); const actions = this.actions({ async: true });
return actions return actions
.keyDown(this.Keys.SHIFT) .keyDown(this.Keys.SHIFT)
.keyDown(this.Keys.ALT) .keyDown(this.Keys.ALT)
.sendKeys('r') .sendKeys('r')
}) })
.useCss() .useCss()
.waitForElementContainsText('*[data-id="terminalJournal"]', 'test running free function', 120000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'test running free function', 120000)
} }
} }
const asyncAwait = ` const asyncAwait = `
var p = function () { var p = function () {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {

@ -32,23 +32,6 @@ export function ContractGUI(props: ContractGUIProps) {
const initializeFields = useRef<Array<HTMLInputElement | null>>([]) const initializeFields = useRef<Array<HTMLInputElement | null>>([])
const basicInputRef = useRef<HTMLInputElement>() const basicInputRef = useRef<HTMLInputElement>()
const intl = useIntl() const intl = useIntl()
// const [solcVersion, setSolcVersion] = useState({ version: '', canReceive: true })
// const getVersion = () => {
// let version = ''
// try {
// version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
// if (parseFloat(version) < 0.6) {
// setSolcVersion({ version: version, canReceive: false })
// }
// setSolcVersion({ version: version, canReceive: false })
// } catch (e) {
// version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
// console.log(e)
// }
// return version
// }
useEffect(() => { useEffect(() => {
if (props.deployOption && Array.isArray(props.deployOption)) { if (props.deployOption && Array.isArray(props.deployOption)) {
if (props.deployOption[0] && props.deployOption[0].title === 'Deploy with Proxy' && props.deployOption[0].active) handleDeployProxySelect(true) if (props.deployOption[0] && props.deployOption[0].title === 'Deploy with Proxy' && props.deployOption[0].active) handleDeployProxySelect(true)
@ -316,8 +299,8 @@ export function ContractGUI(props: ContractGUIProps) {
<div className="d-flex p-0 wrapperElement" onClick={handleActionClick} data-id={buttonOptions.dataId} data-title={buttonOptions.title}> <div className="d-flex p-0 wrapperElement" onClick={handleActionClick} data-id={buttonOptions.dataId} data-title={buttonOptions.title}>
<button <button
className={`udapp_instanceButton text-nowrap overflow-hidden text-truncate ${props.widthClass} btn btn-sm ${buttonOptions.classList}`} className={`udapp_instanceButton text-nowrap overflow-hidden text-truncate ${props.widthClass} btn btn-sm ${buttonOptions.classList}`}
data-id={buttonOptions.dataId} data-id={`${buttonOptions.dataId}firstbullseye`}
data-title={buttonOptions.title} data-title={`${buttonOptions.title}bullseye`}
disabled={(toggleUpgradeImp && !proxyAddress) || props.disabled || (props.inputs !== '' && basicInput === '')} disabled={(toggleUpgradeImp && !proxyAddress) || props.disabled || (props.inputs !== '' && basicInput === '')}
> >
{title} {title}

@ -27,22 +27,7 @@ export function UniversalDappUI(props: UdappProps) {
const [calldataValue, setCalldataValue] = useState<string>('') const [calldataValue, setCalldataValue] = useState<string>('')
const [evmBC, setEvmBC] = useState(null) const [evmBC, setEvmBC] = useState(null)
const [instanceBalance, setInstanceBalance] = useState(0) const [instanceBalance, setInstanceBalance] = useState(0)
// const [solcVersion, setSolcVersion] = useState({ version: '', canReceive: true })
// const getVersion = () => {
// let version = ''
// try {
// version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
// if (parseFloat(version) < 0.6) {
// setSolcVersion({ version: version, canReceive: false })
// }
// setSolcVersion({ version: version, canReceive: false })
// } catch (e) {
// version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
// console.log(e)
// }
// return version
// }
useEffect(() => { useEffect(() => {
if (!props.instance.abi) { if (!props.instance.abi) {
const abi = txHelper.sortAbiFunction(props.instance.contractData.abi) const abi = txHelper.sortAbiFunction(props.instance.contractData.abi)

@ -85,13 +85,13 @@ export function RunTabUI(props: RunTabProps) {
const getVersion = () => { const getVersion = () => {
let version = '' let version = ''
try { try {
version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) ?? 'v0.8.25'
if (parseFloat(version) < 0.6) { if (parseFloat(version) < 0.6) {
setSolcVersion({ version: version, canReceive: false }) setSolcVersion({ version: version, canReceive: false })
} }
setSolcVersion({ version: version, canReceive: true }) setSolcVersion({ version: version, canReceive: true })
} catch (e) { } catch (e) {
version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) ?? 'v0.8.25'
console.log(e) console.log(e)
} }
return version return version

Loading…
Cancel
Save