an impure function in the beforeEach
# help
m
an impure function in the beforeEach
a
here's my beforeEarch at the minute
Copy code
js
    beforeEach(() => {
        cy.intercept('POST', '/administration/integrations/gtm/').as('saveGTM')
        cy.login(Cypress.env('admin_username'))
        cy.visit('/dashboard')
        cy.contains('a', 'Account Menu').click()
        cy.contains('a', 'Admin').click()
        cy.contains('a', 'Site Settings').click()
        cy.contains('a', 'Integrations').click()
        cy.contains('h1', 'Active Integrations')
        cy.contains('Google Tag Manager')
            .parents('.card')
            .as('googleTagManagerCard')
    })
might be the alias... actually
m
if alias, all good
a
hmm actually just realized.... the
it
block is actually re-running after the the Save button click initiates the post
move the cy.contains(a, *) clicks to the start of the it block
m
sometimes you gotta ask the question to facilitate the brain 🙂
a
here's the start of my cypress.json
Copy code
json
{
    "baseUrl": "http://127.0.0.1:8000",
    "env": {
        "admin_username": "adminuser@tcmail.com",
thanks for asking the questions!!
any other ideas? at a loss...
m
what's the time travel debugger looking like?
3 Views