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

    gorgeous-forest-81700

    11/23/2022, 12:39 PM
    Hi guys, I have an issue with a test which have a lot (over 900) of requests in it and it drops on "We detected that the Chromium Renderer process just crashed." Using Cy 10.0.7 with Ts browser Electron I think it's caused by default browser memory threshold as it is only 2GB, is there a way how to increase that?
  • f

    fresh-doctor-14925

    11/23/2022, 12:46 PM
    !duplicate
  • n

    nutritious-analyst-96582

    11/23/2022, 12:46 PM
    Uh oh, It looks like you have posted the same question in multiple channels. Help us prevent spam by removing any duplicates of your questions, Thanks! 😀
  • f

    fresh-doctor-14925

    11/23/2022, 1:00 PM
    Looking on stack overflow, it looks like some have had success with running chrome in headless mode instead of electron Otherwise, it might be worth updating to a newer version of cypress; there's been a few electron updates since that version
  • g

    gorgeous-forest-81700

    11/23/2022, 1:18 PM
    yeah that's next thing I want to try, I found that some ppl succeded with --disable-dev-shm-usage helped
  • f

    fresh-doctor-14925

    11/23/2022, 1:21 PM
    If you're able to provide a link to the application and the spec, it may be useful for the cypress team to see it. They're looking into how to make the memory/cpu usage more efficient
  • g

    gorgeous-forest-81700

    11/23/2022, 1:28 PM
    Well I can't exactly because data used are from our Elastic, but I can create some dummy spec with same context
  • f

    fresh-doctor-14925

    11/23/2022, 1:31 PM
    Yeah, it's more if it recreates the 900 request situation
  • m

    modern-application-38224

    11/23/2022, 4:36 PM
    Hi everyone, ✌️ I'm currently running into an issue (v11.x) now that I switched to using session. The session login is in a beforeEach followed by several tests. However, the first test always fails but every subsequent test passes. I can change the order of the tests but it always fails on the first test. If I run all tests again where the session already exists and is restored all tests pass. Could it be that the redirect after login causes some cross-origin issues?
  • f

    fresh-doctor-14925

    11/23/2022, 6:04 PM
    Could be, but it'll be easier to know for sure if you're able to share a screenshot of the error
  • e

    enough-fireman-4779

    11/23/2022, 6:11 PM
    hello, is there any way to run specific specs through github actions?
  • f

    fresh-doctor-14925

    11/23/2022, 6:11 PM
    Use the
    --spec
    argument on your run command
  • e

    enough-fireman-4779

    11/23/2022, 6:12 PM
    Copy code
    - name: Cypress run
            uses: cypress-io/github-action@v4
            with:
              browser: chrome
    here?
  • f

    fresh-doctor-14925

    11/23/2022, 6:14 PM
    No, I was thinking in your
    package.json
    , but I'll be honest I haven't used the cypress-provided github action
  • e

    enough-fireman-4779

    11/23/2022, 6:22 PM
    hmm okay, thank you!
  • m

    mysterious-belgium-25713

    11/23/2022, 6:33 PM
    You can use
    Copy code
    yaml
          - name: Cypress run
            uses: cypress-io/github-action@v4
            with:
              spec: cypress/integration/spec1.js
    or
    Copy code
    yaml
          - name: Cypress run
            uses: cypress-io/github-action@v4
            with:
              spec: |
                 cypress/integration/spec-a.js
                 cypress/**/*-b.js
  • e

    enough-fireman-4779

    11/23/2022, 6:56 PM
    thank you so much!!!
  • t

    thousands-angle-35788

    11/23/2022, 11:01 PM
    Hello, I'm struggling with intercepting a POST, I hope somebody can help me see what I am doing wrong. I have an API call (POST) that I want to make sure completes before the script continues. This call is executed in a beforeEach and I noticed that the test already starts running before this API call is completed, which sometimes leads to a failure. So I wanted to cy.wait() for it. I got it to work partially, but the following example also catches a GET on the same endpoint, and I only want it to intercept POST:
    Copy code
    export function postRequest() {
      const endpoint = '/some/path';
      const url = `http://example.com${endpoint}`;
      const alias = 'postRequest';
    
      const params = {
        method: 'POST',
        url: url,
        body: createJsonBody(),
      };
    
      cy.intercept(url).as(alias);
      cy.request(params);
      cy.wait(`@${alias}`);
    }
    I would expect this variation to work, but it doesn't intercept this request
    Copy code
    export function postRequest() {
      const endpoint = '/some/path';
      const url = `http://example.com${endpoint}`;
      const alias = 'postRequest';
    
      const params = {
        method: 'POST',
        url: url,
        body: createJsonBody(),
      };
    
      cy.intercept({ method: 'POST', url: url }).as(alias);
      cy.request(params);
      cy.wait(`@${alias}`);
    }
    I have also tried these variations, they all do not intercept the request:
    Copy code
    cy.intercept('POST', url).as(alias);
    cy.intercept('POST', endpoint).as(alias);
    cy.intercept('POST', `**${endpoint}`).as(alias);
    cy.intercept({ method: 'POST', path: endpoint}).as(alias);
    cy.intercept({ method: 'POST', path: url}).as(alias);
    cy.intercept({ method: 'POST', path: `**${endpoint}`}).as(alias);
    
    cy.intercept(url, (req) => {
        if (req.method === 'POST') {
          req.alias = alias;
        }
    });
    Also tried with a lowercase alias, since I read somewhere that was a known issue. This GET intercept works fine (but ofcourse only on the GET):
    cy.intercept('GET', endpoint).as(alias);
  • m

    miniature-animal-96670

    11/23/2022, 11:26 PM
    Hi, Any great links which refers to testing Calendar (MMMM, YYYY) ? I want to select different months from Past or future and current month of the year in Cypress. Thank you 🙂
  • g

    great-oil-15113

    11/24/2022, 12:26 AM
    hi is there a way to test that a click on a button should copy a value to clipboard with cypress?
  • b

    bitter-fountain-36713

    11/24/2022, 4:04 AM
    spy on cy.request()
  • p

    powerful-journalist-49461

    11/24/2022, 8:16 AM
    I'm trying to compare two contents, but I have error because cypress is reading as text, so if you have something like this Some title dummy text and if you have assertions for eg. cy.get('[data-testid="content"]').should('contain.text', 'Some title dummy text'); }); You will get error I already tried the following: should(have.text, 'Some title dummy text'), (include.text, 'Some title dummy text') and cy.get('[data-testid="content"]').contains('Some title dummy text') >>>>>>>>>is someone has solution for this?>>>>>>>>>
  • p

    powerful-journalist-49461

    11/24/2022, 8:24 AM
    https://www.udemy.com/course/cypress-web-automation-testing-from-zero-to-hero/ hey @miniature-animal-96670 in this course you have 1 video with very good explanation for it
  • m

    modern-application-38224

    11/24/2022, 8:27 AM
    not much to see there, I get a 401 response from the backend saying unauthorized for all requests from backend
  • m

    modern-application-38224

    11/24/2022, 8:34 AM
    but as I said, the same requests work fine on a second run. And it is not a timing issue, I can add a wait after session create and still same issue. It must have to do with the redirect after login. Any ideas? I'm really stuck here for more hours than I'd like to admit
  • m

    modern-application-38224

    11/24/2022, 9:00 AM
    tests look like this
  • b

    brash-scientist-28014

    11/24/2022, 9:04 AM
    did anyone ever got this error?
  • r

    rough-petabyte-49242

    11/24/2022, 9:40 AM
    Hello. It is possible to somehow skip waiting for page to load, after Cypress test click() on download button which start download but does not redirect to other page? Cypress 10.6.0
  • f

    fresh-doctor-14925

    11/24/2022, 9:53 AM
    Hmm. And you do your authentication before then? I'm wondering if your auth logic hasn't completed before that first visit
  • b

    brash-scientist-28014

    11/24/2022, 10:00 AM
    i encountered the same behaviour for clicking a download link
1...151152153...192Latest