From a837ce0a0da4e939b5b185eace0ddeaa5d4a3168 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 16 Jun 2023 16:29:25 +0200 Subject: [PATCH 01/20] add send page obpejt for e2e tests --- e2e-tests/cypress/e2e/models/SendPage.ts | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 e2e-tests/cypress/e2e/models/SendPage.ts diff --git a/e2e-tests/cypress/e2e/models/SendPage.ts b/e2e-tests/cypress/e2e/models/SendPage.ts new file mode 100644 index 000000000..ab2df6084 --- /dev/null +++ b/e2e-tests/cypress/e2e/models/SendPage.ts @@ -0,0 +1,33 @@ +/// + +export class SendPage { + submitBtn = '.btn-gradido' + + enterReceiverEmail(email: string) { + cy.get('[data-test="input-identifier"]').find('input') + .clear() + .type(email) + return this + } + + enterAmount(amount: string) { + cy.get('[data-test="input-amount"]') + .find('input') + .clear() + .type(amount) + return this + } + + enterMemoText(text: string) { + cy.get('[data-test="input-textarea"]') + .find('textarea') + .clear() + .type(text) + return this + } + + submit() { + cy.get(this.submitBtn) + .click() + } +} From e46ff56c1e6ac3ffd7c8efa3cb1eb950ff8f5971 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 16 Jun 2023 16:32:19 +0200 Subject: [PATCH 02/20] add send test of e2e feature send coins --- e2e-tests/cypress/e2e/SendCoins.feature | 20 +++++++ .../step_definitions/send_coin_steps.ts | 60 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 e2e-tests/cypress/e2e/SendCoins.feature create mode 100644 e2e-tests/cypress/support/step_definitions/send_coin_steps.ts diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature new file mode 100644 index 000000000..f04684afb --- /dev/null +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -0,0 +1,20 @@ +Feature: Send coins + As a user + I want to send and receive GDD + I want to see transaction details on overview and transactions pages + + # Background: + # Given the following "users" are in the database: + # | email | password | name | + # | bob@baumeister.de | Aa12345_ | Bob Baumeister | + # | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | + + 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" + 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 + diff --git a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts new file mode 100644 index 000000000..f96da9768 --- /dev/null +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -0,0 +1,60 @@ +import { And, Then, When } from '@badeball/cypress-cucumber-preprocessor' +import { SendPage } from '../../e2e/models/SendPage' + +const sendPage = new SendPage() + +When( + 'the user fills the send form with {string} {string} {string}', + (email: string, amount: string, memoText: string) => { + sendPage.enterReceiverEmail(email) + sendPage.enterAmount(amount) + sendPage.enterMemoText(memoText) + } +) + +And('the user submits the send form', () => { + sendPage.submit() + cy.get('.transaction-confirm-send').should('be.visible') +}) + + +Then('the transaction details are presented for confirmation', () => { + cy.get('.transaction-confirm-send').contains('raeuber@hotzenplotz.de') + cy.get('.transaction-confirm-send').contains('+ 120,50 GDD') + cy.get('.transaction-confirm-send').contains('Some memo text') + cy.get('.transaction-confirm-send').contains('+ 515,11 GDD') + cy.get('.transaction-confirm-send').contains('− 120,50 GDD') + cy.get('.transaction-confirm-send').contains('+ 394,61 GDD') +}) + +When('the user submits the transaction by confirming', () => { + cy.intercept({ + method: 'POST', + url: '/graphql', + hostname: 'localhost', + }).as('sendCoins') + + sendPage.submit() + + cy.wait('@sendCoins').then((interception) => { + cy.wrap(interception.response?.statusCode).should('eq', 200) + cy.wrap(interception.request.body) + .should('have.property', 'query', `mutation ($identifier: String!, $amount: Decimal!, $memo: String!) { + sendCoins(identifier: $identifier, amount: $amount, memo: $memo) +} +` ) + cy.wrap(interception.response?.body) + .should('have.nested.property', 'data.sendCoins') + .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 transaction details are displayed on the transcations page', () => { + cy.visit('/transactions') + cy.get('.test-list-group-item').contains('Räuber Hotzenplotz') + cy.get('.test-list-group-item').contains('− 120,50 GDD') +}) \ No newline at end of file From f80e8540ddd6b00a4db5f49daaf2c05f50184e66 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 16 Jun 2023 16:32:19 +0200 Subject: [PATCH 03/20] add send test of e2e feature send coins --- .../support/step_definitions/send_coin_steps.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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 f96da9768..b7c319c08 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -20,11 +20,11 @@ And('the user submits the send form', () => { Then('the transaction details are presented for confirmation', () => { cy.get('.transaction-confirm-send').contains('raeuber@hotzenplotz.de') - cy.get('.transaction-confirm-send').contains('+ 120,50 GDD') + cy.get('.transaction-confirm-send').contains('+ 120.50 GDD') cy.get('.transaction-confirm-send').contains('Some memo text') - cy.get('.transaction-confirm-send').contains('+ 515,11 GDD') - cy.get('.transaction-confirm-send').contains('− 120,50 GDD') - cy.get('.transaction-confirm-send').contains('+ 394,61 GDD') + cy.get('.transaction-confirm-send').contains('+ 515.11 GDD') + cy.get('.transaction-confirm-send').contains('− 120.50 GDD') + cy.get('.transaction-confirm-send').contains('+ 394.61 GDD') }) When('the user submits the transaction by confirming', () => { @@ -50,11 +50,5 @@ When('the user submits the transaction by confirming', () => { 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') + cy.get('.align-items-center').contains('− 120.50 GDD') }) - -Then('the transaction details are displayed on the transcations page', () => { - cy.visit('/transactions') - cy.get('.test-list-group-item').contains('Räuber Hotzenplotz') - cy.get('.test-list-group-item').contains('− 120,50 GDD') -}) \ No newline at end of file From 5a86c10169853171ea1bc6ba135672207dedb2c8 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 16 Jun 2023 16:32:19 +0200 Subject: [PATCH 04/20] 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') }} Date: Tue, 20 Jun 2023 10:37:54 +0200 Subject: [PATCH 05/20] add receive test to e2e feature send coins --- e2e-tests/cypress/e2e/SendCoins.feature | 26 +++++++-- e2e-tests/cypress/e2e/models/OverviewPage.ts | 2 + .../support/step_definitions/email_steps.ts | 54 +++++++++++++++++-- .../step_definitions/send_coin_steps.ts | 19 +++++-- .../Transactions/TransactionReceive.vue | 2 +- .../Transactions/TransactionSend.vue | 2 +- 6 files changed, 91 insertions(+), 14 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 3ff332012..0329b10f7 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -8,15 +8,33 @@ Feature: Send coins # | email | password | name | # | bob@baumeister.de | Aa12345_ | Bob Baumeister | # | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | - + 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" "" "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 And the user navigates to page "/transactions" - Then the transaction details are displayed on the transactions page - + Then the "" and "" are displayed on the "transactions" page + + Examples: + | receiverName | amount | + # | Räuber Hotzenplotz | 120.50 | + | Räuber Hotzenplotz | 120,50 | + Scenario: Receive GDD from other user + Given the user is logged in as "raeuber@hotzenplotz.de" "Aa12345_" + And the user receives the transaction e-mail about "" GDD from "" + When the user opens the "transaction" link in the browser + Then the "" and "" are displayed on the "overview" page + When the user navigates to page "/transactions" + Then the "" and "" are displayed on the "transactions" page + + Examples: + | senderName | amount | + # | Bob der Baumeister | 120.50 | + | Bob der Baumeister | 120,50 | + + diff --git a/e2e-tests/cypress/e2e/models/OverviewPage.ts b/e2e-tests/cypress/e2e/models/OverviewPage.ts index 345124c66..e8f881eba 100644 --- a/e2e-tests/cypress/e2e/models/OverviewPage.ts +++ b/e2e-tests/cypress/e2e/models/OverviewPage.ts @@ -2,6 +2,8 @@ export class OverviewPage { navbarName = '[data-test="navbar-item-username"]' + rightLastTransactionsList = '.rightside-last-transactions' + goto() { cy.visit('/overview') diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index d31e2474e..b0d88e9a7 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -1,9 +1,9 @@ -import { Then, When } from '@badeball/cypress-cucumber-preprocessor' +import { And, Then, When } from '@badeball/cypress-cucumber-preprocessor' +import { OverviewPage } from '../../e2e/models/OverviewPage' import { ResetPasswordPage } from '../../e2e/models/ResetPasswordPage' import { UserEMailSite } from '../../e2e/models/UserEMailSite' const userEMailSite = new UserEMailSite() -const resetPasswordPage = new ResetPasswordPage() Then('the user receives an e-mail containing the {string} link', (linkName: string) => { let emailSubject: string @@ -18,6 +18,10 @@ Then('the user receives an e-mail containing the {string} link', (linkName: stri emailSubject = 'asswor' linkPattern = /\/reset-password\/[0-9]+\d/ break + case 'transaction': + emailSubject = 'has sent you' + linkPattern = /\/overview/ + break default: throw new Error(`Error in "Then the user receives an e-mail containing the {string} link" step: incorrect linkname string "${linkName}"`) } @@ -51,9 +55,53 @@ Then('the user receives an e-mail containing the {string} link', (linkName: stri ) }) +And('the user receives the transaction e-mail about {string} GDD from {string}', (amount: string, senderName:string) => { + cy.origin( + Cypress.env('mailserverURL'), + { args: { amount, senderName, userEMailSite } }, + ({ amount, senderName, userEMailSite }) => { + const subject = `Gradido: ${senderName} has sent you ${amount} Gradido` + const linkPattern = /\/overview/ + cy.visit('/') + cy.get(userEMailSite.emailInbox).should('be.visible') + + cy.get(userEMailSite.emailList) + .find('.email-item') + .filter(`:contains(${subject})`) + .first() + .click() + + cy.get(userEMailSite.emailMeta) + .find(userEMailSite.emailSubject) + .contains(subject) + + cy.get('.email-content', { timeout: 2000}) + .find('.plain-text') + .contains(linkPattern) + .invoke('text') + .then((text) => { + const emailLink = text.match(linkPattern)[0] + cy.task('setEmailLink', emailLink) + }) + } + ) +}) + When('the user opens the {string} link in the browser', (linkName: string) => { cy.task('getEmailLink').then((emailLink) => { cy.visit(emailLink) }) - cy.get(resetPasswordPage.newPasswordInput).should('be.visible') + + switch (linkName) { + case 'activation': + const resetPasswordPage = new ResetPasswordPage() + cy.get(resetPasswordPage.newPasswordInput).should('be.visible') + break + case 'transaction': + const overviewPage = new OverviewPage() + cy.get(overviewPage.rightLastTransactionsList).should('be.visible') + break + default: + throw new Error(`Error in "Then the user receives an e-mail containing the {string} link" step: incorrect link name string "${linkName}"`) + } }) 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 267de7dd1..2baf5968e 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -7,7 +7,7 @@ When( 'the user fills the send form with {string} {string} {string}', (email: string, amount: string, memoText: string) => { sendPage.enterReceiverEmail(email) - sendPage.enterAmount(amount) + sendPage.enterAmount(`${amount}`) sendPage.enterMemoText(memoText) } ) @@ -53,8 +53,17 @@ When('the user submits the transaction by confirming', () => { 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') +Then('the {string} and {string} are displayed on the {string} page', (name: string, amount: string, page: string) => { + switch (page) { + case 'overview': + 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`) + break + default: + throw new Error(`Error in "Then the {string} and {string} are displayed on the {string}} page" step: incorrect page name string "${page}"`) + } }) \ No newline at end of file diff --git a/frontend/src/components/Transactions/TransactionReceive.vue b/frontend/src/components/Transactions/TransactionReceive.vue index 7778c6c6e..f9d776800 100644 --- a/frontend/src/components/Transactions/TransactionReceive.vue +++ b/frontend/src/components/Transactions/TransactionReceive.vue @@ -26,7 +26,7 @@
{{ $t('decay.types.receive') }}
-
{{ amount | GDD }}
+
{{ amount | GDD }}
{{ $t('via_link') }} {{ $t('decay.types.send') }}
-
{{ amount | GDD }}
+
{{ amount | GDD }}
{{ $t('via_link') }} Date: Tue, 20 Jun 2023 10:51:34 +0200 Subject: [PATCH 06/20] linting --- frontend/src/components/Transactions/TransactionReceive.vue | 4 +++- frontend/src/components/Transactions/TransactionSend.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Transactions/TransactionReceive.vue b/frontend/src/components/Transactions/TransactionReceive.vue index f9d776800..d6985ba16 100644 --- a/frontend/src/components/Transactions/TransactionReceive.vue +++ b/frontend/src/components/Transactions/TransactionReceive.vue @@ -26,7 +26,9 @@
{{ $t('decay.types.receive') }}
-
{{ amount | GDD }}
+
+ {{ amount | GDD }} +
{{ $t('via_link') }} {{ $t('decay.types.send') }}
-
{{ amount | GDD }}
+
+ {{ amount | GDD }} +
{{ $t('via_link') }} Date: Tue, 20 Jun 2023 11:09:45 +0200 Subject: [PATCH 07/20] fix send coin feature file --- e2e-tests/cypress/e2e/SendCoins.feature | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 0329b10f7..9abb68295 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -21,8 +21,7 @@ Feature: Send coins Examples: | receiverName | amount | - # | Räuber Hotzenplotz | 120.50 | - | Räuber Hotzenplotz | 120,50 | + | Räuber Hotzenplotz | 120.50 | Scenario: Receive GDD from other user Given the user is logged in as "raeuber@hotzenplotz.de" "Aa12345_" @@ -34,7 +33,5 @@ Feature: Send coins Examples: | senderName | amount | - # | Bob der Baumeister | 120.50 | - | Bob der Baumeister | 120,50 | - + | Bob der Baumeister | 120.50 | From 5345efed4eaef5aecbab288d26aefded2602a0d5 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 11:26:07 +0200 Subject: [PATCH 08/20] fix passwordreset e2e test --- e2e-tests/cypress/support/step_definitions/email_steps.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index b0d88e9a7..9c994b7b8 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -88,13 +88,16 @@ And('the user receives the transaction e-mail about {string} GDD from {string}', }) When('the user opens the {string} link in the browser', (linkName: string) => { + const resetPasswordPage = new ResetPasswordPage() cy.task('getEmailLink').then((emailLink) => { cy.visit(emailLink) }) switch (linkName) { case 'activation': - const resetPasswordPage = new ResetPasswordPage() + cy.get(resetPasswordPage.newPasswordInput).should('be.visible') + break + case 'password reset': cy.get(resetPasswordPage.newPasswordInput).should('be.visible') break case 'transaction': From 39ee78467562075f50168cfc5996a45d39fb90cd Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 11:32:36 +0200 Subject: [PATCH 09/20] fix send coins e2e test --- e2e-tests/cypress/e2e/SendCoins.feature | 2 +- e2e-tests/cypress/support/step_definitions/email_steps.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 9abb68295..169a120b9 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -33,5 +33,5 @@ Feature: Send coins Examples: | senderName | amount | - | Bob der Baumeister | 120.50 | + | Bob der Baumeister | 120,50 | diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index 9c994b7b8..12954fe86 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -19,7 +19,7 @@ Then('the user receives an e-mail containing the {string} link', (linkName: stri linkPattern = /\/reset-password\/[0-9]+\d/ break case 'transaction': - emailSubject = 'has sent you' + emailSubject = 'Gradido gesendet' linkPattern = /\/overview/ break default: From 85751f43b65778939234cf0bfc6e28af5c69fc0c Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 11:32:36 +0200 Subject: [PATCH 10/20] fix send coins e2e test --- e2e-tests/cypress/support/step_definitions/email_steps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index 12954fe86..55cafd600 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -60,7 +60,7 @@ And('the user receives the transaction e-mail about {string} GDD from {string}', Cypress.env('mailserverURL'), { args: { amount, senderName, userEMailSite } }, ({ amount, senderName, userEMailSite }) => { - const subject = `Gradido: ${senderName} has sent you ${amount} Gradido` + const subject = `Gradido: ${senderName} hat dir ${amount} Gradido gesendet` const linkPattern = /\/overview/ cy.visit('/') cy.get(userEMailSite.emailInbox).should('be.visible') From ba7197b2e66920a96cffb49da25e381bb4dd7b1d Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 16:35:52 +0200 Subject: [PATCH 11/20] adaptreceive coins test to language dependency --- e2e-tests/cypress/e2e/SendCoins.feature | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 169a120b9..ae79c4a6e 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -9,27 +9,27 @@ Feature: Send coins # | bob@baumeister.de | Aa12345_ | Bob Baumeister | # | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | - 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" "" "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 - And the user navigates to page "/transactions" - Then the "" and "" are displayed on the "transactions" page + # 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" "" "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 + # And the user navigates to page "/transactions" + # Then the "" and "" are displayed on the "transactions" page - Examples: - | receiverName | amount | - | Räuber Hotzenplotz | 120.50 | + # Examples: + # | receiverName | amount | + # | Räuber Hotzenplotz | 120.50 | Scenario: Receive GDD from other user Given the user is logged in as "raeuber@hotzenplotz.de" "Aa12345_" And the user receives the transaction e-mail about "" GDD from "" When the user opens the "transaction" link in the browser - Then the "" and "" are displayed on the "overview" page + Then the "" and "120.50" are displayed on the "overview" page When the user navigates to page "/transactions" - Then the "" and "" are displayed on the "transactions" page + Then the "" and "120.50" are displayed on the "transactions" page Examples: | senderName | amount | From febc18a85da5b4f48233b086ab5fc56deefada56 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 16:35:52 +0200 Subject: [PATCH 12/20] adaptreceive coins test to language dependency --- e2e-tests/cypress/e2e/SendCoins.feature | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index ae79c4a6e..f9762e825 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -3,11 +3,11 @@ Feature: Send coins I want to send and receive GDD I want to see transaction details on overview and transactions pages - # Background: - # Given the following "users" are in the database: - # | email | password | name | - # | bob@baumeister.de | Aa12345_ | Bob Baumeister | - # | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | + Background: + Given the following "users" are in the database: + | email | password | name | + | bob@baumeister.de | Aa12345_ | Bob Baumeister | + | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | # Scenario: Send GDD to other user # Given the user is logged in as "bob@baumeister.de" "Aa12345_" From aed4b26f3a41ced29694183fb8334389b5910e7e Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 16:35:52 +0200 Subject: [PATCH 13/20] adaptreceive coins test to language dependency --- e2e-tests/cypress/e2e/SendCoins.feature | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index f9762e825..4be341615 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -9,19 +9,19 @@ Feature: Send coins | bob@baumeister.de | Aa12345_ | Bob Baumeister | | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | - # 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" "" "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 - # And the user navigates to page "/transactions" - # Then the "" and "" are displayed on the "transactions" page + 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" "" "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 + And the user navigates to page "/transactions" + Then the "" and "" are displayed on the "transactions" page - # Examples: - # | receiverName | amount | - # | Räuber Hotzenplotz | 120.50 | + Examples: + | receiverName | amount | + | Räuber Hotzenplotz | 120.50 | Scenario: Receive GDD from other user Given the user is logged in as "raeuber@hotzenplotz.de" "Aa12345_" From 2879cd79df9b43345b758a0ae47d1ca318ab2a72 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 20 Jun 2023 16:35:52 +0200 Subject: [PATCH 14/20] adaptreceive coins test to language dependency --- e2e-tests/cypress/e2e/SendCoins.feature | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 4be341615..75049c83f 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -3,11 +3,11 @@ Feature: Send coins I want to send and receive GDD I want to see transaction details on overview and transactions pages - Background: - Given the following "users" are in the database: - | email | password | name | - | bob@baumeister.de | Aa12345_ | Bob Baumeister | - | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | + # Background: + # Given the following "users" are in the database: + # | email | password | name | + # | bob@baumeister.de | Aa12345_ | Bob Baumeister | + # | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | Scenario: Send GDD to other user Given the user is logged in as "bob@baumeister.de" "Aa12345_" From d73b12821667c829c30abb33b9d750d984df9b46 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 26 Jun 2023 09:10:25 +0200 Subject: [PATCH 15/20] adapt e2e email step to email changes --- e2e-tests/cypress/support/step_definitions/email_steps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index 55cafd600..19a632544 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -60,14 +60,14 @@ And('the user receives the transaction e-mail about {string} GDD from {string}', Cypress.env('mailserverURL'), { args: { amount, senderName, userEMailSite } }, ({ amount, senderName, userEMailSite }) => { - const subject = `Gradido: ${senderName} hat dir ${amount} Gradido gesendet` + const subject = `${senderName} hat dir ${amount} Gradido gesendet` const linkPattern = /\/overview/ cy.visit('/') cy.get(userEMailSite.emailInbox).should('be.visible') cy.get(userEMailSite.emailList) .find('.email-item') - .filter(`:contains(${subject})`) + .filter(`:contains(Gradido: ${subject})`) .first() .click() From dfc1880195226c16950bf94e5c89641225d4cd92 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 26 Jun 2023 09:51:48 +0200 Subject: [PATCH 16/20] adapt e2e email step to email changes --- e2e-tests/cypress/support/step_definitions/email_steps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index 19a632544..31141e574 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -61,13 +61,13 @@ And('the user receives the transaction e-mail about {string} GDD from {string}', { args: { amount, senderName, userEMailSite } }, ({ amount, senderName, userEMailSite }) => { const subject = `${senderName} hat dir ${amount} Gradido gesendet` - const linkPattern = /\/overview/ + const linkPattern = /\/transactions/ cy.visit('/') cy.get(userEMailSite.emailInbox).should('be.visible') cy.get(userEMailSite.emailList) .find('.email-item') - .filter(`:contains(Gradido: ${subject})`) + .filter(`:contains(${subject})`) .first() .click() From 07e11fe788ed4eecc0cca91f47ebf898e77f079f Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 27 Jun 2023 17:30:47 +0200 Subject: [PATCH 17/20] use more example data in e2e send coin scenario --- e2e-tests/cypress/e2e/SendCoins.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 75049c83f..55ba2d02e 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -12,7 +12,7 @@ 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" "" "Some memo text" + When the user fills the send form with "" "" "" And the user submits the send form Then the transaction details are presented for confirmation When the user submits the transaction by confirming @@ -20,8 +20,8 @@ Feature: Send coins Then the "" and "" are displayed on the "transactions" page Examples: - | receiverName | amount | - | Räuber Hotzenplotz | 120.50 | + | receiverName | receiverEmail | amount | memoText | + | Räuber Hotzenplotz | raeuber@hotzenplotz.de | 120.50 | Some memo text | Scenario: Receive GDD from other user Given the user is logged in as "raeuber@hotzenplotz.de" "Aa12345_" From a612f2e30528f467dadbe3dac966379c6a4ed58c Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 27 Jun 2023 18:03:32 +0200 Subject: [PATCH 18/20] change value type in send coin step for coherence --- e2e-tests/cypress/support/step_definitions/send_coin_steps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2baf5968e..60958fb2a 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -7,7 +7,7 @@ When( 'the user fills the send form with {string} {string} {string}', (email: string, amount: string, memoText: string) => { sendPage.enterReceiverEmail(email) - sendPage.enterAmount(`${amount}`) + sendPage.enterAmount(amount) sendPage.enterMemoText(memoText) } ) From e763ac3d7aac74c30a1e2aa6dcee6bfbda19559e Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 27 Jun 2023 18:52:19 +0200 Subject: [PATCH 19/20] move transaction details data from step definition to scenario line --- e2e-tests/cypress/e2e/SendCoins.feature | 6 +++--- .../support/step_definitions/send_coin_steps.ts | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e-tests/cypress/e2e/SendCoins.feature b/e2e-tests/cypress/e2e/SendCoins.feature index 55ba2d02e..e35317dc6 100644 --- a/e2e-tests/cypress/e2e/SendCoins.feature +++ b/e2e-tests/cypress/e2e/SendCoins.feature @@ -14,14 +14,14 @@ Feature: Send coins And the user navigates to page "/send" When the user fills the send form with "" "" "" And the user submits the send form - Then the transaction details are presented for confirmation + 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 "transactions" page Examples: - | receiverName | receiverEmail | amount | memoText | - | Räuber Hotzenplotz | raeuber@hotzenplotz.de | 120.50 | Some memo text | + | receiverName | receiverEmail | amount | memoText | senderBalance | newSenderBalance | + | Räuber Hotzenplotz | raeuber@hotzenplotz.de | 120.50 | Some memo text | 515.11 | 394.61 | Scenario: Receive GDD from other user Given the user is logged in as "raeuber@hotzenplotz.de" "Aa12345_" 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 60958fb2a..8a0e054b6 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -18,13 +18,13 @@ And('the user submits the send form', () => { }) -Then('the transaction details are presented for confirmation', () => { - cy.get('.transaction-confirm-send').contains('raeuber@hotzenplotz.de') - cy.get('.transaction-confirm-send').contains('+ 120.50 GDD') - cy.get('.transaction-confirm-send').contains('Some memo text') - cy.get('.transaction-confirm-send').contains('+ 515.11 GDD') - cy.get('.transaction-confirm-send').contains('− 120.50 GDD') - cy.get('.transaction-confirm-send').contains('+ 394.61 GDD') +Then('the transaction details are presented for confirmation {string} {string} {string} {string} {string}', (receiverEmail: string, sendAmount: string, memoText: string, senderBalance: string, newSenderBalance: string) => { + cy.get('.transaction-confirm-send').contains(receiverEmail) + cy.get('.transaction-confirm-send').contains(`+ ${sendAmount} GDD`) + cy.get('.transaction-confirm-send').contains(memoText) + cy.get('.transaction-confirm-send').contains(`+ ${senderBalance} GDD`) + cy.get('.transaction-confirm-send').contains(`− ${sendAmount} GDD`) + cy.get('.transaction-confirm-send').contains(`+ ${newSenderBalance} GDD`) }) When('the user submits the transaction by confirming', () => { From 6ec3701cf63240cc742fdbbbf2ae63c6f593371e Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 27 Jun 2023 19:29:00 +0200 Subject: [PATCH 20/20] 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`)