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

    wonderful-match-15836

    07/09/2021, 3:00 PM
    I'm curious how you are using/checking the result of cy.window? I just set a global from code in my app, and in one of my tests tried to log the window object. The results were a little surprising to me.
    Copy code
    cy.window().then((win) => {
      console.log(win); // I can't see the global when I inspect this object
      console.log(win.__testProp__); // but sure enough I can access it
    });
    It took me a second to realize the problem - in my case, when the test completes, an
    afterEach
    runs that navigates back to a starting page and logs out. So by the time I expand that object in the console and it gets evaluated,
    window
    is a different page that never set the globals. If I put a
    cy.pause()
    after the console log so the test stays put while I inspect the logs, I was able to see that my
    __testProp__
    was indeed part of the window object.
  • d

    dazzling-gold-63692

    07/09/2021, 3:53 PM
    Hello All, We are trying to upload a pdf file using the multipart/form-data in cy.request() but so far we have been unsuccessful. Could someone please provide an example of cy.request() file upload using multipart/form-data ? TIA
  • f

    faint-bear-92677

    07/10/2021, 6:51 PM
    This may be a useful plugin: https://github.com/abramenal/cypress-file-upload Hopefully it works out of the box, but if it's not exactly what you're looking for, the repo could provide some useful insight on how to accomplish what you're looking for.
  • d

    dazzling-gold-63692

    07/11/2021, 10:19 PM
    Thanks Michael. I have gone through that but unfortunately, it doesnt help me with uploading a file via API with content-type as multipart/form-data using cy.request(). The cy.server and router are deprecated and this doesnt work for cy.request().
  • l

    little-truck-20143

    07/12/2021, 1:13 AM
    Hi all, I want to list the account from our sybase database and Key in one account to UI with cypress ? Is that possible with cypress ?
  • f

    faint-bear-92677

    07/13/2021, 2:48 AM
    Woops, missed the cy.request piece. If you find a solution, I'd love to hear it. I'll check back in if I find something.
  • b

    best-yacht-92435

    07/13/2021, 3:12 PM
    So following the programatic login for Cognito (https://docs.cypress.io/guides/testing-strategies/amazon-cognito-authentication#Custom-Command-for-Amazon-Cognito-Authentication) there is one thing that is not making sense for me. Why would it have to redo the login after every test. Right now the login fail after running 4 test. I am sure I am missing something.
  • b

    brief-kite-35331

    07/14/2021, 8:49 PM
    Hi, I am writing tests for e-commerce website and one part of the test is to automate the checkout. As part of the checkout process there is an option to choose payment method (for example Mastercard). As you choose Mastercard and proceed with the checkout you are redirected to our payment service provider url offering you to enter the card details. I enter the card details in the test and when clicking on confirm button cypress falls apart (Test runner just crashes). Could this be the issue with the cross-origin that cypress doesn't support? What would be the ways to tackle this case in best way using cypress? Any advice?
  • m

    modern-nail-49491

    07/15/2021, 4:49 PM
    I am using Ubuntu-20.04 LTS as my WSL2 in my system. I installed VcXsrc and allowed it through Firewall. I set my DISPLAY environment variable and allowed automatic run for D-bus. Spent 2 days on trying to start GUI with my WSL2 and I am getting the Cypress verification error. I went to node_modules/cypress/lib/tasks/verify.js and changed the TIMEOUT from 3000 to 10000 and ran yarn run cypress verify. I still get a timeout
  • u

    user

    07/16/2021, 10:30 AM
    Hi every one, I want to unite test sets by description. On this screenshot I have two
    Region
    but I need to have one
    Region
    and all tests should be inside
    Region
    . How can I do this?
  • a

    ancient-wire-34126

    07/16/2021, 1:12 PM
    The documentation here seems incorrect: https://docs.cypress.io/guides/testing-strategies/amazon-cognito-authentication#Setting-Amazon-Cognito-app-credentials-in-Cypress
  • a

    ancient-wire-34126

    07/16/2021, 1:13 PM
    dotenv
    comes out of nowhere for example
  • a

    ancient-wire-34126

    07/16/2021, 1:14 PM
    Oh sheesh, they use a pre-made repo...
  • a

    ancient-wire-34126

    07/16/2021, 1:16 PM
    Which you will miss if you already use Cognito
  • a

    ancient-wire-34126

    07/16/2021, 2:12 PM
    Darn... I'm getting the gist of it, but we don't use username/password, we use an auth challenge and it's hard to figure out how to respond to that. I'm also doubting about test accounts, because I assume I now have to create those accounts locally and on the test server manually?
  • u

    user

    07/16/2021, 3:40 PM
    I'm having this dir structure:
    Copy code
    ├── cypress
    │   ├── cypress.json
    │   ├── fixtures
    │   ├── integration
    │   ├── plugins
    │   ├── screenshots
    │   └── support
    when running within CI I'm getting error from Cypress:
    We looked but did not find a cypress.json file in this folder: /e2e
    I'm using containerized Cypress:
    docker run -v $PWD:/cypress -w /e2e --network tdd_default cypress/included:7.7.0
    What am I doing wrong ?
  • b

    bulky-sundown-74498

    07/16/2021, 3:40 PM
    Are you using the vue cli plugin ?
  • b

    bulky-sundown-74498

    07/16/2021, 3:41 PM
    actually, my bad I did not see you cypress json
  • b

    bulky-sundown-74498

    07/16/2021, 3:41 PM
    The usual place for is at the top, and all other paths will be calculated relative to it
  • b

    bulky-sundown-74498

    07/16/2021, 3:42 PM
    If you move your cypress.json inside the cypress directory, you will have to adjust all your paths to this new config
  • b

    bulky-sundown-74498

    07/16/2021, 3:43 PM
    If you are as lazy as I am, you'll move the config file near the package.json
  • b

    bulky-sundown-74498

    07/16/2021, 3:43 PM
    But if you have some extra cycles, you can do the adaptation of the config
  • u

    user

    07/16/2021, 3:48 PM
    I'm moving it one directory up let's see how that goes in GitLab CI ....
  • u

    user

    07/16/2021, 4:04 PM
    @User Got the same error after moving
    cypress.json
    one level up. I wonder if I can just run
    ls
    within the environment to see if the file is even present where I expect it.
  • b

    bulky-sundown-74498

    07/16/2021, 4:05 PM
    That is a great idea
  • b

    bulky-sundown-74498

    07/16/2021, 4:06 PM
    Doe sit run locally ?
  • b

    bulky-sundown-74498

    07/16/2021, 4:06 PM
    Does cypress run
  • u

    user

    07/16/2021, 4:11 PM
    I normally run cypress locally without container using
    node_modules/.bin/cypress run --config-file cypress-dev.json
    and that runs. But now I downloaded containerized Cypress and it gives me the same error. The only difference between
    cypress-dev.json
    and
    cypress.json
    is the
    baseUrl
    value. Which is different for CI environment.
  • b

    bulky-sundown-74498

    07/16/2021, 4:11 PM
    That would not change anything about the resolution of cypress.json 😉
  • b

    bulky-sundown-74498

    07/16/2021, 4:11 PM
    I need to get my head into docker
1...262728...252Latest