https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • n

    narrow-optician-44716

    05/21/2021, 4:12 PM
    the logs above are from the testRunner. you can see that the timeout value is a large value, nonetheless, the execution happens immediately
  • n

    narrow-optician-44716

    05/21/2021, 4:13 PM
    below are logs from the app running normally
  • n

    narrow-optician-44716

    05/21/2021, 4:52 PM
    i forget to mention... the cypress version is 6.8.0
  • n

    narrow-optician-44716

    05/21/2021, 5:26 PM
    i updated to 7.3.0. the behavior is the same.
  • a

    alert-photographer-39416

    05/21/2021, 5:44 PM
    hey guys, im running e2e tests locally and are all passing successfully, but when they are executing via github actions, its not able to find in a select box. has anyone else had this problem?
  • a

    alert-photographer-39416

    05/21/2021, 5:44 PM
    here is the error
  • n

    narrow-optician-44716

    05/21/2021, 5:53 PM
    the options are feed with data from an async request? if so, maybe the timeout is reached before the request is completed.
  • a

    alert-photographer-39416

    05/21/2021, 5:54 PM
    no, they are actually hard coded options
  • a

    alert-photographer-39416

    05/21/2021, 5:54 PM
    i tried to wait, too.. just in case something wasnt rendering quickly enough
  • a

    alert-photographer-39416

    05/21/2021, 5:54 PM
    no luck so far
  • n

    narrow-optician-44716

    05/21/2021, 6:09 PM
    that's hard. sorry can't help more.
  • a

    alert-photographer-39416

    05/21/2021, 6:14 PM
    no problem thanks anyway!
  • s

    stocky-dream-36427

    05/21/2021, 6:36 PM
    @User try checking the video logs to see what's going on
  • n

    narrow-optician-44716

    05/21/2021, 6:42 PM
    friends, forget about this. the problem is that large timeout numbers make setTimeout imediatly execute without any error or warning. so our user test tokens (which have many decades of expiration) trigger this odd behavior. tks.
  • s

    stocky-dream-36427

    05/21/2021, 6:47 PM
    np
  • a

    alert-photographer-39416

    05/21/2021, 7:34 PM
    @User Maybe a silly question but I am not sure how to actually view those videos that are created when the tests are run via github actions
  • a

    alert-photographer-39416

    05/21/2021, 7:34 PM
    i do see that it was created
  • s

    stocky-dream-36427

    05/21/2021, 7:59 PM
    @User https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
  • m

    mysterious-analyst-56660

    05/22/2021, 4:17 PM
    Specific code coverage guides for various stacks is on the roadmap of the team. We already have nifty packages for handling React, so showing the way with Vue (and Nuxt) would be the next logical thing to prioritize. Requests like yours helps us prioritize these things.
  • g

    gray-kilobyte-89541

    05/24/2021, 5:04 PM
    Cody, the
    window.nuxtApp.$auth.loginWith('login', data)
    is probably a promise-returning operation? When do you know it is finished? If it returns a promise, then you should return it too from
    .then
    callback. That way Cypress would know and wait
  • f

    future-journalist-95278

    05/24/2021, 9:48 PM
    This pointed me in the right direction. thank you. The command ended up looking like:
    Copy code
    js
    Cypress.Commands.add('login', () => {
      const data = {
        username: Cypress.env('TEST_USERNAME'),
        password: Cypress.env('TEST_USER_PASSWORD'),
      }
      cy.window().then((window) => {
        return window.nuxtApp.$auth.loginWith('login', { data })
      })
    })
    And I use it like:
    Copy code
    js
    cy.login().then(() => {})
  • g

    gray-kilobyte-89541

    05/25/2021, 1:10 PM
    why the
    .then(() => {})
    ? Why the empty callback after login?
  • i

    icy-rainbow-39970

    05/25/2021, 3:16 PM
    Path is already in the details 😂
  • a

    alert-photographer-39416

    05/25/2021, 3:17 PM
    Yeah i see the path. But I cannot access it.
  • i

    icy-rainbow-39970

    05/25/2021, 3:19 PM
    That’s strange. Then no idea
  • f

    future-journalist-95278

    05/25/2021, 4:18 PM
    Sorry, the empty callback is just an example. I place the cy.visit logic within it or anything else I may need.
  • g

    gray-kilobyte-89541

    05/25/2021, 5:40 PM
    you don't even need it. Since cy.login custom command properly waits now for the nuxtApp action, the rest of the test will wait for cy.login() to finish. So you can simply write
    Copy code
    cy.login()
    cy.visit('/')
  • f

    future-journalist-95278

    05/26/2021, 6:53 PM
    Ah, interesting. This does work. Thank you.
  • f

    flat-electrician-52949

    05/27/2021, 10:38 AM
    Messing around with
    cy.intercept
    and got a couple of questions (hope you don't mind). What is the best practice to test that the interception did happen? (right now I'm doing the assertion within the interception)
  • s

    sparse-jackal-93514

    05/27/2021, 4:02 PM
    An assertion within the interception is fine. Are you just asserting the interception to make sure you implemented it correctly?
1...567...192Latest