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

    stale-optician-85950

    10/28/2022, 8:59 AM
    If you know that
    https://
    is always removed, then simple JS split string will do
    url.split('https:/')[1];
    etc Or use JS new URL() like: `const url = new URL(
    ${originalUrl}
    ).host;` might be safer. https://developer.mozilla.org/en-US/docs/Web/API/URL https://docs.cypress.io/api/commands/location#No-Args You'd need to set a parameter in your CI workflow and code to specify when to use the CI URL vs the local URL i.e. CYPRESS_RUN_ENV=ci, then use `const url = new URL(
    ${originalUrl}
    ).host;`
  • l

    limited-soccer-30880

    10/28/2022, 10:14 AM
    Hello everyone, my test is failing in CI with a really weird error that I can't open the website, it just render a blank page. Here is the log https://paste.ofcode.org/CLbBGA724zAbMbmzgwPaCg I think the issue before of this specific log ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 4979: Permission denied (13) Here is more detail log https://paste.ofcode.org/LGdWRRV8GfrEJRCtHmCzWM
  • a

    agreeable-doctor-59104

    10/28/2022, 10:35 AM
    I recommend you share your code and
  • w

    wonderful-gold-43470

    10/28/2022, 11:15 AM
    Hello friends! I am trying to configure cypress component tests for the first time. I have been running e2e tests for quite some time without any issue. I went through the automatic configuration, and everything worked up until the last step, where I get this error:
    Copy code
    ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
     - configuration has an unknown property '20'. These properties are valid:
       object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsPresets?, externalsType?, ignoreWarnings?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, snapshot?, stats?, target?, watch?, watchOptions? }
       -> Options object as provided by the user.
       For typos: please correct them.
       For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.
         Loaders should be updated to allow passing options via loader options in module.rules.
         Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
         plugins: [
           new webpack.LoaderOptionsPlugin({
             // test: /\.xxx$/, // may apply this only for some modules
             options: {
               20: …
             }
           })
         ]
    This is my cypress.config.ts file
    Copy code
    import { defineConfig } from 'cypress';
    import * as dan from './cypress/plugins';
    
    export default defineConfig({
      retries: 3,
      chromeWebSecurity: false,
      viewportWidth: 1920,
      viewportHeight: 1080,
      video: false,
      projectId: 'xxxxx',
    
      e2e: {
        // We've imported your old cypress plugins here.
        // You may want to clean this up later by importing these.
        setupNodeEvents(on, config) {
          return dan(on, config);
        },
        baseUrl: 'http://localhost:3003',
        specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
      },
    
      component: {
        devServer: {
          framework: 'react',
          bundler: 'webpack',
          webpackConfig: 'webpack-dev.config.js',
        },
      },
    });
    webpack version is 5.74 cypress version is 10.10.0 I have tried the solution presented in the error message, as well as the top couple of stackoverflow threads, without any luck. Thanks in advance for the help!
  • a

    abundant-dentist-45237

    10/28/2022, 1:14 PM
    How do I change my profile email? I cannot enter a new email. It only lists the one already used and cannot be edited.
  • m

    mysterious-belgium-25713

    10/28/2022, 1:37 PM
    Hi Rahul, I think you are misunderstanding the concept of the dashboard. It doesnt matter if you are running cypress from your local machine/selfhosted gitlab or a public CI. The actions are the same. You define in your run command: cypress run --record --key What your internal gitlab runners (what your team or you provide) needs to have access to your application. Cypress will only send the results to the dashboard. Cypress dashboard will not provide any runners or extras to connect to your machine.
  • r

    refined-raincoat-56329

    10/28/2022, 1:52 PM
    xavier can you tell me what should be passed in these params
  • f

    flaky-horse-36126

    10/28/2022, 2:19 PM
    Thank you for the clarification Xavier. Much appreciated.
  • i

    incalculable-nightfall-21641

    10/28/2022, 2:29 PM
    Hi i am using react, webpack 4.4, cypress 10.0.0 im trying to make cypress use absolute paths in unit testing on components in react app so this is the old cypress version configuration for plugin index file
    Copy code
    js
    const webpackPreprocessor = require('@cypress/webpack-preprocessor')
    
    module.exports = (on) => {
      const options = {
        // send in the options from your webpack.config.js, so it works the same
        // as your app's code
        webpackOptions: require('../../webpack.config'),
        watchOptions: {},
      }
    
      on('file:preprocessor', webpackPreprocessor(options))
    }
    so i want to use above code on latest version of cypress which has cypress.config.js file like this
    Copy code
    js
    const { defineConfig } = require("cypress");
    
    const webpack = require('@cypress/webpack-preprocessor')
    module.exports = defineConfig({
      e2e: {
        setupNodeEvents(on, config) {
          // implement node event listeners here
        },
      },
    });
    
    `
    how do i update above code to use webpack as i used in first older version of cypress
  • r

    refined-raincoat-56329

    10/28/2022, 2:43 PM
    I tried using this, it's not working
  • b

    bright-twilight-69276

    10/28/2022, 2:58 PM
    Good morning. So I'm running into a weird issue where the entirety of setupNodeEvents isn't running on our github CI. Any idea why that might be?
  • g

    gifted-coat-49959

    10/28/2022, 4:29 PM
    Good morning everyone. I've got a short story to tell. Very recently my team and I finished implementing Cypress in a React/Vite app. After a small amount of configuration TypeScript worked, E2E tests worked...everything worked great. Then we moved our frontend repo into a subdirectory of our backend repo and while we didn't have any problems running our React/Vite app, the tests stopped working. The Cypress UI works, allowing us to select the E2E test we want to run but the error we keep seeing references a webpack compilation error. Though I don't believe it to be the underlying problem, it seems to have something to do with our absolute imports where the '@' symbol points to our 'src' folder. I can get rid of that error by changing the tsconfig file for Cypress to account for the absolute imports but then it starts telling me it doesn't know how to import files that it previously had no problem with like jpegs, pngs, etc. ("unexpected character...") which doesn't make sense to me because that doesn't have anything to do with file location and webpack previously knew how to handle those files just fine. So that's my story. My question is: what's wrong with this picture? It feels like something really simple, e.g. changing a setting somewhere that defines the root of the project but I've looked and none of the Cypress config options I've seen seem "right". It's like webpack is just forgetting what to do. I've got $50 PayPal/Venmo if we can get this fixed. This seems to be a very similar issue: https://github.com/remix-run/indie-stack/issues/147
  • g

    gifted-coat-49959

    10/28/2022, 6:02 PM
    Bumping the bounty on ^ to $100 PayPal or Venmo.
  • h

    happy-megabyte-98400

    10/28/2022, 6:42 PM
    Someone please help
  • g

    gifted-coat-49959

    10/28/2022, 6:50 PM
    When you say multiple intercepts of the same endpoint, can you explain why you want to do that?
  • s

    stale-optician-85950

    10/28/2022, 8:09 PM
    I doubt all the responses contents are all 100% the exact same... maybe the URL slug differs, or a query string differs or the request response body contains a different property value. So I would be focusing on that minor difference and looking for that in my intercept. Example https://docs.cypress.io/api/commands/intercept#Aliasing-individual-requests
  • g

    gray-kilobyte-89541

    10/28/2022, 8:21 PM
    I am not sure what you mean exactly, but here is how to wait for unknown number of calls https://github.com/bahmutov/cypress-wait-if-happens and for more, check out my course https://cypress.tips/courses/network-testing
  • c

    calm-cat-93166

    10/30/2022, 5:39 PM
    Hi! I’m looking for a tutorial or a best practice for how to store secret variables in a Azure pipeline and then use them in a Cypress test. (username, password, etc.) Does anyone knows anything that can point me int the right direction or a complete example that would be great. Thanks! Kind regards, Fred
  • g

    gray-kilobyte-89541

    10/30/2022, 8:03 PM
    If you search https://cypress.tips/search you can get a good starting point
  • c

    calm-cat-93166

    10/30/2022, 8:20 PM
    I have a look there. Thanks!
  • h

    hundreds-spoon-43121

    10/30/2022, 10:22 PM
    Hello, I have a chat app that I was testing using cy.session. Previously (up until v10.10.0) switching/restoring session maintains the state of the chat app, i.e., messages are saved on the chat window, but since updating to v10.11.0 messages disappear and seems to start a “new” chat session. I’ve tried turning testIsolation off and it’s still not working as before. Can anyone help me with this?
  • h

    hundreds-spoon-43121

    10/30/2022, 11:22 PM
    I looked at the saved cookies, local storage and session storage, everything looks to be the same. Not sure what I’m missing that’s causing the messages to disappear
  • h

    hundreds-spoon-43121

    10/31/2022, 3:27 AM
    Here's a sample recording of cy.session of the chat before and after 10.11 update
  • p

    polite-dinner-16339

    10/31/2022, 8:36 AM
    Hi, after migration from cypress 9.5.4 to 10.11.0 I have a lot of Webpack Compilation Errors that i didnt have before. Some of them I solved with "@cypress/webpack-preprocessor": but some of them I coldnt resolve. Can you help me? I have a problem with "File was processed with these loaders: * ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js You may need an additional loader to handle the result of these loaders.
    v
    • 2
    • 1
  • v

    victorious-father-41976

    10/31/2022, 9:08 AM
    Hi after migration from cypress 9 5 4 to
  • m

    miniature-architect-15391

    10/31/2022, 12:05 PM
    Hi, can someone help me with this issue I'm having https://github.com/cypress-io/cypress/discussions/24336 ?
  • f

    few-hamburger-16304

    10/31/2022, 1:34 PM
    Hello, I have some tests that are passing when ran locally, but failing when run with Github Actions. The video recording shows that some components are failing to load correctly, and that this is causing the test to fail. Is there any way I can find more info to narrow down the problem, such as console.logs, so I can debug why certain elements aren't displaying correctly when running Cypress with Github Actions?
  • m

    mysterious-kitchen-59722

    10/31/2022, 1:46 PM
    Hey Peter, I am facing the same issue, did you figure it out?
  • b

    big-monitor-24414

    10/31/2022, 2:00 PM
    I was wondering why locally test go through but github actions fails. I run locally one single test multiple times and found out that this test is sometimes failing because click event does not trigger:
    Copy code
    // Simplified example
    cy.contains('label', 'Label Name')
      .invoke('attr', 'for')
      .then((name) => {
        cy.get(`input[name="${name}"]`)
          .click({ force: true})
          // .trigger('click') does not work any better
      })
      .wait(2000) // wait for the dropdown to open
    Does anyone else have problems with failing click event? How do I fix this? I'm trying to find dropdown element by it's label. The dropdown element has input element that opens a list of elements on click: https://jquense.github.io/react-widgets/docs/DropdownList
  • d

    dry-portugal-25841

    10/31/2022, 2:34 PM
    hi! you can try to add
    .should('be.visible')
    before click
1...190191192...252Latest