diff --git a/.circleci/config.yml b/.circleci/config.yml index 56ad48d66e..4c24890cab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: @@ -176,7 +176,7 @@ jobs: name: Start Selenium command: java -jar /usr/local/bin/selenium.jar background: true - - run: ./apps/remix-ide/ci/flaky.sh chromeDesktop + - run: ./apps/remix-ide/ci/flaky.sh chrome - store_test_results: path: ./reports/tests - store_artifacts: diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 7ca74fd2a7..f5554dfeb8 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -29,7 +29,13 @@ module.exports = { javascriptEnabled: true, acceptSslCerts: true, 'goog:chromeOptions': { - args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless', '--verbose'] + args: ['window-size=2560,1440', + 'start-fullscreen', + '--no-sandbox', + '--headless', + '--verbose', + "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", + ] } } }, diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 436365b786..760d3eb6ae 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -42,10 +42,8 @@ const sources = [ module.exports = { '@disabled': true, - '@desktop': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done) - //init(browser, done, 'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js', true) + init(browser, done, 'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js', true) }, '@sources': function () { @@ -87,50 +85,33 @@ module.exports = { }) }, - 'Should load Etherscan verified contractss from URL "address" param) #group2 #flaky': function (browser: NightwatchBrowser) { + 'Should load Etherscan verified contractss from URL "address" param) #group2': function (browser: NightwatchBrowser) { browser .pause(5000) - .url('http://127.0.0.1:8080/?address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') - .pause(10000) - .getLog('browser', (logEntries) => { - if (logEntries && logEntries.length > 0) { - console.log('Browser log:') - console.log(logEntries) - } - }). - currentWorkspaceIs('etherscan-code-sample') - .getLog('browser', (logEntries) => { - if (logEntries && logEntries.length > 0) { - console.log('Browser log:') - console.log(logEntries) - } + .url('http://127.0.0.1:8080/#address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') + .refresh() + .pause(7000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract Sample {') !== -1) + }) + .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') + .refresh() + .pause(7000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) + }) - /* - .saveScreenshot('./reports/screenshots/etherscan-verified-contract-1.png') - .refresh() - .pause(7000) - .currentWorkspaceIs('etherscan-code-sample') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content && content.indexOf( - 'contract Sample {') !== -1) - }) - .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') - .refresh() - .pause(7000) - .currentWorkspaceIs('etherscan-code-sample') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content && content.indexOf( - 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) - - }) -*/ }, 'Should load the code from URL & code params #group1': function (browser: NightwatchBrowser) { diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 05f77be84d..9fecce5b50 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -62,7 +62,6 @@ const { TabProxy } = require('./app/panels/tab-proxy.js') class AppComponent { constructor () { - console.error(window.location.href) this.appManager = new RemixAppManager({}) this.queryParams = new QueryParams() this._components = {} diff --git a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts index b458093426..1592663c38 100644 --- a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts +++ b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts @@ -1,5 +1,4 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, shouldSetFile = true, key?) => { - console.error('get etherscan contract', contractAddress); let data const compilationTargets = {} let etherscanKey @@ -8,12 +7,10 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres else etherscanKey = key if (etherscanKey) { - console.error('etherscan key found', etherscanKey); const endpoint = network.id == 1 ? 'api.etherscan.io' : 'api-' + network.name + '.etherscan.io' try { data = await fetch('https://' + endpoint + '/api?module=contract&action=getsourcecode&address=' + contractAddress + '&apikey=' + etherscanKey) data = await data.json() - console.error('etherscan contract data', data); // etherscan api doc https://docs.etherscan.io/api-endpoints/contracts if (data.message === 'OK' && data.status === "1") { if (data.result.length) { @@ -24,7 +21,6 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres } } else throw new Error('unable to retrieve contract data ' + data.message) } catch (e) { - console.error('etherscan contract data error', e); throw new Error('unable to retrieve contract data: ' + e.message) } } else throw new Error('unable to try fetching the source code from etherscan: etherscan access token not found. please go to the Remix settings page and provide an access token.') diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index 31fe71a453..cb82ddb0aa 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -52,6 +52,7 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. const params = queryParams.get() as UrlParametersType const workspaces = await getWorkspaces() || [] dispatch(setWorkspaces(workspaces)) + console.error('PARAMS', params) if (params.gist) { await createWorkspaceTemplate('gist-sample', 'gist-template') plugin.setWorkspace({ name: 'gist-sample', isLocalhost: false })