From 79f1cb60839ddacf2de584d2df7d6c4e1e9ff6e2 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 12:35:26 +0500 Subject: [PATCH 1/7] temp changes to run tests without provisioning --- test/e2e/specs/liquidation.spec.js | 18 ++++++++++++------ test/e2e/test.utils.js | 10 +++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index 27dd1cac..78e585d2 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -37,9 +37,13 @@ describe('Liquidation Testing', () => { const auctionURL = currentConfig.auctionURL; const reserveURL = currentConfig.reserveURL; let user1Mnemonic = - AGORIC_NET === networks.LOCAL ? currentConfig.user1Mnemonic : null; + AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET + ? currentConfig.user1Mnemonic + : null; let user1Address = - AGORIC_NET === networks.LOCAL ? currentConfig.user1Address : null; + AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET + ? currentConfig.user1Address + : null; let bidderAtomBalance = 0; let user1AtomBalance = 0; let bidderIstBalance = 0; @@ -49,7 +53,7 @@ describe('Liquidation Testing', () => { it('add key for user1 wallet using agd', () => { cy.task('info', `AGORIC_NET: ${AGORIC_NET}`); - if (AGORIC_NET === networks.LOCAL) { + if (AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET) { cy.addKeys({ keyName: 'user1', mnemonic: user1Mnemonic, @@ -84,7 +88,9 @@ describe('Liquidation Testing', () => { }, }, () => { - cy.skipWhen(AGORIC_NET === networks.LOCAL); + cy.skipWhen( + AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET, + ); // UNTIL https://github.com/Agoric/instagoric/issues/64 for (let i = 0; i < 3; i++) { cy.provisionFromFaucet(user1Address, 'delegate'); @@ -96,7 +102,7 @@ describe('Liquidation Testing', () => { context('Add key for bidder wallet', () => { it('add key for bidder wallet using agd', () => { - if (AGORIC_NET === networks.LOCAL) { + if (AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET) { cy.task('info', 'gov1 is the bidder wallet'); cy.addKeys({ keyName: 'gov1', @@ -115,7 +121,7 @@ describe('Liquidation Testing', () => { context('Add keys for gov1 and gov2 wallet', () => { it('add keys for gov1 and gov2 wallet using agd', () => { - if (AGORIC_NET !== networks.LOCAL) { + if (AGORIC_NET !== networks.LOCAL || AGORIC_NET !== networks.EMERYNET) { cy.addKeys({ keyName: 'gov1', mnemonic: gov1Mnemonic, diff --git a/test/e2e/test.utils.js b/test/e2e/test.utils.js index 49a3f955..5cf02189 100644 --- a/test/e2e/test.utils.js +++ b/test/e2e/test.utils.js @@ -1,6 +1,6 @@ export const mnemonics = { user1: - 'tackle hen gap lady bike explain erode midnight marriage wide upset culture model select dial trial swim wood step scan intact what card symptom', + 'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology', gov1: 'such field health riot cost kitten silly tube flash wrap festival portion imitate this make question host bitter puppy wait area glide soldier knee', gov2: 'physical immune cargo feel crawl style fox require inhale law local glory cheese bring swear royal spy buyer diesel field when task spin alley', validator: @@ -8,7 +8,7 @@ export const mnemonics = { }; export const accountAddresses = { - user1: 'agoric1ydzxwh6f893jvpaslmaz6l8j2ulup9a7x8qvvq', + user1: 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md', gov1: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q', gov2: 'agoric1wrfh296eu2z34p6pah7q04jjuyj3mxu9v98277', validator: 'agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl', @@ -46,9 +46,9 @@ export const configMap = { LIQUIDATING_TIMEOUT: 13 * 60 * 1000, LIQUIDATED_TIMEOUT: 5 * 60 * 1000, COMMAND_TIMEOUT: 6 * 60 * 1000, - bidderMnemonic: mnemonics.validator, - bidderAddress: accountAddresses.validator, - bidderWalletName: 'bidder', + bidderMnemonic: mnemonics.gov1, + bidderAddress: accountAddresses.gov1, + bidderWalletName: 'gov1', gov1Mnemonic: mnemonics.gov1, gov1Address: accountAddresses.gov1, gov1WalletName: 'gov1', From d1f99eeaabe2c8632f38987bf4a20c4f8713824a Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 12:45:44 +0500 Subject: [PATCH 2/7] changes --- test/e2e/specs/liquidation.spec.js | 76 +++++------------------------- 1 file changed, 11 insertions(+), 65 deletions(-) diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index 78e585d2..ee1e0b03 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -53,81 +53,27 @@ describe('Liquidation Testing', () => { it('add key for user1 wallet using agd', () => { cy.task('info', `AGORIC_NET: ${AGORIC_NET}`); - if (AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET) { - cy.addKeys({ - keyName: 'user1', - mnemonic: user1Mnemonic, - expectedAddress: user1Address, - }); - } else { - cy.task('info', 'get mnemonic for the new wallet using agd'); - cy.createNewUser({ keyName: 'user1' }) - .then(output => { - cy.task('info', `${JSON.stringify(output)}`); - cy.wrap(output); - }) - .then(({ mnemonic, address }) => { - user1Mnemonic = mnemonic; - cy.task('info', `user1 mnemonic: ${user1Mnemonic}`); - user1Address = address; - cy.task('info', `user1 address: ${address}`); - }) - .then(() => { - expect(user1Mnemonic).to.not.be.null; - expect(user1Address).to.not.be.null; - }); - } + cy.addKeys({ + keyName: 'user1', + mnemonic: user1Mnemonic, + expectedAddress: user1Address, + }); }); - - it( - 'should provision the user1 wallet', - { - retries: { - runMode: 2, - openMode: 2, - }, - }, - () => { - cy.skipWhen( - AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET, - ); - // UNTIL https://github.com/Agoric/instagoric/issues/64 - for (let i = 0; i < 3; i++) { - cy.provisionFromFaucet(user1Address, 'delegate'); - } - cy.provisionFromFaucet(user1Address, 'client'); - }, - ); }); context('Add key for bidder wallet', () => { it('add key for bidder wallet using agd', () => { - if (AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET) { - cy.task('info', 'gov1 is the bidder wallet'); - cy.addKeys({ - keyName: 'gov1', - mnemonic: gov1Mnemonic, - expectedAddress: gov1Address, - }); - } else { - cy.addKeys({ - keyName: 'bidder', - mnemonic: bidderMnemonic, - expectedAddress: bidderAddress, - }); - } + cy.task('info', 'gov1 is the bidder wallet'); + cy.addKeys({ + keyName: 'gov1', + mnemonic: gov1Mnemonic, + expectedAddress: gov1Address, + }); }); }); context('Add keys for gov1 and gov2 wallet', () => { it('add keys for gov1 and gov2 wallet using agd', () => { - if (AGORIC_NET !== networks.LOCAL || AGORIC_NET !== networks.EMERYNET) { - cy.addKeys({ - keyName: 'gov1', - mnemonic: gov1Mnemonic, - expectedAddress: gov1Address, - }); - } cy.addKeys({ keyName: 'gov2', mnemonic: gov2Mnemonic, From 7887d980bd94692f16bb504c62ab1bef70a27125 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 12:48:37 +0500 Subject: [PATCH 3/7] changes --- test/e2e/specs/liquidation.spec.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index ee1e0b03..e260ea62 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -36,14 +36,8 @@ describe('Liquidation Testing', () => { const econGovURL = currentConfig.econGovURL; const auctionURL = currentConfig.auctionURL; const reserveURL = currentConfig.reserveURL; - let user1Mnemonic = - AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET - ? currentConfig.user1Mnemonic - : null; - let user1Address = - AGORIC_NET === networks.LOCAL || AGORIC_NET === networks.EMERYNET - ? currentConfig.user1Address - : null; + let user1Mnemonic = currentConfig.user1Mnemonic; + let user1Address = currentConfig.user1Address; let bidderAtomBalance = 0; let user1AtomBalance = 0; let bidderIstBalance = 0; From 8c910938deccd25bfbc427d5d9164a92d6ba4a76 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 13:26:46 +0500 Subject: [PATCH 4/7] changes --- package.json | 3 ++- test/e2e/specs/liquidation.spec.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9a28703f..83783275 100644 --- a/package.json +++ b/package.json @@ -78,5 +78,6 @@ "**/@agoric/xsnap": "0.14.3-u14.0", "**/@agoric/time": "0.3.3-u14.0", "**/@agoric/vats": "0.15.2-u15.0" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index e260ea62..47bff2ec 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -13,9 +13,9 @@ import { describe('Liquidation Testing', () => { let startTime; - const AGORIC_NET = Cypress.env('AGORIC_NET').trim(); - const network = - { local: 'local', emerynet: 'emerynet' }[AGORIC_NET] || 'testnet'; + const AGORIC_NET = 'emerynet'; + const network = AGORIC_NET; + const checkLastestAuctionValue = network === 'local' || network === 'emerynet' ? false : true; From b4d7fccdb872bc0b2899f9c58692696413feadc7 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 13:28:32 +0500 Subject: [PATCH 5/7] changes --- test/e2e/specs/liquidation.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index 47bff2ec..7c899bdc 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -36,8 +36,9 @@ describe('Liquidation Testing', () => { const econGovURL = currentConfig.econGovURL; const auctionURL = currentConfig.auctionURL; const reserveURL = currentConfig.reserveURL; - let user1Mnemonic = currentConfig.user1Mnemonic; - let user1Address = currentConfig.user1Address; + let user1Mnemonic = + 'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology'; + let user1Address = 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md'; let bidderAtomBalance = 0; let user1AtomBalance = 0; let bidderIstBalance = 0; From 5f0b620c36218ef4ec2f2a0b9ab83f9b34310038 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 14:03:57 +0500 Subject: [PATCH 6/7] changes in reconstitution tests --- .../specs/liquidation-reconstitution.spec.js | 84 ++++--------------- 1 file changed, 15 insertions(+), 69 deletions(-) diff --git a/test/e2e/specs/liquidation-reconstitution.spec.js b/test/e2e/specs/liquidation-reconstitution.spec.js index b71f7730..17fc5121 100644 --- a/test/e2e/specs/liquidation-reconstitution.spec.js +++ b/test/e2e/specs/liquidation-reconstitution.spec.js @@ -12,9 +12,8 @@ import { describe('Liquidation Reconstitution Testing', () => { let startTime; - const AGORIC_NET = Cypress.env('AGORIC_NET').trim(); - const network = - { local: 'local', emerynet: 'emerynet' }[AGORIC_NET] || 'testnet'; + const AGORIC_NET = 'emerynet'; + const network = 'emerynet'; const checkLastestAuctionValue = network === 'local' || network === 'emerynet' ? false : true; const currentConfig = configMap[network]; @@ -35,9 +34,8 @@ describe('Liquidation Reconstitution Testing', () => { const auctionURL = currentConfig.auctionURL; const reserveURL = currentConfig.reserveURL; let user1Mnemonic = - AGORIC_NET === networks.LOCAL ? currentConfig.user1Mnemonic : null; - let user1Address = - AGORIC_NET === networks.LOCAL ? currentConfig.user1Address : null; + 'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology'; + let user1Address = 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md'; let bidderAtomBalance = 0; let bidderIstBalance = 0; let shortfallBalance = 0; @@ -46,79 +44,27 @@ describe('Liquidation Reconstitution Testing', () => { it('add key for user1 wallet using agd', () => { cy.task('info', `AGORIC_NET: ${AGORIC_NET}`); - if (AGORIC_NET === networks.LOCAL) { - cy.addKeys({ - keyName: 'user1', - mnemonic: user1Mnemonic, - expectedAddress: user1Address, - }); - } else { - cy.task('info', 'get mnemonic for the new wallet using agd'); - cy.createNewUser({ keyName: 'user1' }) - .then(output => { - cy.task('info', `${JSON.stringify(output)}`); - cy.wrap(output); - }) - .then(({ mnemonic, address }) => { - user1Mnemonic = mnemonic; - cy.task('info', `user1 mnemonic: ${user1Mnemonic}`); - user1Address = address; - cy.task('info', `user1 address: ${address}`); - }) - .then(() => { - expect(user1Mnemonic).to.not.be.null; - expect(user1Address).to.not.be.null; - }); - } + cy.addKeys({ + keyName: 'user1', + mnemonic: user1Mnemonic, + expectedAddress: user1Address, + }); }); - - it( - 'should provision the user1 wallet', - { - retries: { - runMode: 2, - openMode: 2, - }, - }, - () => { - cy.skipWhen(AGORIC_NET === networks.LOCAL); - // UNTIL https://github.com/Agoric/instagoric/issues/64 - for (let i = 0; i < 3; i++) { - cy.provisionFromFaucet(user1Address, 'delegate'); - } - cy.provisionFromFaucet(user1Address, 'client'); - }, - ); }); context('Add key for bidder wallet', () => { it('add key for bidder wallet using agd', () => { - if (AGORIC_NET === networks.LOCAL) { - cy.task('info', 'gov1 is the bidder wallet'); - cy.addKeys({ - keyName: 'gov1', - mnemonic: gov1Mnemonic, - expectedAddress: gov1Address, - }); - } else { - cy.addKeys({ - keyName: 'bidder', - mnemonic: bidderMnemonic, - expectedAddress: bidderAddress, - }); - } + cy.task('info', 'gov1 is the bidder wallet'); + cy.addKeys({ + keyName: 'gov1', + mnemonic: gov1Mnemonic, + expectedAddress: gov1Address, + }); }); }); context('Add keys for gov1 and gov2 wallet', () => { it('add keys for gov1 and gov2 wallet using agd', () => { - if (AGORIC_NET !== networks.LOCAL) { - cy.addKeys({ - keyName: 'gov1', - mnemonic: gov1Mnemonic, - expectedAddress: gov1Address, - }); - } cy.addKeys({ keyName: 'gov2', mnemonic: gov2Mnemonic, From 2db410aa8ff20ca18160b841e9455b0656a1e5e7 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Tue, 13 May 2025 19:39:24 +0500 Subject: [PATCH 7/7] changes for vault tests --- test/e2e/specs/test.spec.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/test/e2e/specs/test.spec.js b/test/e2e/specs/test.spec.js index 67b52f80..b2466970 100644 --- a/test/e2e/specs/test.spec.js +++ b/test/e2e/specs/test.spec.js @@ -12,30 +12,11 @@ describe('Vaults UI Test Cases', () => { cy.setupWallet({ secretWords: customWalletPhrase, }); - } else if (AGORIC_NET === 'local') { + } else { cy.setupWallet({ secretWords: mnemonics.user1, walletName: 'user1', }); - } else if (AGORIC_NET === 'xnet') { - cy.task('info', 'Connecting with wallet...'); - cy.setupWallet({ - secretWords: Cypress.env('USER1_MNEMONIC'), - walletName: 'user1', - }); - } else { - cy.setupWallet({ - createNewWallet: true, - walletName: 'my created wallet', - selectedChains: ['Agoric'], - }); - - cy.getWalletAddress('Agoric').then(address => { - // provision BLD - cy.provisionFromFaucet(address, 'delegate'); - // provision IST - cy.provisionFromFaucet(address, 'client'); - }); } });