From 11ffe66f2bdd0959847aaf47e692aa77d3a07fd8 Mon Sep 17 00:00:00 2001 From: "r3kt.eth" Date: Thu, 4 May 2023 22:11:49 +0200 Subject: [PATCH] use sepolia in tests --- tests/e2e/specs/metamask-spec.js | 48 ++++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/e2e/specs/metamask-spec.js b/tests/e2e/specs/metamask-spec.js index 782942798..0492ac57e 100644 --- a/tests/e2e/specs/metamask-spec.js +++ b/tests/e2e/specs/metamask-spec.js @@ -5,7 +5,7 @@ describe('Metamask', () => { it(`setupMetamask should finish metamask setup using secret words`, () => { cy.setupMetamask( 'test test test test test test test test test test test junk', - 'goerli', + 'sepolia', 'Tester@1234', ).then(setupFinished => { expect(setupFinished).to.be.true; @@ -27,8 +27,8 @@ describe('Metamask', () => { cy.acceptMetamaskAccess().then(connected => { expect(connected).to.be.true; }); - cy.get('#network').contains('5'); - cy.get('#chainId').contains('0x5'); + cy.get('#network').contains('11155111'); + cy.get('#chainId').contains('0xaa36a7'); cy.get('#accounts').should( 'have.text', '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', @@ -43,8 +43,8 @@ describe('Metamask', () => { }); it(`getNetwork should return network by default`, () => { cy.getNetwork().then(network => { - expect(network.networkName).to.be.equal('goerli'); - expect(network.networkId).to.be.equal(5); + expect(network.networkName).to.be.equal('sepolia'); + expect(network.networkId).to.be.equal(11155111); expect(network.isTestnet).to.be.true; }); }); @@ -63,17 +63,17 @@ describe('Metamask', () => { cy.get('#chainId').contains('0x5'); } else { cy.addMetamaskNetwork({ - networkName: 'Polygon Network', - rpcUrl: 'https://polygon-rpc.com', - chainId: '137', - symbol: 'MATIC', - blockExplorer: 'https://polygonscan.com', + networkName: 'Optimism Network', + rpcUrl: 'https://mainnet.optimism.io', + chainId: '10', + symbol: 'OETH', + blockExplorer: 'https://optimistic.etherscan.io', isTestnet: false, }).then(networkAdded => { expect(networkAdded).to.be.true; }); - cy.get('#network').contains('0x89'); - cy.get('#chainId').contains('0x89'); + cy.get('#network').contains('0xa'); + cy.get('#chainId').contains('0xa'); } }); it(`getNetwork should return valid network after adding a new network`, () => { @@ -83,24 +83,24 @@ describe('Metamask', () => { expect(network.networkId).to.be.equal(5); expect(network.isTestnet).to.be.true; } else { - expect(network.networkName).to.be.equal('polygon network'); - expect(network.networkId).to.be.equal(137); + expect(network.networkName).to.be.equal('optimism network'); + expect(network.networkId).to.be.equal(10); expect(network.isTestnet).to.be.false; } }); }); it(`changeMetamaskNetwork should change network using pre-defined network`, () => { - cy.changeMetamaskNetwork('goerli').then(networkChanged => { + cy.changeMetamaskNetwork('mainnet').then(networkChanged => { expect(networkChanged).to.be.true; }); - cy.get('#network').contains('5'); - cy.get('#chainId').contains('0x5'); + cy.get('#network').contains('0x1'); + cy.get('#chainId').contains('0x1'); }); it(`getNetwork should return valid network after changing a network`, () => { cy.getNetwork().then(network => { - expect(network.networkName).to.be.equal('goerli'); - expect(network.networkId).to.be.equal(5); - expect(network.isTestnet).to.be.true; + expect(network.networkName).to.be.equal('mainnet'); + expect(network.networkId).to.be.equal(1); + expect(network.isTestnet).to.be.false; }); }); it(`changeMetamaskNetwork should change network using custom network name`, () => { @@ -111,13 +111,13 @@ describe('Metamask', () => { cy.get('#network').contains('5'); cy.get('#chainId').contains('0x5'); } else { - cy.changeMetamaskNetwork('polygon network').then(networkChanged => { + cy.changeMetamaskNetwork('optimism network').then(networkChanged => { expect(networkChanged).to.be.true; }); - cy.get('#network').contains('0x89'); - cy.get('#chainId').contains('0x89'); + cy.get('#network').contains('0xa'); + cy.get('#chainId').contains('0xa'); + cy.changeMetamaskNetwork('sepolia'); } - cy.changeMetamaskNetwork('goerli'); }); it(`importMetamaskAccount should import new account using private key`, () => { cy.importMetamaskAccount(