From fb6ec71b3d4342146a76fe3fbd3e2adc129951c9 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 28 Jun 2023 10:17:06 +0200 Subject: [PATCH] lint cypress support files --- e2e-tests/cypress/support/index.ts | 1 + e2e-tests/cypress/support/step_definitions/common_steps.ts | 2 +- e2e-tests/cypress/support/step_definitions/email_steps.ts | 5 +++-- .../cypress/support/step_definitions/send_coin_steps.ts | 2 +- .../support/step_definitions/user_authentication_steps.ts | 1 + .../step_definitions/user_profile_change_password_steps.ts | 6 +++--- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/e2e-tests/cypress/support/index.ts b/e2e-tests/cypress/support/index.ts index f8d1abacf..6224f0f0e 100644 --- a/e2e-tests/cypress/support/index.ts +++ b/e2e-tests/cypress/support/index.ts @@ -7,6 +7,7 @@ import './e2e' declare global { namespace Cypress { + // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Chainable { login(email: string, password: string): Chainable } diff --git a/e2e-tests/cypress/support/step_definitions/common_steps.ts b/e2e-tests/cypress/support/step_definitions/common_steps.ts index 656ffb54f..c2128a308 100644 --- a/e2e-tests/cypress/support/step_definitions/common_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/common_steps.ts @@ -1,4 +1,4 @@ -import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor' +import { Given, Then } from '@badeball/cypress-cucumber-preprocessor' import { OverviewPage } from '../../e2e/models/OverviewPage' import { SideNavMenu } from '../../e2e/models/SideNavMenu' import { Toasts } from '../../e2e/models/Toasts' diff --git a/e2e-tests/cypress/support/step_definitions/email_steps.ts b/e2e-tests/cypress/support/step_definitions/email_steps.ts index c6ef5e376..a2e6dbcb8 100644 --- a/e2e-tests/cypress/support/step_definitions/email_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/email_steps.ts @@ -1,4 +1,4 @@ -import { And, Then, When } from '@badeball/cypress-cucumber-preprocessor' +import { 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' @@ -55,7 +55,7 @@ Then('the user receives an e-mail containing the {string} link', (linkName: stri ) }) -And( +When( 'the user receives the transaction e-mail about {string} GDD from {string}', (amount: string, senderName: string) => { cy.origin( @@ -102,6 +102,7 @@ When('the user opens the {string} link in the browser', (linkName: string) => { cy.get(resetPasswordPage.newPasswordInput).should('be.visible') break case 'transaction': + // eslint-disable-next-line no-case-declarations const overviewPage = new OverviewPage() cy.get(overviewPage.rightLastTransactionsList).should('be.visible') break 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 707b8a147..d26733221 100644 --- a/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/send_coin_steps.ts @@ -35,7 +35,7 @@ Then( }, ) -When('the user submits the transaction by confirming', (receiverName: string, amount) => { +When('the user submits the transaction by confirming', () => { cy.intercept({ method: 'POST', url: '/graphql', diff --git a/e2e-tests/cypress/support/step_definitions/user_authentication_steps.ts b/e2e-tests/cypress/support/step_definitions/user_authentication_steps.ts index fb8cf400e..f96499409 100644 --- a/e2e-tests/cypress/support/step_definitions/user_authentication_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/user_authentication_steps.ts @@ -15,6 +15,7 @@ When('the user submits no credentials', () => { When('the user submits the credentials {string} {string}', (email: string, password: string) => { cy.intercept('POST', '/graphql', (req) => { + // eslint-disable-next-line no-prototype-builtins if (req.body.hasOwnProperty('query') && req.body.query.includes('mutation')) { req.alias = 'login' } diff --git a/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts b/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts index 8cc45d5b0..c08236cde 100644 --- a/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts @@ -1,4 +1,4 @@ -import { And, When } from '@badeball/cypress-cucumber-preprocessor' +import { And, DataTable, When } from '@badeball/cypress-cucumber-preprocessor' import { ProfilePage } from '../../e2e/models/ProfilePage' import { Toasts } from '../../e2e/models/Toasts' @@ -10,7 +10,7 @@ And('the user opens the change password menu', () => { cy.get(profilePage.submitNewPasswordBtn).should('be.disabled') }) -When('the user fills the password form with:', (table) => { +When('the user fills the password form with:', (table: DataTable) => { const hashedTableRows = table.rowsHash() profilePage.enterOldPassword(hashedTableRows['Old password']) profilePage.enterNewPassword(hashedTableRows['New password']) @@ -22,7 +22,7 @@ And('the user submits the password form', () => { profilePage.submitPasswordForm() }) -When('the user is presented a {string} message', (type: string) => { +When('the user is presented a {string} message', () => { const toast = new Toasts() cy.get(toast.toastSlot).within(() => { cy.get(toast.toastTypeSuccess)