more srceenshots

pull/4978/head
Your Name 4 months ago committed by Aniket
parent c90f421766
commit e67bbcc96a
  1. 2
      apps/remix-ide-e2e/src/commands/setupMetamask.ts
  2. 50
      apps/remix-ide-e2e/src/tests/runAndDeploy_injected.test.ts

@ -76,7 +76,7 @@ function setupMetaMask(browser: NightwatchBrowser, passphrase: string, password:
locateStrategy: 'css selector', locateStrategy: 'css selector',
timeout: 3000 timeout: 3000
}) })
.saveScreenshot('./reports/screenshot/metamask.png') .saveScreenshot('./reports/screenshots/metamask.png')
.click('[data-testid="network-display"]') .click('[data-testid="network-display"]')
.click('.mm-modal-content label.toggle-button--off') // show test networks .click('.mm-modal-content label.toggle-button--off') // show test networks
.click('div[data-testid="Sepolia"]') // switch to sepolia .click('div[data-testid="Sepolia"]') // switch to sepolia

@ -11,7 +11,7 @@ const checkBrowserIsChrome = function (browser: NightwatchBrowser) {
return browser.browserName.indexOf('chrome') > -1 return browser.browserName.indexOf('chrome') > -1
} }
const checkAlerts = function (browser: NightwatchBrowser){ const checkAlerts = function (browser: NightwatchBrowser) {
browser.isVisible({ browser.isVisible({
selector: '//*[contains(.,"not have enough")]', selector: '//*[contains(.,"not have enough")]',
locateStrategy: 'xpath', locateStrategy: 'xpath',
@ -38,7 +38,7 @@ const tests = {
'Should connect to Sepolia Test Network using MetaMask #group1 #flaky': function (browser: NightwatchBrowser) { 'Should connect to Sepolia Test Network using MetaMask #group1 #flaky': function (browser: NightwatchBrowser) {
if (!checkBrowserIsChrome(browser)) return if (!checkBrowserIsChrome(browser)) return
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.setupMetamask(passphrase, password) .setupMetamask(passphrase, password)
.useCss().switchBrowserTab(0) .useCss().switchBrowserTab(0)
.refreshPage() .refreshPage()
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
@ -55,8 +55,8 @@ const tests = {
.pause(2000) .pause(2000)
.waitForElementVisible('*[data-testid="page-container-footer-next"]', 60000) .waitForElementVisible('*[data-testid="page-container-footer-next"]', 60000)
.click('*[data-testid="page-container-footer-next"]') .click('*[data-testid="page-container-footer-next"]')
// .waitForElementVisible('*[data-testid="popover-close"]') // .waitForElementVisible('*[data-testid="popover-close"]')
// .click('*[data-testid="popover-close"]') // .click('*[data-testid="popover-close"]')
}) })
.switchBrowserTab(0) // back to remix .switchBrowserTab(0) // back to remix
}, },
@ -90,7 +90,7 @@ const tests = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000)
.perform(() => done()) .perform(() => done())
}) })
}) })
}, },
'Should run low level interaction (fallback function) on Sepolia Test Network using MetaMask #group1': function (browser: NightwatchBrowser) { 'Should run low level interaction (fallback function) on Sepolia Test Network using MetaMask #group1': function (browser: NightwatchBrowser) {
@ -108,8 +108,8 @@ const tests = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'view on etherscan', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'view on etherscan', 60000)
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000)
.perform(() => done()) .perform(() => done())
}) })
}) })
}, },
'Should connect to Ethereum Main Network using MetaMask #group1': function (browser: NightwatchBrowser) { 'Should connect to Ethereum Main Network using MetaMask #group1': function (browser: NightwatchBrowser) {
@ -162,6 +162,7 @@ const tests = {
.perform((done) => { .perform((done) => {
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => {
browser browser
.saveScreenshot('./reports/screenshots/metamask_4.png')
.waitForElementPresent('[data-testid="page-container-footer-next"]', 60000) .waitForElementPresent('[data-testid="page-container-footer-next"]', 60000)
.click('[data-testid="page-container-footer-next"]') // approve the tx .click('[data-testid="page-container-footer-next"]') // approve the tx
.switchBrowserTab(0) // back to remix .switchBrowserTab(0) // back to remix
@ -169,7 +170,7 @@ const tests = {
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000)
.perform(() => done()) .perform(() => done())
}) })
}) })
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) .waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000)
.clearConsole() .clearConsole()
.clickInstance(0) .clickInstance(0)
@ -177,6 +178,7 @@ const tests = {
.perform((done) => { // call delegate .perform((done) => { // call delegate
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => {
browser browser
.saveScreenshot('./reports/screenshots/metamask_5.png')
.waitForElementPresent('[data-testid="page-container-footer-next"]', 60000) .waitForElementPresent('[data-testid="page-container-footer-next"]', 60000)
.click('[data-testid="page-container-footer-next"]') // approve the tx .click('[data-testid="page-container-footer-next"]') // approve the tx
.switchBrowserTab(0) // back to remix .switchBrowserTab(0) // back to remix
@ -199,11 +201,11 @@ const tests = {
*/ */
'Should debug Sepolia transaction with source highlighting MetaMask #group1': function (browser: NightwatchBrowser) { 'Should debug Sepolia transaction with source highlighting MetaMask #group1': function (browser: NightwatchBrowser) {
if (!checkBrowserIsChrome(browser)) return if (!checkBrowserIsChrome(browser)) return
let txhash let txhash
browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('pluginManager') // load debugger and source verification .clickLaunchIcon('pluginManager') // load debugger and source verification
// .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_sourcify"] button') // .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_sourcify"] button')
// debugger already activated .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button') // debugger already activated .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.perform((done) => { .perform((done) => {
browser.getLastTransactionHash((hash) => { browser.getLastTransactionHash((hash) => {
@ -213,17 +215,17 @@ const tests = {
}) })
.perform((done) => { .perform((done) => {
browser browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('debugger') .clickLaunchIcon('debugger')
.setValue('*[data-id="debuggerTransactionInput"]', txhash) // debug tx .setValue('*[data-id="debuggerTransactionInput"]', txhash) // debug tx
.saveScreenshot('./reports/screenshot/metamask_2.png') .saveScreenshot('./reports/screenshots/metamask_2.png')
.click('*[data-id="debuggerTransactionStartButton"]') .click('*[data-id="debuggerTransactionStartButton"]')
.saveScreenshot('./reports/screenshot/metamask_3.png') .saveScreenshot('./reports/screenshots/metamask_3.png')
.waitForElementVisible('*[data-id="treeViewDivto"]', 30000) .waitForElementVisible('*[data-id="treeViewDivto"]', 30000)
.checkVariableDebug('soliditylocals', localsCheck) .checkVariableDebug('soliditylocals', localsCheck)
.perform(() => done()) .perform(() => done())
}) })
}, },
'Call web3.eth.getAccounts() using Injected Provider (Metamask) #group1': function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Injected Provider (Metamask) #group1': function (browser: NightwatchBrowser) {
@ -231,7 +233,7 @@ const tests = {
browser browser
.executeScriptInTerminal('web3.eth.getAccounts()') .executeScriptInTerminal('web3.eth.getAccounts()')
.journalLastChildIncludes('["0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f"]') .journalLastChildIncludes('["0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f"]')
} }
} }
const branch = process.env.CIRCLE_BRANCH; const branch = process.env.CIRCLE_BRANCH;
@ -252,7 +254,7 @@ const sources = [
{ {
'Greet.sol': { 'Greet.sol': {
content: content:
` `
pragma solidity ^0.8.0; pragma solidity ^0.8.0;
contract HelloWorld { contract HelloWorld {
string public message; string public message;

Loading…
Cancel
Save