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

    magnificent-morning-56777

    08/30/2022, 8:14 AM
    hi! does anyone have good examples/blogs/any info of cypress e2e with vuetify? particularly hard to find any. General question, when for example a UI framework offers a component, let's say a calendar, is my only option to use it via cypress is to rely on framework's provided classes( "tbody > :nth-child(1) > :nth-child(2) > .v-btn" ) ? they don't change often(ever?), but still not always readable in a test file.
  • h

    happy-dinner-13480

    08/30/2022, 8:52 AM
    Can you do an upwards find? I know you can do a
    .find('input')
    on a element to find the input elements inside that. but what if I want to find a
    tr
    based on a span inside that
    tr
    ?
  • h

    happy-dinner-13480

    08/30/2022, 8:57 AM
    ah, i think
    parentsUntil()
    is what i needed
  • c

    cold-van-45410

    08/30/2022, 9:18 AM
    How to assert cdt time in cypres?
  • h

    high-optician-91398

    08/30/2022, 9:18 AM
    I am testing a page and there is one step where I go to an external page to make a payment (it is a "registration process"). I want to insert my fake card data and then I get redirected back to my site to continue the registration process. Since the payment is done in the bank's page, Cypress complain about the redirect. Is this a use case I can't do with Cypress?
  • a

    acceptable-hamburger-48790

    08/30/2022, 9:22 AM
    https://docs.cypress.io/api/commands/origin#Using-dynamic-data-in-a-secondary-origin did you check this
  • m

    mysterious-motherboard-13344

    08/30/2022, 9:22 AM
    Which version of Cypress are you using?
    • 1
    • 1
  • h

    high-optician-91398

    08/30/2022, 9:23 AM
    Let me check. I read the "learn more" of the error and the proposed solutions weren't what I needed. Let me read this. Seems good
  • h

    high-optician-91398

    08/30/2022, 9:23 AM
    latest. I am going to check that doc first
  • h

    high-optician-91398

    08/30/2022, 9:58 AM
    Ok, so cy.origin does the trick. I needed two (anidating is not available right now but one after the other seems fine). Then to finish it opens a new page. Oh well. This page is a bit weird.
  • a

    acceptable-solstice-90676

    08/30/2022, 12:33 PM
    Awesome, I will give it a try, although I actually don't want to clear in
    afterEach()
    I want to clear in
    after()
    and I have noticed that
    cy.clearCookies()
    command does not work in
    after
    just in
    afterEach()
  • c

    chilly-teacher-56118

    08/30/2022, 1:26 PM
    I’m getting this kind of error while installing Cypress
  • l

    limited-barista-33480

    08/30/2022, 1:45 PM
    hello, you can check this link to verify that you have correctly installed node js and npm. commands needed before installing cypress https://kinsta.com/es/blog/como-instalar-node-js/
  • q

    quaint-winter-32919

    08/30/2022, 2:04 PM
    Hey, I keep getting
    Copy code
    Cypress detected a cross origin error happened on page load:
    
    > Blocked a frame with origin "http://localhost:5002" from accessing a cross-origin frame.
    
    Before the page load, you were bound to the origin policy:
    
    > http://localhost:5002
    
    A cross origin error happens when your application navigates to a new URL which does not match the origin policy above.
    
    A new URL does not match the origin policy if the 'protocol', 'port' (if specified), and/or 'host' (unless of the same superdomain) are different.
    
    Cypress does not allow you to navigate to a different origin URL within a single test.
    
    You may need to restructure some of your test code to avoid this problem.
    
    Alternatively you can also disable Chrome Web Security in Chromium-based browsers which will turn off this restriction by setting { chromeWebSecurity: false } in cypress.config.js.Learn more
    even thos I deactivated chromeWebSecurity
  • q

    quaint-winter-32919

    08/30/2022, 2:04 PM
    Anyone an idea how I could solve the issue?
  • s

    stale-optician-85950

    08/30/2022, 3:09 PM
    We cannot know from that generic error text if your application is in fact crossing origins. Manually step through your test flow again and track if that base URL is actually changing or not. If it is, then implement cy.origin() https://docs.cypress.io/api/commands/origin
  • f

    famous-analyst-30680

    08/30/2022, 6:29 PM
    Hey I'm getting an error with my cypress test, the DOM snapshots are showing placeholder for. Here's a screen recording https://www.loom.com/share/b54522d95a48482aac41a86f53263857
  • f

    famous-analyst-30680

    08/30/2022, 6:34 PM
    Is there a settings I'm missing or am I doing something wrong?
  • s

    strong-energy-6158

    08/31/2022, 4:10 AM
    Can someone give me the command to run cypress (the latest version) using docker? I am still getting an error. Any docker experts here?
  • c

    chilly-quill-34099

    08/31/2022, 6:26 AM
    Hey there, I would like to select an element by selector
    data-testid="myElement
    inside the elements
    app-element-1 > app-element-2
    . I tried different combinations using
    cy.get()
    and
    cy.find()
    but wasn't able to find a working combination. So the path to the DOM-Element is
    app-element-1 > app-element-2 > data-testid="myElement
    . Anyone an idea?
  • a

    acceptable-hamburger-48790

    08/31/2022, 6:29 AM
    So what happens when you use cy.get(“[data-testid=‘myElement’]”) ?
  • c

    chilly-quill-34099

    08/31/2022, 6:32 AM
    That works fine, but it isn't specific enough. I am using Angular and I am reusing that element in a different location in the same DOM-tree. So besides
    app-element-1 > app-element-2 > data-testid="myElement
    , there is also
    app-element-3 > app-element-4 > data-testid="myElement
    or
    app-element-5 > app-element-6 > data-testid="myElement
    . In other words, the parents of the
    data-testid="myElement
    element needs to be differentiated.
  • a

    acceptable-hamburger-48790

    08/31/2022, 6:35 AM
    Did you try cy.within ? See if that fits your purpose
  • c

    chilly-quill-34099

    08/31/2022, 6:36 AM
    Thanks, I will have a look into that! 🙂 👍
  • c

    chilly-quill-34099

    08/31/2022, 6:48 AM
    So your error says, that it can't find the e2e-test files. When you run your container, you mount your current working directory (of your terminal) with the
    e2e
    folder of your docker container. You do that via the parameter
    -v $PWD:/e2e
    . You do that, so that everything in your
    e2e
    -folder locally is available in your container. Is the linking of your
    e2e
    folder done correctly? Is it pointing to the correct folder?
  • c

    chilly-quill-34099

    08/31/2022, 8:10 AM
    @acceptable-hamburger-48790 It worked! Thanks a lot for your help! 🙂
  • p

    proud-breakfast-29892

    08/31/2022, 9:57 AM
    Hello. I have an issue regarding page navigation: In my web application, the page load can be a bit inconsistent. In my
    beforeEach
    , I navigate to my designated page by using
    cy.visit
    and then asserting the url contains the page name I wanted to navigate to. Sometimes it doesn't work, even after navigation the url does not contain it. I figured perhaps I use
    cy.visit
    too early in my test, so I tried to intercept all requests prior to navigation and wait for them to be finished. However, these requests aren't consistent and sometimes they won't happen. There is also no "page loaded" event firing when the load has been completed, so I can't rely on that. What can I do to ensure my navigation actually worked?
  • c

    chilly-quill-34099

    08/31/2022, 10:09 AM
    Is it possible to output/log a warning? My use case would be: I have several tests, which aren't yet implemented, but will be in the future. Therefore I would like to prepare the tests, with missing implementation.
  • c

    chilly-quill-34099

    08/31/2022, 10:15 AM
    So this is in the backlog: https://github.com/cypress-io/cypress/issues/4917
  • s

    strong-energy-6158

    08/31/2022, 11:24 AM
    Thanks for coming forward to help me out. Yes, my cypress projects run successfully in my local. I am pretty new to docker and learning docker now. I got the below command from a blog and tried to run. Do I need to do linking of e2e folder specifically? I didn't do any kind of linking to run in docker. Can you please let me know what I should do to get it run successfully? ( I have attached a screenshot of the folder structure here) command used to run: docker run -it -v $PWD:/e2e -w /e2e --entrypoint=cypress cypress/included:9.4.1 run
1...919293...192Latest