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

    fresh-doctor-14925

    08/16/2022, 8:02 AM
    I don't think so. Does your
    loginHandler
    use
    cy.type
    ?
  • e

    early-computer-34425

    08/16/2022, 8:15 AM
    ok, yes, found where the problem might be
  • b

    brash-tiger-52405

    08/16/2022, 10:32 AM
    Hello all, can anyone tell me what this is exactly doing: cy.get('[data-testid="accordion"]').should('not.have.css', 'display', 'none')
  • s

    stale-energy-2535

    08/16/2022, 10:38 AM
    Hello everyone, I have a question about autogenerating Typescript types for custom commands. Here is the question on stack overflow: https://stackoverflow.com/questions/73371711/autogenerate-typescript-types-for-cypress-custom-commands
  • m

    microscopic-easter-76359

    08/16/2022, 12:22 PM
    Hey all, I'm trying to get the new component testing functionality in v10 but have been struggling for a while. The react never seems to be imported correctly and I don't really understand what the we pack-preprocessor does (where does the generated umd go?) Does anyone have any good examples of a project that uses react + ts + webpack + component tests?
  • p

    plain-pencil-72796

    08/16/2022, 1:26 PM
    Does anyone understand why GitHub run keeps failing? What am I missing herE?
  • p

    plain-pencil-72796

    08/16/2022, 1:34 PM
    My GitHub keeps exiting with 404 code. anyone know how should i approach it?
  • p

    powerful-orange-86819

    08/16/2022, 3:14 PM
    Has anyone got file upload of blob through an API ?
  • a

    acceptable-hamburger-48790

    08/16/2022, 3:17 PM
    @magnificent-finland-58048 Has done this https://github.com/muratkeremozcan/cypress-react-component-test-examples/tree/master/src You can thank him
  • m

    microscopic-easter-76359

    08/16/2022, 3:24 PM
    Thanks @acceptable-hamburger-48790 & @magnificent-finland-58048 for the resource. It’s a good reference I’ll take a look, however it seems to rely on create react app whereas I need to configure webpack and such manually and I think that’s where the troubles coming from
  • a

    acceptable-hamburger-48790

    08/16/2022, 3:25 PM
    #763070261720645642 has few references, do checkout in that group
  • m

    microscopic-easter-76359

    08/16/2022, 3:26 PM
    thanks I’ll have a look now 👍🙏
  • f

    freezing-hydrogen-55479

    08/16/2022, 4:23 PM
    Hey all! First time poster here. I'm new to TDD in React js using Cypress and was wondering if someone could help me out with an error. I'm trying to write a failing test where an image with an onClick attribute would fire the handleClick function passed to it when clicked. This is my it block.
    Copy code
    js
    it('Tshirt should support onClick', () => {
            cy.mount(<ProductBox/>)
            const handleClickSpy = cy.spy().as('handleClickSpy')
            cy.mount(<img data-test='grey-tshirt-image' alt="" onClick={handleClickSpy}/>)
            cy.get("[data-test='grey-tshirt-image']").click();
            cy.get('@handleClickSpy').should('have.been.called')
        })
    but this is the error I get
  • f

    fresh-doctor-14925

    08/16/2022, 4:26 PM
    Did you try adding
    {force: true}
    ?
  • f

    freezing-hydrogen-55479

    08/16/2022, 4:30 PM
    I thought that {force: true} would essentially disable the test functionality for this test, rather than solving the underlying issue, which I thought might be the image rendering after the function has run.
  • f

    freezing-hydrogen-55479

    08/16/2022, 4:31 PM
    I could be wrong though
  • g

    gray-kilobyte-89541

    08/16/2022, 4:55 PM
    you are mounting an image without a source, so there is nothing on the page, right?
  • f

    freezing-hydrogen-55479

    08/16/2022, 4:58 PM
    Right now nothing is rendering in the cypress chrome window, but I did add the image to my React component, which is why I'm wondering why my test is failing.
  • u

    user

    08/16/2022, 5:02 PM
    Hey all! First time here. I'm creating a proof of concept for my company, and have a couple of questions around security because I'm having a hard time understanding how cypress works under the hood. We're considering adding cypress to a CI/CD pipeline, where we run our entire application (three repo's) in multiple docker-containers via a docker-compose file. We're wondering if this would be possible, and Cypress is completely contained within the docker containers, or if cypress is somehow reaching out to its own server to run. ie: is this completely self-contained from a security standpoint, and if I wanted to, could I run cypress in a docker-container with sensitive information and still be assured that Cypress wasn't contacting something outside of said container? Also, is there any documentation that backs this up? Thank you so much for your help!
  • g

    gray-kilobyte-89541

    08/16/2022, 5:31 PM
    you are mounting an empty
    img
    from what I see, so it renders nothing
  • f

    freezing-hydrogen-55479

    08/16/2022, 5:42 PM
    If I understand you correctly you are referring to the fact that I don't have a
    src
    attribute in my
    cy.mount(<img data-test='grey-tshirt-image' alt="" onClick={handleClickSpy}/>)
    . But I do have the attribute data-test which I added to my image when I imported it to my react component. Please excuse me if I'm missing something elementary here. I'm pretty new to TDD. Are you saying that I should not use mount here?
  • g

    gray-kilobyte-89541

    08/16/2022, 5:44 PM
    data-test does not "create" an image. Your HTML img element has nothing to show, so it is 0x0 pixels, like the error says, thus Cypress refuses to click on it - just like the real user would not be able to click on such element. Read https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Actionability
  • c

    clever-father-23857

    08/16/2022, 6:43 PM
    Hi guys, so im starting to work with component testing (angular) and im trying to setup the configuration. What is happening is that, our frontend project is divided in micro frontends, and it is using a build system (Nx) to have micro frontends with a monorepo. The thing is, the repo has a structure with a nx.json file on the project root and a folder apps that inside has folders dividing the micro frontends, each micro fe as a project.json inside its folder, json files similar to angular.json When trying to setup component testing on any of those micro frontend folders, when initializing config, it returns "Error: Could not find angular.json." In fact that file does not exist, it is called project.json, after a few tries, i even tried to change the name of the file on findUP on angularHandle.js from angular.js to project.js (const angularJsonPath = await findUp('angular.json', { cwd: projectRoot });) but it comes out with other error "TypeError: Cannot convert undefined or null to object at Function.keys ()" Am i missing something, or is there any way to turn around this?
  • a

    ancient-whale-60628

    08/16/2022, 7:09 PM
    Just upgraded to Cypress version 10 (10.5.0 actually). I work out of IntelliJ. After upgrading when I launch a test in intelliJ, i get this message: "ReferenceError: Cypress is not defined" When I look at the IntelliJ configuration for the test, it is of type "Mocha". I've search around and can't find out how to re-associate the .js/Cypress test files to the Cypress configuration type in IntelliJ. Has anyone else run into this yet? Thanks! Kent.
  • i

    incalculable-pager-85339

    08/16/2022, 7:37 PM
    Has anyone tried adding testrails new TRCLI tool to the cypress base docker image?
  • s

    strong-energy-6158

    08/17/2022, 5:06 AM
    Hi, I have a doubt in cypress 10.3.0. I have migrated my suite recently. It uses cucumber. The migrated suite works fine but the step_definition file is under the support folder. I want to bring it under the e2e folder (the feature folder is under e2e already). What changes I should make for it?
  • e

    elegant-river-87347

    08/17/2022, 7:52 AM
    helo everyone, can anybody help me how i can visit link that i copy from a button .. something like this : cy.get('.order-link-add-button') .click({ force: true }) .then(($e) => cy.visit($e); //open link });
  • f

    faint-tiger-98881

    08/17/2022, 7:58 AM
    Hi @gray-kilobyte-89541 , I would like to recurse my request until response status will be 200 using cypress-recurse but I still getting 404 error. Do you have any suggestion for me? My sample code as below:
  • f

    faint-tiger-98881

    08/17/2022, 7:59 AM
    Copy code
    js
    recurse(
          () => cy.get('@foo').its('status'),
          (status) => status === 200, {
              log: true,
              limit: 10,
              timeout: 30000,
              delay: 1000,
          },
      )
  • f

    flaky-airport-12178

    08/17/2022, 8:10 AM
    Hi team, Do you know how to handle the upload without input html tag?
1...128129130...252Latest