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

    prehistoric-restaurant-72560

    10/27/2022, 10:32 AM
    Hi, anyone using prettier in vsc and figured out how to prevent it to break cypress chains?
    • 1
    • 1
  • g

    gray-kilobyte-89541

    10/27/2022, 10:36 AM
    cannot use cy commands inside a callback https://glebbahmutov.com/blog/cypress-out-of-band/ Just use Chai assertions
  • l

    little-quill-7630

    10/27/2022, 10:40 AM
    Oh, that is confusing then.. I was following this https://docs.cypress.io/api/commands/intercept#Asserting-on-a-request-1
  • l

    little-quill-7630

    10/27/2022, 10:41 AM
    but we use
    cy.wrap(...).should(....)
    to do our asserts.. (Don't blame me, my managers decision)
  • l

    little-quill-7630

    10/27/2022, 10:41 AM
    @gray-kilobyte-89541 ^
  • l

    little-quill-7630

    10/27/2022, 10:43 AM
    So, just to be clear, asserts are fine, as long as you don't use the
    cy.wrap().should()
    stuff?
  • l

    little-quill-7630

    10/27/2022, 10:46 AM
    I ended up changing to just intercepting simply and
    Copy code
    ts
    it('should correctly parse sort order when loading existing aqs', () => {
      cy.intercept('api/aqs/join*').as('aqsJoinIntercept');
    
      openDataExplorer(); // Gets to correct place in UI
      loadSavedQuery(); // Searches for existing aqs and initalises the aqs join ajax request to the api and then ensures the search dialog has been removed.
    
      cy.wait('@aqsJoinIntercept').its('request.body.aqs.properties.sortInfo.sortOrder').should('equal', 'Descending');
    });
    Not sure if that is a more official way of doing it or not? Since it waits until after the response has returned.
  • m

    miniature-doctor-74028

    10/27/2022, 11:48 AM
    Hi everyone, Is there an ETA for the cy.origin and cy.session functionalities? We are in need of using it, but we would like to wait for it to be fully released first since we would like to avoid any breaking changes It seems to be scheduled for the v12 release, but, since I believe that would be in at least 8 months from now, do you believe the feature will be frozen or stable enough on v11? Thanks in advance for the answers
  • f

    fresh-doctor-14925

    10/27/2022, 11:55 AM
    Because it adds noise on an already noisy Discord, and makes it more difficult for volunteers like me to provide help effectively. If you feel your question wasn't answered in a proper way, it would be better for you to say that in the original thread. Given that it's stated in #763097415896268840 , it's already been established as a rule
  • m

    mysterious-motherboard-13344

    10/27/2022, 1:12 PM
    Hi, I have upgraded today to 10.11.0 version and trying to run regression suite in headless mode in Webkit (Safari browser). But all my tests are failing with the error `CypressError:
    cy.screenshot()
    timed out waiting
    30000ms
    to complete.`
    • 1
    • 1
  • g

    gray-kilobyte-89541

    10/27/2022, 1:29 PM
    https://cypress.tips/courses/network-testing will probably answer all your questions (paid course)
  • s

    stale-optician-85950

    10/27/2022, 1:35 PM
    @mysterious-motherboard-13344 You can keep an eye on Cypress Webkit's known issues here: https://github.com/cypress-io/cypress/issues?q=is%3Aissue+is%3Aopen+webkit+in%3Atitle and here https://docs.cypress.io/guides/guides/launching-browsers#Known-Issues-with-experimentalWebKitSupport But I'd be wary of going anywhere near it for a large-scale project while it's in experimental mode.
  • j

    jolly-toddler-60878

    10/27/2022, 2:02 PM
    Hello! I'm trying to upgrade from Cypress 10.2.0 -> 10.11.0. However, when running tests, I run into this error:
    Copy code
    stderr: node:internal/modules/cjs/loader:959
      throw err;
      ^
    
    Error: Cannot find module '"/Users/kenwilde/Library/Caches/Cypress/10.11.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/register_ts_node.js"'
    The issue here is that the path to this module is enclosed in 2 sets of quotes, a string within a string. After rolling back every version from 10.11.0 -> 10.3.0 to see which release introduced this local breaking change, I noticed in 10.3.0, there was this change introduced to address a windows issue with path resolution: https://github.com/cypress-io/cypress/pull/22550/files#diff-b0bd90502ad464c0d541a0e47822d15fec9ba5434dc4225d2993305e1ec7d30a
    packages/data-context/src/data/ProjectConfigIpc.ts
    - L:295. These double quotes are injected and the loader cannot find the module. To see if this was the issue, I removed these double quotes and my tests ran fine. I'm not sure if this is a bug, as it hasn't been brought up in Issues since the release in late June. So perhaps there's something I can do locally or any suggestions, maybe it is a bug and I'd be happy to open an Issue so its documented. Just a bit about my environment, let me know if there's more information I can provide: Cypress Version: 10.3.0 Node: 16.17.1 CommonJS OS: Mac OS Monterrey Test is an E2E test running in Chrome.
  • f

    fresh-doctor-14925

    10/27/2022, 2:03 PM
    Nice investigation! To prevent this info from getting lost (this Discord gets quite busy), I suggest raising an issue on the Cypress GitHub
  • j

    jolly-toddler-60878

    10/27/2022, 2:05 PM
    Thanks Liam, will do!
  • w

    witty-planet-12434

    10/27/2022, 6:48 PM
    Hello, I'm using web socket in my application but
    cy.intercept()
    isn't intercepting WS requests...can anyone please help? how can we intercept WS requests in cypress.
  • s

    stale-optician-85950

    10/27/2022, 7:05 PM
    I've not had to do what you are asking, but have read this technique from Gleb https://glebbahmutov.com/blog/test-socketio-chat-using-cypress/#sending-events-from-the-test or tried this plugin https://github.com/lensesio/cypress-websocket-testing
  • f

    freezing-hydrogen-55479

    10/27/2022, 10:17 PM
    Hello, I'm trying to using Test Driven Development using Cypress on a React Ecommerce App. I was wondering if it was best to test a shopping cart page (page with the items overview) via a e2e test, or via a component test for things like the incrementer and decrementer on the shopping cart page. My main point of confusion stems from the fact I would have to have items in the shopping cart to test the shopping cart functionality. I can understand how the flow of an e2e test would allow for that to happen(Click on item --> go to item page --> click add to cart --> go to shopping cart ---> test cart functionality etc..). When it comes to the stand alone component (ShoppingCart), testing isn't as clear as the component doesn't yet have the item from the store to test on (meaning I can't increment or decrement without an item in the cart). I've seen this article: https://docs.cypress.io/guides/component-testing/testing-react#What-Else-Should-You-Test-in-This-Component with the stepper example and the initial state, but the data of a cart item is a bit more complex. Would I use something like that initial state to mimic the presence of an item in the cart? Any guidance would be appreciated, Cheers
  • l

    lemon-animal-16490

    10/28/2022, 4:49 AM
    how to prevent retry after have uncaught exception I already turn it off but Cypress still retry the test
  • h

    happy-megabyte-98400

    10/28/2022, 5:27 AM
    Hello, is it possible to wait for multiple intercepts of the same endpoint? IK we can call
    cy.wait()
    however many time we wanna wait but the no. of requests is dynamic.
  • a

    agreeable-doctor-59104

    10/28/2022, 6:24 AM
    #763105090679865354 #755913900024791046 We are trying test one sample application where when use cy.vist('appurl'), it redirects to another domain(single sign on to organization domain), but its giving timeout when trying from cypress. Login works fine if we manually hit application url from browser. Could anyone guide us how to handle such login scenario in cypress. Do we need to enable any settings for this to allow this url in cypress?
  • s

    stale-optician-85950

    10/28/2022, 7:38 AM
    You are looking for
    cy.origin()
    https://docs.cypress.io/api/commands/origin to allow cross-domain testing.
  • b

    brainy-ability-43194

    10/28/2022, 8:10 AM
    Hello, I have installed cypress using "npm install cypress" command and later I opened cypress using "npx cypress open" command but what am observing is the cypress window is opened fine but it opened with blank window. Any idea why its happening like that?
  • f

    flaky-horse-36126

    10/28/2022, 8:24 AM
    Hello, I want to integrate self managed gitlab with cypress dashboard. I have gone through some documents and it sounds to me like they provide runners, like executors where the code will run. The actual test code. If that is the case, how can they communicate with the build we are trying to test? That is not exposed on the internet. Since, we need to send traffic to cypress dashboard to run tests in parallel.
  • a

    agreeable-doctor-59104

    10/28/2022, 8:26 AM
    Thanks @stale-optician-85950 , I am also trying to use cy.origin() but I am getting error as 'requested string is too long'. Actually I am passing my application url in cy.origin(), and then calling Microsoft login redirect url in cy.visit(). My application behavior is when I will hit my application url, it directly redirect to microsoft authentication and once authentication is success, it redirects to my application home page. So how to handle it from cypress.
  • s

    stale-optician-85950

    10/28/2022, 8:44 AM
    I recommend you share your code and screenshots of these errors, for a better chance of getting support here. Also make sure you are on a latest version of Cypress as
    cy.origin()
    has received bug fixes in v10.9.0, v10.10.0 and v10.11.0
  • f

    flaky-horse-36126

    10/28/2022, 8:47 AM
    Did not find any document related to this on the website.
  • p

    polite-alarm-78904

    10/28/2022, 8:51 AM
    I have some tests that are failing in CI, but passing locally. It turns out all the requests being made locally goes to
    Copy code
    https://mysite
    , but in CI they are being sent to
    Copy code
    /mysite
    Since no requests are being intercepted correctly the tests fail. How can I change the request URL in CI to be the same as locally?
  • s

    stale-optician-85950

    10/28/2022, 8:56 AM
    I would start by having this conversation with your devOps team rather, and ask them why the URL Protocol is handled differently in CI. Once you know that, then consider your test code changes.
  • p

    polite-alarm-78904

    10/28/2022, 8:57 AM
    I am the devops team lol
1...189190191...252Latest