Skip to content

Commit

Permalink
Add cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautBremand committed Sep 28, 2023
1 parent e47cdda commit 3b03648
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions packages/extension/cypress/e2e/payments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,39 @@ describe('Make payment from the UI', () => {
});
cy.get('p[data-testid="transaction-subtitle"]').should('have.text', 'Transaction Successful');
});

it('Should correctly pay with custom fees', () => {
navigate(HOME_URL, PASSWORD);

cy.contains('button', 'Send').click();

// Input recipient's address
cy.get('#recipient-address').type(DESTINATION_ADDRESS);

// Input amount
cy.get('#amount').clear().type('0.01').should('not.have.class', 'Mui-error');

// Input new fees (optional)
cy.get('#transaction-fee').clear().type('0.000025').should('not.have.class', 'Mui-error');

// Click on the Send Payment button
cy.get('button').contains('Send Payment').click();

// Check that the fees are correct
cy.contains('Network fees:').next().should('have.text', '0.000025 XRP');

// Confirm the payment
cy.contains('button', 'Confirm').click();

cy.get('h1[data-testid="transaction-title"]').should('have.text', 'Transaction in progress');
cy.get('p[data-testid="transaction-subtitle"]').should(
'have.text',
'We are processing your transactionPlease wait'
);

cy.get('h1[data-testid="transaction-title"]').contains('Transaction accepted', {
timeout: 10000
});
cy.get('p[data-testid="transaction-subtitle"]').should('have.text', 'Transaction Successful');
});
});

0 comments on commit 3b03648

Please sign in to comment.