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

    wonderful-match-15836

    07/27/2022, 8:54 PM
    Test Runner not showing in Chrome ยท Issu...
  • a

    abundant-eve-90571

    07/28/2022, 1:05 AM
    Hi, anyone knows how to allow only image upload in a cypress test? i saw cypress-file-upload lib and it has attachfile function where we can specify file type in mimeType, but i want to allow any kind of image file, not just one type like it should support jpg, png, etc, any clues on this would be nice, thanks
  • h

    helpful-whale-51255

    07/28/2022, 8:08 AM
    Hello, I'm trying to upgrade Cypress to version 10.3.1 from 9.6.1 and I'm having a trouble with cypress-grep plugin integration. I described the problem to this issue https://github.com/cypress-io/cypress-grep/issues/139 Thank you in advance for any help ๐Ÿ™‚
  • a

    agreeable-painting-90494

    07/28/2022, 8:12 AM
    Hi Folks, has there been a change around selector matching recently? I have some selectors for cy.get that no longer work with admittedly dodgy ids
  • a

    agreeable-painting-90494

    07/28/2022, 8:14 AM
    I'm using
    cy.get('[id^="\\~C1-0"]')
    to match an element with
    id="~C1-0.0"
    h
    • 2
    • 9
  • a

    agreeable-painting-90494

    07/28/2022, 8:14 AM
    it used to work, but now it doesn't
  • a

    agreeable-painting-90494

    07/28/2022, 8:17 AM
    Strangely jquery $(...) can find it
  • h

    handsome-lion-1748

    07/28/2022, 11:09 AM
    Maybe something is wrong in your config? What was your reference in setup? I used
    esbuild
    example from here: https://github.com/badeball/cypress-cucumber-preprocessor/tree/master/examples and the dummy tests worked.
  • h

    handsome-lion-1748

    07/28/2022, 11:22 AM
    I m using
    cy get id ~C1 0
    to match an
  • e

    enough-author-35578

    07/28/2022, 2:01 PM
    Having some trouble upgrading some of my component tests to cy10 I have a
    Table
    component with sorting functionality. I also have component tests that verify that pressing the sort button of a column actually sorts that column properly. I had this working in an older version where I used
    render
    and
    renderHook
    from
    @testing-library/react
    and
    @testing-library/react-hooks
    respectively. I could manage the sorting state in my test using that
    renderHook
    , and re-render the Table component after updating said sorting state. However, now I am now using Cypress'
    mount
    from
    cypress/react
    instead of that
    render
    fn, and this
    mount
    fn doesn't seem to provide a way to allow me to **re**render my component after updating the state. Is there a way to rerender (or i guess re**mount**) components using Cypress'
    mount
    that I am missing, or how should I go about fixing this?
  • g

    glamorous-belgium-42380

    07/28/2022, 3:12 PM
    Hi Community, I recently joined this community. I am from FM Global. It is a commercial property insurance company. Our company has adapted Cypress as a primary automation tool. We are looking forward to leverage the great abilities and features that this tool provide. We are relatively new to this tool. We are running into a peculiar issue. Thought I would describe the same here. Hoping to get help from this great community. We are running into a peculiar issue where our Cypress test is not able to load an application URL for the first time. When in Dashboard when I retry it works. Again the working of retry is also not consistent. This issue do not exist in in one of our developer machine however we are seeing this issue on many other developers machine. Our developer machines are spread across Azure VM, VDI, and physical machines in a datacenters. We are still working on troubleshooting the issue by engaging an expert developer within organization who can look at traffic and the network all the way to the server to find out root cause of the issue. While we are still investigating the issue at our end; I thought I will describe our issue here too to see if you guys have any ideas and know of any possible cause of the issue
    s
    • 2
    • 5
  • w

    wooden-teacher-96595

    07/28/2022, 3:23 PM
    So I am trying to verify that an intercept returns a specific status code in the response. Now the response is coming back as an object and I can see the desired status code inside yet my assertions keep giving one form of error or another. Do I need to somehow convert the object or use a specific '**Should**' command for it?
  • f

    famous-restaurant-30435

    07/28/2022, 3:25 PM
    The response always comes back as an object. Its the entire response object. Heres how I handled it https://www.capocaccia.dev/posts/quickSnippetsValidateLink
  • g

    glamorous-belgium-42380

    07/28/2022, 3:25 PM
    Page not loading first time, works when retried
  • w

    wooden-teacher-96595

    07/28/2022, 3:27 PM
    cheers I actually did try something similar but started getting webpack errors and didn't feel like handling them ๐Ÿ˜… . Yet thanks I will give it another try! ๐Ÿ™‚
  • f

    famous-restaurant-30435

    07/28/2022, 3:27 PM
    Ya let me know what you find! Happy to help again if this doesnt work.
  • w

    wooden-teacher-96595

    07/28/2022, 3:27 PM
    cheers and will do ๐Ÿ™‚
  • l

    late-house-1562

    07/29/2022, 12:54 AM
    Not sure why, but this error just popped up. I've been using Cypress for a couple of projects without the issue:
    Copy code
    sh
    Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.ts(2584)
    I added
    "lib": ["DOM"],
    to my
    tsconfig.json
    in my Cypress folder but that doesn't resolve the TS error.
  • s

    some-angle-80895

    07/29/2022, 7:03 AM
    Hello guys, i am struggling to create custom command in my project but i am not able to do it.... tried to find something on google but nothing..... in the screen capture you can see the error that i have...
  • p

    purple-afternoon-2408

    07/29/2022, 7:47 AM
    Hello team, is this https://docs.cypress.io/api/cypress-api/custom-commands#Overwrite-type-command outdated?
  • w

    wooden-teacher-96595

    07/29/2022, 7:55 AM
    so I finally managed to make it work using this workaround. My issue was to verify that the right status code was sent without actually testing the request itself (basically verifying the DOM shows a 401
    Copy code
    cy.intercept('POST', '*/sessions').as('login')
            cy.get('@login').then(login => {
                expect(JSON.stringify(login)).to.deep.contain(401)
  • w

    wooden-teacher-96595

    07/29/2022, 7:56 AM
    had to the Object as for some reason it expects an object but didn't accept this object (could be cause it was a circular one)
  • a

    acceptable-hamburger-48790

    07/29/2022, 8:22 AM
    The correct way to use is expect(login.status).to.be.eq(401)
  • w

    wooden-teacher-96595

    07/29/2022, 8:25 AM
    yeah I was trying that and it was failing but I realised something when looking at the actual response that there was another object holding the statusCode inside
    Copy code
    cy.get('@login').then(login => {
    expect(login.response.statusCode).to.be.eq(401)
  • w

    wooden-teacher-96595

    07/29/2022, 8:25 AM
    The above worked ๐Ÿ˜„
  • p

    purple-afternoon-2408

    07/29/2022, 9:44 AM
    I have functions defined in
    index.ts
    as this:
    closeToast(force?: boolean): Chainable<JQuery<HTMLElement>>;
    There is no error on
    JQuery
    , but when running eslint, I get
    error  'JQuery' is not defined       no-undef
  • p

    purple-afternoon-2408

    07/29/2022, 9:45 AM
    I added rule
    "no-undef": "off"
    but it's not working.
  • p

    purple-afternoon-2408

    07/29/2022, 9:46 AM
    I added types to tsconfig like this
    "types": ["cypress", "@types/node", "@types/jquery", "jquery", "@types/jqueryui"],
    but it's not helping.
  • p

    purple-afternoon-2408

    07/29/2022, 9:46 AM
    Not sure what am I missing here
  • p

    purple-afternoon-2408

    07/29/2022, 9:48 AM
    I followed this https://docs.cypress.io/guides/tooling/typescript-support#Types-for-Custom-Commands
1...116117118...252Latest