https://cypress.io logo
Join Discord
Powered by
# help
  • h

    happy-megabyte-98400

    10/15/2022, 12:35 PM
    Could someone please help me with this?
  • n

    narrow-artist-87113

    10/15/2022, 12:51 PM
    Does anyone have idea on where can i access, .env file?
  • n

    narrow-artist-87113

    10/15/2022, 12:53 PM
    I have received these instructions, can anyone tell me, what this means
  • s

    stale-optician-85950

    10/15/2022, 12:56 PM
    A
    .env
    file is a file you add yourself to store environment variables and does not get added to source control. It is placed at the root of your project. If you need it for Cypress then use this package to make it work: https://www.npmjs.com/package/cypress-dotenv
  • s

    stale-optician-85950

    10/15/2022, 1:01 PM
    Just put your login code into a custom command and call that custom command in each file
    beforeEach()
    hook. You can pass specific parameters from each file if necessary i.e. different users, or you could have multiple custom commands for logging in if they differ greatly. Nice and clean!
  • n

    narrow-artist-87113

    10/15/2022, 1:42 PM
    Thank you very much for reply
  • h

    happy-megabyte-98400

    10/15/2022, 1:50 PM
    Just put your login code into a custom
  • n

    narrow-artist-87113

    10/16/2022, 5:20 AM
    Hello everyone, can anyone please explain how can i use the session, like i have wrapped the login credentials inside the cy.session()
  • n

    narrow-artist-87113

    10/16/2022, 5:23 AM
    I would like to explain the flow of control So, first beforeEach() called, which calls login()(Which is defined in Commands.js) and credentials are passed, then it('Deployment of static website ') is executed
  • n

    narrow-artist-87113

    10/16/2022, 5:29 AM
    Now i was expecting that i will be able to login and the usual process will take place but that doesn't happen!
  • n

    narrow-artist-87113

    10/16/2022, 5:30 AM
    Please help and tell me what should i code in my it('Deployment of static website ') to use the session and login in my website and do testing
  • n

    narrow-artist-87113

    10/16/2022, 5:39 AM
    To give brief idea on how my target website work: 1. We go to https://internetcomputerservices.com 2. Click on 'Dashboard' 3. Click on 'Sign in with Google' 4. the page will be redirected to "https://accounts.google.com" and login will happen with the help of email and password 5. We will go to "https://console.internetcomputerservices.com" 6. Then we will again click on 'Sign in with Google' 7. Then we will reach @ Dashboard
  • n

    narrow-artist-87113

    10/16/2022, 5:39 AM
    Please help!!!
  • c

    cool-australia-22894

    10/16/2022, 6:04 AM
    have you looked at https://docs.cypress.io/guides/end-to-end-testing/google-authentication#Adapting-the-front-end ?
  • n

    narrow-artist-87113

    10/16/2022, 6:10 AM
    Actually i am performing login with the help of origin and it is working fine, the problem arrises when a new it() is called, because session() erases all the previous cookies, local and session storage so i am not able to understand how to leverage session() effectively so that the login can happen in less time.
  • n

    narrow-artist-87113

    10/16/2022, 6:21 AM
    On this doc: https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/ I read that:
  • h

    handsome-lion-1748

    10/16/2022, 10:46 AM
    Hi, I disparately 😭 need help with testing a next.js app login page, the issue is that next.js seems to be sending the login html and then the page requests the JS but cypress finds the html elements and submits the data before the JS arrives which makes the test fail without me using a random wait (ex. cy.wait(3000)), I'm trying to use intercept to solve this without the random wait but as you can see in the following image (I'm intercepting everything using
    cy.intercept('')
    ) the form submits and I get a login? url because there's no JS then the JS requests are made.
  • c

    cool-australia-22894

    10/16/2022, 10:48 AM
    cy.wait('@login')
    will only wait for the first request that matched that intercept I think, so if you try creating several intercepts for the different javascript url's and wait for each of them, it might work better. There is a plugin that says "wait on all requests", and there might be better ways to do it, but this might allow you to get going now at least
  • h

    handsome-lion-1748

    10/16/2022, 10:59 AM
    Thanks a lot for the input I really appreciate it! I'll check it, thanks again!
  • h

    handsome-lion-1748

    10/16/2022, 11:37 AM
    @cool-australia-22894 I didn't find the plugin I found this https://stackoverflow.com/questions/64661879/cypress-how-to-wait-for-all-requests-to-finish and I found out that the issue is that there are multiple js files to wait for and every file is multiple chunks so even when I waited for the file it only waited for the first chunk then continued .
  • h

    handsome-lion-1748

    10/16/2022, 11:47 AM
    I've just found this: https://github.com/cypress-io/cypress/issues/5112 I'm checking it out.
  • h

    handsome-lion-1748

    10/16/2022, 12:31 PM
    I tried doing
    cy.get('@alias.all')
    as mentioned in the end of this thread: https://github.com/cypress-io/cypress-documentation/issues/1573 but no luck, this is really frustraiting
  • h

    handsome-lion-1748

    10/16/2022, 12:35 PM
    This comment is identical to my situation: https://github.com/cypress-io/cypress/issues/14916#issuecomment-817924690 and the response doesn't help
  • c

    cool-australia-22894

    10/16/2022, 12:59 PM
    I think it is this one we tested, but we ended up specifying what to wait for instead. https://github.com/bahmutov/cypress-network-idle
  • h

    handsome-lion-1748

    10/16/2022, 1:00 PM
    Thanks omega I saw this one and lost it because of the deep dive I was in! I'll try it. I really appreciate it.
  • h

    handsome-lion-1748

    10/16/2022, 1:18 PM
    I think this should solve my issue, but it's not, (I'm throttling my network to mimic a colleague with slow internet or a user) the loading speed of materials and the page outside of cypress with the same throttling is much much faster than inside of cypress! Any idea why? Or if I'm doing something wrong?
  • h

    handsome-lion-1748

    10/16/2022, 1:21 PM
    I'm sure it's loading outside of cypress!
  • h

    handsome-lion-1748

    10/16/2022, 1:27 PM
    I replaced the call to the library with a simple cy.wait(7000) and the test worked! can the intercepts be causing the run to be much slower?
  • h

    handsome-lion-1748

    10/16/2022, 1:27 PM
    @gray-kilobyte-89541 any idea maybe since you know the implementation?
  • f

    future-terabyte-35712

    10/16/2022, 1:41 PM
    Trying to figure out how things work specifically with the extension. It seems like for chrome it's not needed as removing the line that loads the extension doesn't cause any errors, and when running headless the extension is also not added I've spent a while looking and can't figure out where the socket connection is coming from? The only place I can find that looks like it would open a connection is the extension 🤔 Does anyone know where the connection comes from that triggers
    onConnect
    in
    project-base
    which then resolves
    waitForSocketConnection
    in
    run.ts
    when running headlessly and not headlessly? Thanks
1...176177178...252Latest