https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • a

    ancient-wire-34126

    07/22/2021, 8:13 PM
    I guess I could wrap the results and expose it through an alias
  • a

    ancient-wire-34126

    07/22/2021, 9:05 PM
    nope, aliases get reset after every run.... Seriously, is there any way to keep data around? I'm not going to reseed all my data on every run
  • a

    able-kangaroo-37061

    07/22/2021, 9:55 PM
    I seed data by having a
    cy.exec
    call in a before hook -- cy.exec runs the command that seeds data to my test database.
  • a

    able-kangaroo-37061

    07/22/2021, 9:55 PM
    @User ^
  • a

    ancient-wire-34126

    07/22/2021, 11:45 PM
    Yeah I don't use a DB, it's all graphQL, so I have to seed it from the JS files
  • a

    ancient-wire-34126

    07/22/2021, 11:46 PM
    I've found a "pattern" that works, but it's not very elegant. The before/beforeEach hooks are very annoying as they're not scoped unfortunately
  • f

    fancy-car-40677

    07/23/2021, 1:17 PM
    I've got the same problem 😫 I'm on ubuntu and firefox isn't detected... And I can't start Chrome, I must use electron...
  • p

    purple-afternoon-2408

    07/23/2021, 3:03 PM
    Hi team, a quick question, is there configuration variable that I can set to slow actions in cypress?
  • p

    purple-afternoon-2408

    07/23/2021, 3:04 PM
    In Angular, it's very easy for dom elements to get de-attached, and that makes tests inconsistent and subject to fail
  • p

    purple-afternoon-2408

    07/23/2021, 3:04 PM
    I'd have to set
    force: true
    to fix tests every once in a while and randomly, almost feels like I should just make everything forceable by default
  • f

    fancy-airplane-60156

    07/24/2021, 1:24 AM
    hi @User I was using POM pattern (which I know is not recommended). I used the same commands in the test itself. They went through okay. However I'll have to write some reusable commands as this form is a 5 page form.
  • f

    fancy-airplane-60156

    07/25/2021, 12:32 AM
    Hi Team, I added few commands to the command.js. These commands fill read the env data from cypress.json and fill some fields. My tests execute okay but it seems to add load on my macbook as Macbook fan starts as soon as the test starts running. It's quite strange. Any cues ?
  • a

    ancient-wire-34126

    07/26/2021, 9:15 PM
    Does Cypress run everything form the support file before every single spec file? Because holy moly is it slow. Takes 1:45 minutes for 8 small tests. I seed my users/businesses/db-stuff only once, but I get the feeling it's doing it before every test, even though I have everything in a global
    before
    hook in the support file
  • a

    ancient-wire-34126

    07/26/2021, 9:18 PM
    Oh boy it does
  • b

    bulky-sundown-74498

    07/26/2021, 9:19 PM
    @User the support file can be confusing
  • b

    bulky-sundown-74498

    07/26/2021, 9:20 PM
    It is run "in the context of the browser" before every test
  • a

    ancient-wire-34126

    07/26/2021, 9:20 PM
    Is there a way to just run stuff once? Cypress seems to really not want you to store anything between tests, but that's quite critical when you mock out the entire server portion 😦
  • b

    bulky-sundown-74498

    07/26/2021, 9:20 PM
    What you are looking for is something in the plugin
  • a

    ancient-wire-34126

    07/26/2021, 9:21 PM
    Do I have access to
    cy
    command there as well?
  • b

    bulky-sundown-74498

    07/26/2021, 9:21 PM
    Check this out https://github.com/cypress-io/cypress-realworld-app/blob/develop/cypress/plugins/index.ts#L53-L68
  • a

    ancient-wire-34126

    07/26/2021, 9:21 PM
    or is that all just pure TS/JS?
  • a

    ancient-wire-34126

    07/26/2021, 9:21 PM
    ok thanks, I'll take a look!
  • b

    bulky-sundown-74498

    07/26/2021, 9:22 PM
    It is pure TS/JS with some extras
  • a

    ancient-wire-34126

    07/26/2021, 9:23 PM
    Ok that's actually nice, so I would be able to just use ES modules and store my stuff there with getters/setters?
  • b

    bulky-sundown-74498

    07/26/2021, 9:23 PM
    Yes
  • a

    ancient-wire-34126

    07/26/2021, 9:23 PM
    Because that's been the main issue for me. Ah perfect, thanks
  • b

    bulky-sundown-74498

    07/26/2021, 9:23 PM
    but make sure you name your file .ts
  • a

    ancient-wire-34126

    07/26/2021, 9:24 PM
    yeah 😉
  • b

    bulky-sundown-74498

    07/26/2021, 9:24 PM
    we use ts-node to make typescript work so es modules would not work in javascript
  • a

    ancient-wire-34126

    07/26/2021, 9:24 PM
    got it
1...151617...192Latest