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

    gray-kilobyte-89541

    12/13/2022, 5:17 PM
    how do you normally terminate such SSE request?
  • w

    wide-daybreak-98113

    12/13/2022, 5:27 PM
    Well, it's implicit in browser tests, the event source is closed which will end the event stream. Now I want to do it explicitly in an API test, and running into this issue
  • w

    wide-daybreak-98113

    12/13/2022, 5:28 PM
    Just requesting an event stream does not work as it doesn't end
  • g

    gray-kilobyte-89541

    12/13/2022, 5:44 PM
    do you have some code showing the page doing this?
  • w

    wide-daybreak-98113

    12/13/2022, 5:49 PM
    well the page just tests for changes in the DOM which are triggered under the hood by SSE's - it doesn't touch the SSE stream at all..
  • w

    wide-daybreak-98113

    12/13/2022, 5:50 PM
    so in order to test if closing the stream when logging out in the server works at all, I take it down to the api level
  • w

    wooden-exabyte-95341

    12/13/2022, 5:57 PM
    Hi all, any idea how to resolve this error and the cause for this?
  • f

    fresh-doctor-14925

    12/13/2022, 6:01 PM
    That's an error from your application. Usually this is due to Cypress performing an action faster than cypress can handle
  • w

    wooden-exabyte-95341

    12/13/2022, 6:02 PM
    Oh how to resolve it @fresh-doctor-14925 ?
  • f

    fresh-doctor-14925

    12/13/2022, 6:05 PM
    Well, it's hard to say without seeing anything in your application. You could place a
    cy.wait(1000)
    before your
    get('button')
    , and that'll show if it is actually down to cypress being too quick Then you'll need to figure out what assertions you can make to ensure that your application is in the correct state before clicking
  • w

    wooden-exabyte-95341

    12/13/2022, 6:07 PM
    Thanks Liam would try & get back here if struck!!🙂
  • f

    fresh-doctor-14925

    12/13/2022, 6:08 PM
    You're welcome! If you're still having issues, take a look at some of the tips on #763097415896268840 to make it easier for us to answer your question
  • p

    polite-potato-14743

    12/13/2022, 8:27 PM
    Does calling cy.visit reset the session every time now?
  • p

    polite-potato-14743

    12/13/2022, 8:28 PM
    just upgraded and i'm trying to fix my custom login command, i'm setting up a session, but then in beforeEach() i call cy.visit and i'm logged out again
  • p

    polite-potato-14743

    12/13/2022, 8:33 PM
    i think i'm just not using it correctly. I'd like to login in Before() and then visit in BeforeEach(), is this an antipattern now or do I just need to disable testisolation?
  • p

    polite-potato-14743

    12/13/2022, 8:38 PM
    or should I be logging in beforeEach? Seems like a lot of logging in!!
  • b

    bitter-judge-96754

    12/13/2022, 9:12 PM
    I found a way to handle recaptcha. Please let me know if anyone needs help for that 🙂
  • m

    mysterious-psychiatrist-29678

    12/13/2022, 9:49 PM
    this setting in e2e.js worked for me
    Copy code
    Cypress.on('uncaught:exception', (err, runnable) => {
        return false;
      });
  • m

    mysterious-psychiatrist-29678

    12/13/2022, 10:03 PM
    How would you get an element that is identified based on another. Like this dropdown (no static unique ID, a lot of classes in CSS) that should be found based on the text next to. I used this method:
    Copy code
    cy.contains('parent_mutual_class', 'Email address')
      .find('dropdown_class')
      .click()
    do you have a more efficient solution?
  • b

    better-mouse-45393

    12/13/2022, 10:31 PM
    Should I add assertion like should('be.visible') in the next command: cy.contains('Banana') Or does the ' contains ' already check if the element is visible?
  • l

    late-planet-4481

    12/13/2022, 10:46 PM
    I know
    get
    finds hidden elements all the time, so I assume
    contains
    is the same way. Maybe someone else can confirm.
  • l

    late-planet-4481

    12/13/2022, 10:47 PM
    You can also do
    cy.contains(':visible', 'Banana')
    , I think.
  • m

    mysterious-psychiatrist-29678

    12/13/2022, 10:49 PM
    as per my understanding you're right, contains() check the presence not the visibility
  • t

    thousands-house-85089

    12/13/2022, 11:04 PM
    Assertions are your tests criteria anyway, and they are super cheap in terms of runtime/effort so don't scrimp on them. It'll mean your tests are generally better at failing when something changes 🙂
  • h

    happy-megabyte-98400

    12/14/2022, 2:28 AM
    Hi, can someone tell me how to highlight visible text that's not in a input or p tag?
  • m

    magnificent-laptop-98009

    12/14/2022, 3:27 AM
    Is "Email Address" label have the attr "for"? If yes, you can get the id and use as ID for it.
  • p

    plain-elephant-20908

    12/14/2022, 4:29 AM
    hi @billions-receptionist-99356 any updates on this so far? I'm also getting the same error
  • f

    fresh-doctor-14925

    12/14/2022, 7:13 AM
    or should I be logging in beforeEach
  • s

    strong-cat-47196

    12/14/2022, 7:21 AM
    I using login with session in beforeEach() and then it test I navigate to another page in the same domain with cy.visit('/nextPage'). It worked great until I upgraded cypress version (it was 10.7), now after login I see some cookies with value 'deleted' and my app blocking me going to another page and redirect to /disabled page. What changed?
  • c

    crooked-dress-73751

    12/14/2022, 9:47 AM
    hello anyone around
1...168169170...192Latest