Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL changes in e2e tests to make it work locally #188

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions test/e2e/specs/test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ describe('Wallet App Test Cases', { execTimeout: DEFAULT_EXEC_TIMEOUT }, () => {
});
});
it(`should open the web wallet URL successfully`, () => {
cy.visit(`${userConfig.webwalletURL}`);
cy.visit('/');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we do it conditionally wheb AGORIC_NET is local?

Copy link
Contributor Author

@rabi-siddique rabi-siddique Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All networks should use localhost:3000 for testing. Previously, all networks used localhost:3000 except when AGORIC_NET was set to local, in which case https://wallet.agoric.app/ was used. You can see this in the webWalletURL parameter here.


cy.acceptAccess().then((taskCompleted) => {
expect(taskCompleted).to.be.true;
});
});

it('should setup web wallet successfully', () => {
cy.visit(`${userConfig.webwalletURL}wallet/`);
cy.visit('/wallet/');

cy.get('input[type="checkbox"]').check();
cy.contains('Proceed').click();
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Wallet App Test Cases', { execTimeout: DEFAULT_EXEC_TIMEOUT }, () => {
cy.provisionFromFaucet(address, 'client');
});

cy.visit(`${userConfig.webwalletURL}wallet/`);
cy.visit('/wallet/');
cy.get('span').contains('ATOM').should('exist');
cy.get('span').contains('BLD').should('exist');
});
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('Wallet App Test Cases', { execTimeout: DEFAULT_EXEC_TIMEOUT }, () => {
});

it('should see an offer placed in the previous test case', () => {
cy.visit(`${userConfig.webwalletURL}wallet/`);
cy.visit('/wallet/');

cy.contains('Offer').should('be.visible');
cy.contains('Give Bid').should('be.visible');
Expand All @@ -141,7 +141,7 @@ describe('Wallet App Test Cases', { execTimeout: DEFAULT_EXEC_TIMEOUT }, () => {

it('should cancel the bid by discount and verify IST balance', () => {
cy.getTokenAmount('IST').then((initialTokenValue) => {
cy.visit(`${userConfig.webwalletURL}wallet/`);
cy.visit('/wallet/');
cy.contains('Exit').click();
cy.acceptAccess().then((taskCompleted) => {
expect(taskCompleted).to.be.true;
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('Wallet App Test Cases', { execTimeout: DEFAULT_EXEC_TIMEOUT }, () => {
);

it('should see an offer placed in the previous test case', () => {
cy.visit(`${userConfig.webwalletURL}wallet/`);
cy.visit('/wallet/');
cy.contains('Offer').should('be.visible');
cy.contains('Give Bid').should('be.visible');
cy.contains('1.00 IST').should('be.visible');
Expand All @@ -184,7 +184,7 @@ describe('Wallet App Test Cases', { execTimeout: DEFAULT_EXEC_TIMEOUT }, () => {

it('should cancel the bid by price and verify IST balance', () => {
cy.getTokenAmount('IST').then((initialTokenValue) => {
cy.visit(`${userConfig.webwalletURL}wallet/`);
cy.visit('/wallet/');
cy.contains('Exit').click();
cy.acceptAccess().then((taskCompleted) => {
expect(taskCompleted).to.be.true;
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/test.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,12 @@ export const config = {
userKeyName: 'user1',
userWalletAddress: accountAddresses.user1,
userWalletMnemonic: mnemonics.user1,
// UNTIL https://github.com/Agoric/wallet-app/issues/184
webwalletURL: 'https://wallet.agoric.app/',
COMMAND_TIMEOUT: 2 * 60 * 1000,
},
testnet: {
userKeyName: 'user2',
userWalletAddress: accountAddresses.user2,
userWalletMnemonic: mnemonics.user2,
webwalletURL: '/',
COMMAND_TIMEOUT: 2 * 60 * 1000,
},
};
Loading