From 5a86c10169853171ea1bc6ba135672207dedb2c8 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 16 Jun 2023 16:32:19 +0200 Subject: [PATCH] add send test of e2e feature send coins --- e2e-tests/cypress/e2e/SendCoins.feature | 6 ++++-- e2e-tests/cypress/e2e/models/SendPage.ts | 1 + .../cypress/support/step_definitions/send_coin_steps.ts | 8 +++++++- frontend/src/components/Transactions/TransactionSend.vue | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index f04684afb..3ff332012 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -12,9 +12,11 @@ Feature: Send coins Scenario: Send GDD to other user Given the user is logged in as "bob@baumeister.de" "Aa12345_" And the user navigates to page "/send" - When the user fills the send form with "raeuber@hotzenplotz.de" "120,50" "Some memo text" + When the user fills the send form with "raeuber@hotzenplotz.de" "120.50" "Some memo text" And the user submits the send form Then the transaction details are presented for confirmation When the user submits the transaction by confirming - Then the transaction details are displayed on the transcations page + And the user navigates to page "/transactions" + Then the transaction details are displayed on the transactions page + diff --git a/e2e-tests/cypress/e2e/models/SendPage.ts b/e2e-tests/cypress/e2e/models/SendPage.ts index ab2df6084..07b531c4a 100644 --- a/e2e-tests/cypress/e2e/models/SendPage.ts +++ b/e2e-tests/cypress/e2e/models/SendPage.ts @@ -1,6 +1,7 @@ /// export class SendPage { + confirmationBox = '.transaction-confirm-send' submitBtn = '.btn-gradido' enterReceiverEmail(email: string) { 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 b7c319c08..267de7dd1 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -14,7 +14,7 @@ When( And('the user submits the send form', () => { sendPage.submit() - cy.get('.transaction-confirm-send').should('be.visible') + cy.get(sendPage.confirmationBox).should('be.visible') }) @@ -52,3 +52,9 @@ When('the user submits the transaction by confirming', () => { cy.get('.align-items-center').contains('Räuber Hotzenplotz') cy.get('.align-items-center').contains('− 120.50 GDD') }) + + +Then('the transaction details are displayed on the transactions page', () => { + cy.get('div.mt-3 > div > div.test-list-group-item').eq(0).contains('div.gdd-transaction-list-item-name', 'Räuber Hotzenplotz') + cy.get('div.mt-3 > div > div.test-list-group-item').eq(0).contains('[data-test="send-amount"]', '− 120.50 GDD') +}) \ No newline at end of file diff --git a/frontend/src/components/Transactions/TransactionSend.vue b/frontend/src/components/Transactions/TransactionSend.vue index 62ac41ded..93a8aa98e 100644 --- a/frontend/src/components/Transactions/TransactionSend.vue +++ b/frontend/src/components/Transactions/TransactionSend.vue @@ -25,7 +25,7 @@
{{ $t('decay.types.send') }}
-
{{ amount | GDD }}
+
{{ amount | GDD }}
{{ $t('via_link') }}