lint cypress support files

This commit is contained in:
mahula 2023-06-28 10:17:06 +02:00
parent 8db179c517
commit fb6ec71b3d
6 changed files with 10 additions and 7 deletions

View File

@ -7,6 +7,7 @@ import './e2e'
declare global {
namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): Chainable<any>
}

View File

@ -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'

View File

@ -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

View File

@ -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',

View File

@ -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'
}

View File

@ -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)