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

    modern-dawn-86006

    01/16/2023, 8:41 PM
    just following your teachings. I look up to you when it comes to cypress
  • d

    dazzling-salesclerk-15570

    01/16/2023, 8:43 PM
    I'll try working with a cy.request wrapper like this. Of course this won't solve all the CI issues, but let's see how it goes
    Copy code
    const requestHandler = requestOptions => {
      if (Cypress.env('CI_PIPELINE_ID') === undefined) return cy.api(requestOptions)
      return cy.request({ ...requestOptions, failOnStatusCode: false }).then(res => {
        if (String(res.status).match(/50[1-9]/g) !== null) {
          return recurse(
            () => cy.request({ ...requestOptions, failOnStatusCode: false }),
            res => String(res.status).match(/50[1-9]/g) === null,
            {
              timeout: 90000,
              delay: 5000,
              log: false,
              yield: 'value',
            }
          ).then(res => cy.wrap(res))
        }
        return cy.wrap(res)
      })
    }
  • d

    dazzling-salesclerk-15570

    01/16/2023, 8:54 PM
    Btw @gray-kilobyte-89541 Is there a way to restore the original cy.request error object and throw it if the status doesn't match?! Because for some status I'd like to see the original error log returned by the method, and it seems the function only yields
    res
    as an argument
  • s

    square-cartoon-79543

    01/16/2023, 9:24 PM
    Hello, Is there anyone who has used gmail tester in this group and was able to connect the google cloud in production?
  • g

    gray-kilobyte-89541

    01/16/2023, 10:34 PM
    but what is the original cy.request error? the first one? the last one? if this is something really problematic, I would open an issue about it in cypress-recurse repo with examples
  • d

    dazzling-salesclerk-15570

    01/16/2023, 10:35 PM
    I meant the error that cy.request throws normally if you don't treat the error in the
    then
    block. If I treat it, I know I can do something like
    throw new Error(res.body)
    , but this would not be the original error log that cy.request provides.
  • b

    better-carpenter-28878

    01/16/2023, 11:10 PM
    GitHub Action failing for me. https://github.com/BOT-TC/vue-fundamenals/actions/runs/3934576793/jobs/6729450427#step:3:46 The server starts on port 5173, but the server is watching for port 4173. Any tips?
  • b

    better-carpenter-28878

    01/16/2023, 11:22 PM
    Got it running finally, whew! https://github.com/BOT-TC/vue-fundamenals/actions/runs/3934642808
  • g

    gray-kilobyte-89541

    01/16/2023, 11:29 PM
    but there is no error from
    cy.request
    since you set the flag to not throw on failure status code
  • g

    green-controller-97889

    01/17/2023, 8:34 AM
    I did use:
    Copy code
    js
     cy.get("[data-cy='subheader']").each(subheader => {
          cy.wrap(subheader).invoke("text").should("be.oneOf", titles);
        })
    And it works.
  • l

    lively-balloon-98986

    01/17/2023, 8:39 AM
    hi , i am using cypress 12.3 why i dont see all the browsers options and only chrome and electron?
  • b

    billions-raincoat-95460

    01/17/2023, 9:26 AM
    Good morning, has anyone got an idea, how to organize my cypress repository? I would for example like to put multiple
    commands.ts
    files in subfolders. Is this even possible?
  • l

    lively-balloon-98986

    01/17/2023, 9:27 AM
    i did it - look at screenshot
  • b

    billions-raincoat-95460

    01/17/2023, 9:28 AM
    Cool, how did you make the source inside the command files available to your project?
  • h

    helpful-truck-53930

    01/17/2023, 9:41 AM
    Hello community, I have a problem with the latest version 12.3.0 of cypress and I get a Webpack Compilation Error. After a migration from old version to the new version of cypress the cypress.json would changed. I the scope of the project i have installed the Ntlm Plugin. Now iam getting this error ( see pic). It's a bit frustrating. I tried some things but it's doest work. Who have a hint for me? Maybe I can't see the wood because of all the trees. Thanks 🙏
  • l

    lively-balloon-98986

    01/17/2023, 10:55 AM
    i just defined the function in index.ts and import the file command in project where you want to use commands. in e2e.ts - also import all files command
  • b

    billions-raincoat-95460

    01/17/2023, 11:24 AM
    Alright, thank you. I got it working!
  • l

    lively-balloon-98986

    01/17/2023, 11:33 AM
    enyone?
  • t

    thousands-house-85089

    01/17/2023, 11:35 AM
    It depends what is installed on your machine
  • l

    lively-balloon-98986

    01/17/2023, 11:36 AM
    cypress 12.3 on mac
  • t

    thousands-house-85089

    01/17/2023, 11:36 AM
    since that is cypress open mode, it's using your local resources and browsers for the GUI mode, do you have other browsers installed on your OS?
  • l

    lively-balloon-98986

    01/17/2023, 11:37 AM
    i am not sure actually - good point but electron is not installed and i see it
  • t

    thousands-house-85089

    01/17/2023, 11:37 AM
    electron is bundled with Cypress
  • t

    thousands-house-85089

    01/17/2023, 11:37 AM
    the rest come from your OS
  • l

    lively-balloon-98986

    01/17/2023, 11:37 AM
    also - do you have any idea how i can allow popup in electron browser?
  • l

    lively-balloon-98986

    01/17/2023, 11:38 AM
    cool , it make sence now\
  • t

    thousands-house-85089

    01/17/2023, 11:38 AM
    what do you mean by popup? like a toast message?
  • l

    lively-balloon-98986

    01/17/2023, 11:39 AM
    in chrome new tab is opened in my test
  • l

    lively-balloon-98986

    01/17/2023, 11:39 AM
    here it open new window not tab
  • l

    lively-balloon-98986

    01/17/2023, 11:39 AM
    and i think it is blocked
1...188189190191192Latest