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

    nutritious-restaurant-91514

    05/14/2021, 7:31 AM
    Hey thanks for the answer! I can show you if you’d like. I was able to instrument the app using rollup/babel and istanbul plugin. The app is in single file component and it seems to be behaving very similarly to the vue example that Gleb blogged about some time ago, but it wasn’t in TS but in JS, so I wondered if TS is the reason for those weird highlights.
  • p

    purple-afternoon-2408

    05/14/2021, 11:51 AM
    Hello everyone, I see that there is
    cy.intercept
    which would intercept those requests made by the web app, and also it can be used to stub the responses, is there a way that I can also intercept
    cy.request
    made by
    cypress
    ?
  • u

    user

    05/14/2021, 3:42 PM
    do i use my IP and my VM's IP in this for auth 0?
  • i

    important-hydrogen-31560

    05/14/2021, 3:48 PM
    Hey guys I am trying to do a simple login in my app, but when I login via cypress the callback kicks me right out back to the login page
  • i

    important-hydrogen-31560

    05/14/2021, 3:49 PM
    The next request sets the jwt token to deleted
  • i

    important-hydrogen-31560

    05/14/2021, 3:50 PM
    anyone knows why? is this a auth0 problem?
  • s

    stocky-dream-36427

    05/14/2021, 4:01 PM
    Hmm, I don't think so.
  • s

    stocky-dream-36427

    05/14/2021, 4:01 PM
    Can you give me a reproduction repo?
  • n

    nutritious-restaurant-91514

    05/14/2021, 6:57 PM
    Sure I can! here it is https://github.com/filiphric/trelloapp-vue-vite-ts
  • f

    future-journalist-95278

    05/18/2021, 6:57 AM
    How would you go about testing an auth flow that uses Twilio sms?
  • f

    future-journalist-95278

    05/18/2021, 6:58 AM
    I'm not sure how to automate getting the Auth token when a randomized confirmation code is texted to a phone number.
  • i

    incalculable-rocket-67453

    05/18/2021, 9:10 AM
    Has anyone got experience running Cypress against firebase emulator suite in Github Actions?
  • m

    mammoth-arm-34681

    05/19/2021, 7:11 PM
    You can use Twilio api's to empty all sms first then trigger the auth flow and finally call Twilio again to get the last received sms
  • f

    future-journalist-95278

    05/19/2021, 9:55 PM
    Thank you for the response. Could you clarify what you mean by empty all sms?
  • m

    mammoth-arm-34681

    05/20/2021, 7:01 AM
    To ensure that you will read the correct sms, you have to delete all messages for the phone number in test. retrieve messages :
    Copy code
    cy.request({
        method: 'GET',
        url: `https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Messages.json?PageSize=${MESSAGES_LIMIT}&To=${phoneNumber}`,
        auth: {
          username: accountSid,
          password: authToken,
        }
      })
    and for each of them delete:
    Copy code
    cy.request({
              method: 'DELETE',
              url: `https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Messages/${message.sid}.json`,
              auth: {
                username: accountSid,
                password: authToken,
              }
      });
    and then wait for a new incoming message
  • c

    clean-nail-36816

    05/20/2021, 5:26 PM
    Hi Folks, How I can verify the error when I run a Cy.task that is running a SQL query?
  • b

    bulky-sundown-74498

    05/20/2021, 7:36 PM
    @User I believe the real world app has a login/password and is tested with github Actions
  • b

    bulky-sundown-74498

    05/20/2021, 7:36 PM
    let me check
  • a

    alert-photographer-39416

    05/20/2021, 7:36 PM
    oh sweet.
  • b

    bulky-sundown-74498

    05/20/2021, 7:36 PM
    https://github.com/cypress-io/cypress-realworld-app
  • b

    bulky-sundown-74498

    05/20/2021, 7:36 PM
    Totally confirm
  • a

    alert-photographer-39416

    05/20/2021, 7:38 PM
    ok i will take a look here
  • a

    alert-photographer-39416

    05/20/2021, 7:38 PM
    this is my snippet from my yml file
  • a

    alert-photographer-39416

    05/20/2021, 7:39 PM
    test-mode-actions just sets IS_TEST_MODE = true and then runs build
  • a

    alert-photographer-39416

    05/20/2021, 7:40 PM
    and while reviewing the run in github.. i do have this error
    NEXTAUTH_URL environment variable not set
  • r

    rough-fish-62491

    05/20/2021, 8:18 PM
    Hi, I’m doing cypress code coverage for nuxt. I implemented Istanbul and nyc but is still missing something
  • r

    rough-fish-62491

    05/20/2021, 8:18 PM
    Some of you can recommend me a guide?
  • s

    stocky-dream-36427

    05/20/2021, 8:41 PM
    I don't think we have a guide yet.
  • f

    future-journalist-95278

    05/20/2021, 9:58 PM
    Hey all. I am trying to build a login command within my NuxtJS application using the Nuxt Auth module. The command looks like:
    Copy code
    js
    Cypress.Commands.add('login', () => {
      const data = JSON.stringify({
        username: Cypress.env('TEST_USERNAME'),
        password: Cypress.env('TEST_USER_PASSWORD'),
      })
      cy.window().then((window) => {
        window.nuxtApp.$auth.loginWith('login', data)
      })
    })
    What I don't understand is this is giving me a
    Xhr
    request with
    canceled: true
    . I read that
    canceled: true
    occurs because I am attempting a URL change after calling my login command like:
    Copy code
    js
    cy.login()
    cy.visit('http://localhost:3000/settings/info')
    Should I be waiting for the login command to finish? I tried adding an alias like:
    Copy code
    js
    cy.login().as('login')
    cy.wait('@login')
    but Cypress didn't seem to like that...
  • n

    narrow-optician-44716

    05/21/2021, 4:09 PM
    Hi folks, I'm having a problem with the use of a "setTimetout" inside my app component. The timeout is called immediately during tests but works as expected when running the app normally. I don't discard this as a bug in my code but couldn't figure it out. Can anybody help me? The Vue component watches for changes in the session expiration date and schedule setTimeout to end the user session when due.
    Copy code
    // ...
      watch: {
        sessionExpiration: {
          handler: 'startSessionTimer',
          immediate: true
        },
        // ...    
      },
      methods: {
        // ...
        startSessionTimer (expiration) {
          this.clearTimer();
          if (!expiration) return;
    
          const timeout = expiration.getTime() - Date.now();
          console.log({ expiration, now: new Date(), timeout });
    
          this.timeoutId = setTimeout(() => {
            console.log({ timeoutExecuted: new Date() });
            // this.alertAndSignOut();
          }, timeout);
        },
    // ...
    Things work OK when I run the app, but during e2e tests, the setTimeout executes immediately, even with very lengthy expiration dates.
1...456...192Latest