refactor email step definitions

This commit is contained in:
mahula 2023-03-02 13:26:58 +01:00
parent d66356c040
commit 10c7e8e2de

View File

@ -2,8 +2,7 @@ import { defineConfig } from 'cypress'
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor' import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'
import browserify from '@badeball/cypress-cucumber-preprocessor/browserify' import browserify from '@badeball/cypress-cucumber-preprocessor/browserify'
let activationLink:string let emailLink: string
let resetPasswordLink: string
async function setupNodeEvents( async function setupNodeEvents(
on: Cypress.PluginEvents, on: Cypress.PluginEvents,
@ -19,17 +18,11 @@ async function setupNodeEvents(
) )
on('task', { on('task', {
setResetPasswordLink: (val) => { setEmailLink: (link: string) => {
return (resetPasswordLink = val) return (emailLink = link)
}, },
getResetPasswordLink: () => { getEmailLink: () => {
return resetPasswordLink return emailLink
},
setActivationLink: (val) => {
return (activationLink = val)
},
getActivationLink: () => {
return activationLink
}, },
}) })