pull/2868/head
filip mertens 2 years ago
parent ec370e89dc
commit 9f7c188f15
  1. 21
      apps/remix-ide-e2e/src/tests/proxy.test.ts

@ -5,6 +5,7 @@ import init from '../helpers/init'
let firstProxyAddress: string let firstProxyAddress: string
let lastProxyAddress: string let lastProxyAddress: string
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -13,7 +14,7 @@ module.exports = {
return sources return sources
}, },
'Should show deploy proxy option for UUPS upgradeable contract': function (browser: NightwatchBrowser) { 'Should show deploy proxy option for UUPS upgradeable contract #flaky #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('myTokenV1.sol', sources[0]['myTokenV1.sol']) .addFile('myTokenV1.sol', sources[0]['myTokenV1.sol'])
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
@ -27,7 +28,7 @@ module.exports = {
.waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]') .waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]')
}, },
'Should show upgrade proxy option for child contract inheriting UUPS parent contract': function (browser: NightwatchBrowser) { 'Should show upgrade proxy option for child contract inheriting UUPS parent contract #group1': function (browser: NightwatchBrowser) {
browser browser
.addFile('myTokenV2.sol', sources[1]['myTokenV2.sol']) .addFile('myTokenV2.sol', sources[1]['myTokenV2.sol'])
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
@ -41,7 +42,7 @@ module.exports = {
.waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]') .waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]')
}, },
'Should deploy proxy without initialize parameters': function (browser: NightwatchBrowser) { 'Should deploy proxy without initialize parameters #group1': function (browser: NightwatchBrowser) {
browser browser
.openFile('myTokenV1.sol') .openFile('myTokenV1.sol')
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
@ -64,7 +65,7 @@ module.exports = {
.waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]')
}, },
'Should interact with deployed contract via ERC1967 (proxy)': function (browser: NightwatchBrowser) { 'Should interact with deployed contract via ERC1967 (proxy) #group1': function (browser: NightwatchBrowser) {
browser browser
.getAddressAtPosition(1, (address) => { .getAddressAtPosition(1, (address) => {
firstProxyAddress = address firstProxyAddress = address
@ -82,7 +83,7 @@ module.exports = {
}) })
}, },
'Should deploy proxy with initialize parameters': function (browser: NightwatchBrowser) { 'Should deploy proxy with initialize parameters #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('[data-id="deployAndRunClearInstances"]') .waitForElementPresent('[data-id="deployAndRunClearInstances"]')
.click('[data-id="deployAndRunClearInstances"]') .click('[data-id="deployAndRunClearInstances"]')
@ -111,7 +112,7 @@ module.exports = {
.waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]')
}, },
'Should interact with initialized contract to verify parameters': function (browser: NightwatchBrowser) { 'Should interact with initialized contract to verify parameters #group1': function (browser: NightwatchBrowser) {
browser browser
.getAddressAtPosition(1, (address) => { .getAddressAtPosition(1, (address) => {
lastProxyAddress = address lastProxyAddress = address
@ -129,7 +130,7 @@ module.exports = {
}) })
}, },
'Should upgrade contract using last deployed proxy address (MyTokenV1 to MyTokenV2)': function (browser: NightwatchBrowser) { 'Should upgrade contract using last deployed proxy address (MyTokenV1 to MyTokenV2) #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('[data-id="deployAndRunClearInstances"]') .waitForElementPresent('[data-id="deployAndRunClearInstances"]')
.click('[data-id="deployAndRunClearInstances"]') .click('[data-id="deployAndRunClearInstances"]')
@ -158,7 +159,7 @@ module.exports = {
.waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]')
}, },
'Should interact with upgraded function in contract MyTokenV2': function (browser: NightwatchBrowser) { 'Should interact with upgraded function in contract MyTokenV2 #group1': function (browser: NightwatchBrowser) {
browser browser
.clickInstance(1) .clickInstance(1)
.perform((done) => { .perform((done) => {
@ -168,7 +169,7 @@ module.exports = {
}) })
}, },
'Should upgrade contract by providing proxy address in input field (MyTokenV1 to MyTokenV2)': function (browser: NightwatchBrowser) { 'Should upgrade contract by providing proxy address in input field (MyTokenV1 to MyTokenV2) #group1': function (browser: NightwatchBrowser) {
browser browser
.waitForElementPresent('[data-id="deployAndRunClearInstances"]') .waitForElementPresent('[data-id="deployAndRunClearInstances"]')
.click('[data-id="deployAndRunClearInstances"]') .click('[data-id="deployAndRunClearInstances"]')
@ -196,7 +197,7 @@ module.exports = {
.waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]')
}, },
'Should interact with upgraded contract through provided proxy address': function (browser: NightwatchBrowser) { 'Should interact with upgraded contract through provided proxy address #group1': function (browser: NightwatchBrowser) {
browser browser
.clickInstance(1) .clickInstance(1)
.perform((done) => { .perform((done) => {

Loading…
Cancel
Save