diff --git a/test/e2e/specs/liquidation-reconstitution.spec.js b/test/e2e/specs/liquidation-reconstitution.spec.js index a2239093..345d78b0 100644 --- a/test/e2e/specs/liquidation-reconstitution.spec.js +++ b/test/e2e/specs/liquidation-reconstitution.spec.js @@ -7,6 +7,7 @@ import { webWalletURL, webWalletSelectors, tokens, + extractNumber, } from '../test.utils'; describe('Wallet App Test Cases', () => { @@ -483,9 +484,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.startPrice'; + const propertyName = 'startPrice'; const expectedValue = '9.99 IST/ATOM'; - cy.verifyAuctionData(propertyName, expectedValue); + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); @@ -505,9 +512,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.startProceedsGoal'; + const propertyName = 'startProceedsGoal'; const expectedValue = '309.54 IST'; - cy.verifyAuctionData(propertyName, expectedValue); + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); @@ -527,9 +540,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.startCollateral'; + const propertyName = 'startCollateral'; const expectedValue = '45 ATOM'; - cy.verifyAuctionData(propertyName, expectedValue); + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); }); @@ -576,9 +595,17 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.collateralAvailable'; + const propertyName = 'collateralAvailable'; const expectedValue = '31.414987 ATOM'; - cy.verifyAuctionData(propertyName, expectedValue); // eslint-disable-line cypress/no-unnecessary-waiting + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round( + extractNumber(expectedValue), + ); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); }, diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index bb101c5f..d66d9704 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -8,6 +8,7 @@ import { QUICK_WAIT, THIRTY_SECONDS, tokens, + extractNumber, } from '../test.utils'; describe('Wallet App Test Cases', () => { @@ -485,9 +486,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.startPrice'; + const propertyName = 'startPrice'; const expectedValue = '9.99 IST/ATOM'; - cy.verifyAuctionData(propertyName, expectedValue); + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); @@ -507,9 +514,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.startProceedsGoal'; + const propertyName = 'startProceedsGoal'; const expectedValue = '309.54 IST'; - cy.verifyAuctionData(propertyName, expectedValue); + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); @@ -529,9 +542,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.startCollateral'; + const propertyName = 'startCollateral'; const expectedValue = '45 ATOM'; - cy.verifyAuctionData(propertyName, expectedValue); + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); }); @@ -571,9 +590,15 @@ describe('Wallet App Test Cases', () => { ); }); } else { - const propertyName = 'book0.collateralAvailable'; + const propertyName = 'collateralAvailable'; const expectedValue = '9.659301 ATOM'; - cy.verifyAuctionData(propertyName, expectedValue); // eslint-disable-line cypress/no-unnecessary-waiting + cy.task('info', `Expected Value: ${expectedValue}`); + cy.getAuctionParam(propertyName).then(value => { + const actualValue = Math.round(extractNumber(value)); + const expectedValueRounded = Math.round(extractNumber(expectedValue)); + + expect(actualValue).to.eq(expectedValueRounded); + }); } }); }); diff --git a/test/e2e/support.js b/test/e2e/support.js index 8e477959..37def9a0 100644 --- a/test/e2e/support.js +++ b/test/e2e/support.js @@ -15,7 +15,7 @@ const balanceUrl = : 'http://localhost:1317/cosmos/bank/v1beta1/balances/'; const COMMAND_TIMEOUT = configMap[network].COMMAND_TIMEOUT; -const agops = 'agops'; +const agops = '/usr/src/agoric-sdk/packages/agoric-cli/bin/agops'; Cypress.Commands.add('addKeys', params => { const { keyName, mnemonic, expectedAddress } = params;