https://cypress.io logo
Hey there, I'm currently trying to migrate tests t...
# e2e-testing
s
Hey there, I'm currently trying to migrate tests to using https://docs.cypress.io/api/commands/origin because a second origin is opened and cypress started complaining recently. So I enabled
experimentalSessionAndOrigin
and it enables the stricter test isolation. That works as expected. We also have custom commands and I need them to be available in the
origin
callback. Luckily the documentation also has a section for that: https://docs.cypress.io/api/commands/origin#Custom-commands So I followed that advice and added this to the spec:
Copy code
before(() => {
  cy.origin('http://secondorigin', () => {
    require('../../support/commands')
  })
})
But the test fails with:
Copy code
"before all" hook for "test case name":
cypress_1     |      ReferenceError: __webpack_require__ is not defined
So it seems the require function cannot be resolved for some reason. Does anyone have a clue why? I'd be very happy about any kind of direction how to further debug this