From 6ec3701cf63240cc742fdbbbf2ae63c6f593371e Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 27 Jun 2023 19:29:00 +0200 Subject: [PATCH] move transaction data from step definition to scenario line --- e2e-tests/cypress/e2e/SendCoins.feature | 3 ++- .../cypress/support/step_definitions/send_coin_steps.ts | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index e35317dc6..00267d331 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -16,7 +16,8 @@ Feature: Send coins And the user submits the send form Then the transaction details are presented for confirmation "" "" "" "" "" When the user submits the transaction by confirming - And the user navigates to page "/transactions" + Then the "" and "" are displayed on the "send" page + When the user navigates to page "/transactions" Then the "" and "" are displayed on the "transactions" page Examples: diff --git a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts index 8a0e054b6..ba9eab4b4 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -27,7 +27,7 @@ Then('the transaction details are presented for confirmation {string} {string} { cy.get('.transaction-confirm-send').contains(`+ ${newSenderBalance} GDD`) }) -When('the user submits the transaction by confirming', () => { +When('the user submits the transaction by confirming', (receiverName: string, amount) => { cy.intercept({ method: 'POST', url: '/graphql', @@ -48,9 +48,6 @@ When('the user submits the transaction by confirming', () => { .and('equal', true) }) cy.get('[data-test="send-transaction-success-text"]').should('be.visible') - cy.get('.rightside-last-transactions').should('be.visible') - cy.get('.align-items-center').contains('Räuber Hotzenplotz') - cy.get('.align-items-center').contains('− 120.50 GDD') }) Then('the {string} and {string} are displayed on the {string} page', (name: string, amount: string, page: string) => { @@ -59,6 +56,10 @@ Then('the {string} and {string} are displayed on the {string} page', (name: stri cy.get('.align-items-center').contains(`${name}`) cy.get('.align-items-center').contains(`${amount} GDD`) break + case 'send': + cy.get('.align-items-center').contains(`${name}`) + cy.get('.align-items-center').contains(`${amount} GDD`) + break case 'transactions': cy.get('div.mt-3 > div > div.test-list-group-item').eq(0).contains('div.gdd-transaction-list-item-name', `${name}`) cy.get('div.mt-3 > div > div.test-list-group-item').eq(0).contains('[data-test="transaction-amount"]', `${amount} GDD`)