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

    magnificent-rose-67179

    10/20/2021, 7:27 AM
    The weirdest thing is that our component tests are working fine
  • m

    magnificent-rose-67179

    10/20/2021, 7:28 AM
    but the e2e tests (we only have 5) are crashing the memory
  • m

    magnificent-rose-67179

    10/20/2021, 7:28 AM
    there wasn't any issue with the version 8.4.1 (now in 8.6.0)
  • m

    magnificent-rose-67179

    10/20/2021, 7:28 AM
    The e2e tests are working fine in local
  • m

    magnificent-rose-67179

    10/20/2021, 7:28 AM
    it only crash in github action
  • f

    fancy-airplane-60156

    10/20/2021, 11:21 AM
    My API GET request fails with an error - "x-amzn-errortype": "AccessDeniedException", Body: { "message": "User is not authorized to access this resource with an explicit deny" }
  • f

    fancy-airplane-60156

    10/20/2021, 11:22 AM
    Same API's with same bearer token run succesfully on Postman.
  • f

    fancy-airplane-60156

    10/20/2021, 11:22 AM
    Should we have to register Cypress as an authorized application or something for API to respond
  • f

    fancy-airplane-60156

    10/20/2021, 11:22 AM
    even cURL command works and 200 error is returned
  • b

    billions-helmet-46095

    10/20/2021, 10:04 PM
    Hi all! New here. I'm attempting to intercept and stub a request which is the result of a click event (it's a download link) using
    cy.intercept
    , but it won't work. Any thoughts on what I'm doing wrong?
  • b

    billions-helmet-46095

    10/20/2021, 10:06 PM
    Simplified example of code:
    Copy code
    beforeEach(() => {
        cy.intercept(`https://example-downloads.com*`, {
            statusCode: 200,
            body: {
                message: "success"
            }
        });
    });
    describe("Download button functionality - Windows", () => {
        it("Visit example.com", () => {
            cy.visit("/", {
                onBeforeLoad: win => {
                    Object.defineProperty(win.navigator, 'userAgent', {
                        value: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
                    });
                }
            });
    
            cy.get("#download-button-hero")
                .should("be.visible")
                .click()
                .url()
                .should("eq", `https://example-downloads.com/latest/winx64`)
        })
    });
  • b

    billions-helmet-46095

    10/20/2021, 10:08 PM
    The following works:
    Copy code
    describe("Download button functionality - Windows", () => {
        it("Visit example.com", () => {
            cy.request(`https://example-downloads.com/latest/winx64`)
        })
    });
  • b

    billions-helmet-46095

    10/20/2021, 10:39 PM
    Resolved: my pattern wasn't inclusive enough.
  • u

    user

    10/26/2021, 12:30 AM
    Hey so you know how cypress creates it's own folder in the root directory of a project? I am trying to call the test function from another typescript code but it gives an error saying it does not recognize the command 'cy'
  • t

    tall-area-9998

    10/26/2021, 8:46 PM
    I don't understand
    i am trying to call the test function firm another typescript code
  • u

    user

    10/26/2021, 8:47 PM
    sorry that was a little unclear. I'll send screenshots
  • u

    user

    10/26/2021, 8:49 PM
    as you can see over here I am trying to import the spec.ts file from cypress and call the test function
  • u

    user

    10/26/2021, 8:49 PM
    This is all in typescript
  • u

    user

    10/26/2021, 8:50 PM
    this is the function that i have in my spec.ts file
  • u

    user

    10/26/2021, 8:51 PM
    when I run this, it gives error command cy not recognized
  • t

    tall-area-9998

    10/26/2021, 8:53 PM
    To be honest, I haven't seen e2e implemted like this. I just create a spec file in a folder under integration for the section of my app that I want to test and then write my test suites then run them
  • u

    user

    10/26/2021, 8:58 PM
    Got it....but do you know of a way to successfully implement it this way?
  • t

    tall-area-9998

    10/26/2021, 9:31 PM
    No idea
  • u

    user

    10/26/2021, 10:11 PM
    Ok thanks though
  • g

    glamorous-monkey-67605

    10/27/2021, 2:47 AM
    I don't think you can export Cypress test functions like that.
  • g

    glamorous-monkey-67605

    10/27/2021, 2:48 AM
    1. These tests run asynchronously and only through the Cypress framework that can execute them. Your typescript code/program cannot. 2. Your program is also missing how to invoke the global 'cy' object into this file because it comes from Cypress modules.
  • m

    magnificent-rose-67179

    10/27/2021, 1:45 PM
    Hello all, I have a classic "submit form" + "snackbar success" workflow to test in a e2e test. I'm using cypress-testing-library to ease the API a bit.
  • m

    magnificent-rose-67179

    10/27/2021, 1:46 PM
    I'm not able to detect my snackbar once the form has been submitted
  • m

    magnificent-rose-67179

    10/27/2021, 1:46 PM
    Copy code
    ts
     // submit project
          cy.findByRole("button", { name: /create new project/i }).click();
    
          cy.wait("@createProject");
    
          // toast feedback
          cy.waitUntil(() =>
            cy
              .findByRole("status", {
                name: /your project has been created/i,
              })
              .should("exist")
          );
  • m

    magnificent-rose-67179

    10/27/2021, 1:46 PM
    I'm basically here ^^'
1...252627...192Latest