refactor login query in e2e test

This commit is contained in:
mahula 2023-03-07 09:12:06 +01:00
parent 3d9909b98e
commit b992b1fb53

View File

@ -2,7 +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 emailLink: string let resetPasswordLink: string
async function setupNodeEvents( async function setupNodeEvents(
on: Cypress.PluginEvents, on: Cypress.PluginEvents,
@ -18,11 +18,11 @@ async function setupNodeEvents(
) )
on('task', { on('task', {
setEmailLink: (link: string) => { setResetPasswordLink: (val) => {
return (emailLink = link) return (resetPasswordLink = val)
}, },
getEmailLink: () => { getResetPasswordLink: () => {
return emailLink return resetPasswordLink
}, },
}) })
@ -56,7 +56,7 @@ export default defineConfig({
env: { env: {
backendURL: 'http://localhost:4000', backendURL: 'http://localhost:4000',
mailserverURL: 'http://localhost:1080', mailserverURL: 'http://localhost:1080',
loginQuery: `query ($email: String!, $password: String!, $publisherId: Int) { loginQuery: `mutation ($email: String!, $password: String!, $publisherId: Int) {
login(email: $email, password: $password, publisherId: $publisherId) { login(email: $email, password: $password, publisherId: $publisherId) {
email email
firstName firstName
@ -69,7 +69,8 @@ export default defineConfig({
hasElopage hasElopage
publisherId publisherId
isAdmin isAdmin
creation hideAmountGDD
hideAmountGDT
__typename __typename
} }
}`, }`,