bulky-sundown-74498
07/26/2021, 9:27 PMbulky-sundown-74498
07/26/2021, 9:28 PMbulky-sundown-74498
07/26/2021, 9:28 PMancient-wire-34126
07/27/2021, 4:02 PMts
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on: any, config: { env: { awsConfig: any } }) => {
// AWS config
config.env.awsConfig = awsconfig
console.log('plugins') // this logs
on('before:run', (details) => {
setA('hello!') // This never seems to run
console.log('hello')
})
return config
}
spec:
ts
import { getA } from '../../data/users'
describe('Login', () => {
// Intercept all calls to Cognito, so we can stub the responses.
// All OPTIONS (preflight) calls should be successful.
beforeEach(() => {
console.log(getA()) // logs null
cy.visit('login')
})
ancient-wire-34126
07/27/2021, 4:03 PMancient-wire-34126
07/27/2021, 4:10 PMbefore:browser:launch
ever triggersancient-wire-34126
07/27/2021, 4:12 PMexperimentalInteractiveRunEvents
flag?bulky-sundown-74498
07/27/2021, 4:13 PMancient-wire-34126
07/27/2021, 4:14 PMancient-wire-34126
07/27/2021, 4:14 PMancient-wire-34126
07/27/2021, 4:17 PMts
const a = {
foo: null,
}
export const setA = (val) => {
a.foo = val
}
export const getA = () => a
plugin/index.ts
ts
import { setA } from '../some-module'
module.exports = (on: any, config: { env: { awsConfig: any } }) => {
on('before:run', (details) => {
setA('hello!')
})
}
test.spec.ts
ts
import { getA } from '../some-module'
describe('Login', () => {
beforeEach(() => {
console.log(getA()) // { foo: null } instead of { foo: 'hello!' }
})
})
bulky-sundown-74498
07/27/2021, 4:32 PMancient-wire-34126
07/27/2021, 4:47 PMbulky-sundown-74498
07/27/2021, 4:48 PMbulky-sundown-74498
07/27/2021, 4:48 PMbulky-sundown-74498
07/27/2021, 4:49 PMancient-wire-34126
07/27/2021, 4:49 PMbulky-sundown-74498
07/27/2021, 4:49 PMancient-wire-34126
07/27/2021, 4:50 PMancient-wire-34126
07/27/2021, 4:52 PMancient-wire-34126
07/27/2021, 4:53 PMancient-wire-34126
07/27/2021, 4:58 PMesnext
also doesn't work :/ancient-wire-34126
07/27/2021, 5:06 PMancient-wire-34126
07/27/2021, 5:10 PMbulky-sundown-74498
07/27/2021, 5:28 PMbulky-sundown-74498
07/27/2021, 5:29 PMbulky-sundown-74498
07/27/2021, 5:31 PMancient-wire-34126
07/27/2021, 5:34 PMancient-wire-34126
07/27/2021, 5:49 PMancient-wire-34126
07/27/2021, 5:50 PM