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

    gray-kilobyte-89541

    09/28/2022, 11:26 AM
    any time you get something from the page, you can use the information inside a
    cy.then
    callback. Also, you cannot create more tests when the tests are already running.
  • c

    cold-van-45410

    09/28/2022, 12:30 PM
    Why out of memory message is showing while executing script??
  • m

    mysterious-belgium-25713

    09/28/2022, 12:37 PM
    Can you provide more info like How many test are you running How long is the test Have you checked your memory when running the test Did you also try other browsers
  • m

    mysterious-account-6075

    09/28/2022, 2:03 PM
    hi! We've started working with cypress in a gitlab ci/cd but it is giving us some issues when using cypress-file-upload. Any ideas?
  • c

    cold-van-45410

    09/28/2022, 2:11 PM
    there are 10 test
  • f

    full-application-86498

    09/28/2022, 2:24 PM
    HI I'm trying if I can use cypress to test our project and faced the problem. I'm trying to log in like this:
    Copy code
    describe('Loggin in ', () => {
          it('login user', () => {
          cy.visit ('/');
          cy.wait(30000);
          Cypress.Commands.add('typeLogin', (user) => {
            // search element by attribute name and value
            cy.get('[name="login_name"]').type(user.name);
            cy.get('[name="login_password"]').type(user.password);
    })
           cy.typeLogin({ name: '2222', password: '3333' })
           cy.get('[akid="FormLoginAD-login_save"]').click();
           cy.wait(15000);
        })
    but browser (chrome) under cypress control gets 401 response like not authorized for some requests and 1 request doesn't get response at all. Of course if I'm doing the same without cypress all works as expected.
  • f

    full-application-86498

    09/28/2022, 2:28 PM
    Any assumption what's my be the reason?
  • p

    proud-breakfast-29892

    09/28/2022, 2:30 PM
    You add the cypress commands in the designated commands file, not in your test
  • p

    proud-breakfast-29892

    09/28/2022, 2:31 PM
    Try to add it there and try again
  • f

    full-application-86498

    09/28/2022, 2:39 PM
    I moved cypress.command.add block to commands.js and run again but no difference
  • f

    full-application-86498

    09/28/2022, 2:41 PM
    my assumption that something wrong with session but have no idea what to do
  • m

    melodic-egg-83620

    09/28/2022, 2:45 PM
    How do you enable ES2020 syntax in Cypress tests and any files imported into a Cypress spec?
  • p

    polite-salesclerk-28948

    09/28/2022, 2:48 PM
    need some basic info, my test are so flaky. mostly tests are failing while trying to identify the elements. Is there a way to reduce it
  • f

    full-application-86498

    09/28/2022, 2:51 PM
    I didn't How can I enable it?
  • m

    melodic-egg-83620

    09/28/2022, 2:52 PM
    I was asking for help, not answering whatever you're working on.
  • b

    brief-agent-34897

    09/28/2022, 2:56 PM
    Hi all. I'm about to give up in frustration and try a different framework, I use Cypress for end to end testing on my app while it's running on localhost and I like it for that. I was trying to use it now to write a 'synthetic check' app that goes to my website on the internet, and clicks some things to check its behaving as expected. Unfortunately I've got a corporate proxy in the way. A
    curl
    of my app from CI (has the proxy) responds exactly as I'd expect it to, and the cypress test that just does cy.visit('') runs fine locally (no proxy). Unfortunately behind the corporate proxy (on CI) I just get this, and a 60 second timeout. Does anyone have any idea, any at all what I might be missing?
  • b

    brief-agent-34897

    09/28/2022, 2:57 PM
    It's really hard because I don't have any error information to act on, i can't connect to CI to look at dev tools and Cypress doesn't seem to output anything useful
  • m

    mysterious-belgium-25713

    09/28/2022, 3:00 PM
    Does your CI give you a fail log like a 404 error or unable to connect please setup a proxy?
  • b

    brief-agent-34897

    09/28/2022, 3:01 PM
    no nothing - that's all i get from cypress, and this timeout:
    Copy code
    CypressError: Timed out after waiting `60000ms` for your remote page to load.
    Your page did not fire its `load` event within `60000ms`.
    You can try increasing the `pageLoadTimeout` value in `cypress.config.js` to wait longer.
    Browsers will not fire the `load` event until all stylesheets and scripts are done downloading.
    When this `load` event occurs, Cypress will continue running commands.
          at timedOutWaitingForPageLoad (https://sandbox.myapp.com/__cypress/runner/cypress_runner.js:140945:74)
          at <unknown> (https://sandbox.myapp.com/__cypress/runner/cypress_runner.js:141377:16)
          at tryCatcher (https://sandbox.myapp.com/__cypress/runner/cypress_runner.js:11318:23)
          at <unknown> (https://sandbox.myapp.com/__cypress/runner/cypress_runner.js:6440:41)
          at tryCatcher (https://sandbox.myapp.com/__cypress/runner/cypress_runner.js:11318:23)
    (there's a bit more stacktrace below this, starts in bluebird)
  • m

    mysterious-belgium-25713

    09/28/2022, 3:01 PM
    And if you do know your CI proxy settings then what i do at my company is use the HTTPS_PROXY=http://myproxy:8080 npx cypress run and this resolves my proxy settings.
  • b

    brief-agent-34897

    09/28/2022, 3:03 PM
    The proxy's actually an nginx doing proxy_pass and it's configured by adding hosts entries to /etc/hosts that point to the nginx instance (which effectively pretends to be the host you're trying to contact)
  • b

    brief-agent-34897

    09/28/2022, 3:07 PM
    the cypress check to verify the baseurl is up works also, i.e. i don't see:
    Copy code
    Cypress could not verify that this server is running:
      > https://sandbox.myapp.com
    We are verifying this server because it has been configured as your baseUrl.
    Cypress automatically waits until your server is accessible before running tests.
  • b

    brief-agent-34897

    09/28/2022, 3:07 PM
    So I guess it's something about how the cypress proxy server insinuates itself, but I can't imagine what
  • m

    mysterious-belgium-25713

    09/28/2022, 3:37 PM
    So on the CI runner there is an NGINX server that has a proxy pass that edits etc/hosts to the app that is running somewhere else. Do i understand that correctly.
  • b

    brief-agent-34897

    09/28/2022, 3:38 PM
    Sure the CI runner talks to an nginx server that proxy pass'es to the target hostname, if the nginx server is on 1.1.1.1 and i'm testing sandbox.myapp.com i'd have an /etc/hosts entry like 1.1.1.1 sandbox.myapp.com
  • b

    brief-agent-34897

    09/28/2022, 3:38 PM
    Slightly unusual I know, maybe i've only got myself to blame - but I what I keep coming back to is that
    curl
    works fine
  • f

    full-application-86498

    09/28/2022, 3:40 PM
    I've enabled all things you asked like this
  • w

    witty-air-21210

    09/28/2022, 3:41 PM
    We have a react app that we are e2e testing with cypress on circleci. When a test fails we would like to save our redux state to a file so we can save it as an artifact within the CI pipeline. Is there a global way to do afterEach?
  • g

    gray-kilobyte-89541

    09/28/2022, 4:32 PM
    https://on.cypress.io/proxy-configuration
  • g

    gray-kilobyte-89541

    09/28/2022, 4:32 PM
    can you access your redux store from the test?
1...108109110...192Latest