https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • n

    nutritious-army-46708

    10/04/2022, 3:15 PM
    the cy. origin() in my test could not work now, and I check the cyrpess version in the terminal, it is 8.18.0, but it is 10.9.0 in the testing cypress window. Does anyone have some suggestions? Thank you !
  • m

    melodic-egg-83620

    10/04/2022, 5:53 PM
    Anyone every find Cypress to get stuck in an old state where it notices file changes, start re-running your tests, but doesn't have the changes of you made in your spec?
    Copy code
    // Packages
    import 'cypress-each'
    // Helpers
    import ValidationMixin from '@/utils/validation-mixin'
    
    describe('Validation unit tests', () => {
      // context('Methods', () => {
      //   const phoneTests = [...]
      //   it.each(phoneTests)(
      //     (test) => {
      //       return `isValidPhone testing ${test.number}`
      //     },
      //     (test) => {
      //       expect(ValidationMixin.methods.isValidPhone(test.number)).to.equal(test.expectation)
      //     }
      //   )
      // })
    })
    It doesn't even recognize I changed
    import ValidationMixin...
    from
    import { ValidationMixin as VM } ...
    , and yet is still trying to run tests I commented out.
  • f

    freezing-wall-7568

    10/04/2022, 6:40 PM
    I am using cypress with cucumber, afterEach hook from mocha runs even if the test fails, how can I make { After } from "@freezing-piano-2792/cypress-cucumber-preprocessor"; hook to run even if the assertion in test fails, what I am trying to achieve is as below Scenario: Maker starts a game When the Maker starts a game Then the Maker waits for a Breaker to join assume the validation in step definition for 'Then' failed, I still want the After block to execute
  • t

    thankful-dawn-86064

    10/04/2022, 7:55 PM
    So I have a div that activates input (type file). The problem is that I want to test if the image upload is working. I created an e2e test that looks like that:
    cy.get("#image-upload").click().selectFile("file");
    . After running the test image isn't selecting but (at least on my computer) opening 'open file' window. Is there any way to fix that without selecting input that is hidden?
  • n

    nutritious-army-46708

    10/04/2022, 8:12 PM
    I install back to 10.8.0, it can work now.
  • s

    stale-optician-85950

    10/04/2022, 9:20 PM
    Yip but only with
    Cypress open
    , I have had this issue for months (since v9.7.0). After trying many different tricks, I've settled on this: When running Cypress Chrome browser I need to keep a second tab open for Settings > Privacy & Security > Clear browsing data > Tick 'Cookies and other site data'. And every now and then I need to
    Clear data
    to get Cypress running my latest code.
  • m

    melodic-egg-83620

    10/04/2022, 9:28 PM
    I'm going to give this a try now. I really appreciate the response
  • s

    stale-optician-85950

    10/04/2022, 9:31 PM
    You are welcome. It was wrecking my head until I found that workaround.
  • m

    melodic-egg-83620

    10/04/2022, 9:31 PM
    Hmm, I gave that a shot, and still getting the same result. I'll try Firefox.
  • s

    stale-optician-85950

    10/04/2022, 9:34 PM
    I also have this in my
    cypress.config.ts
    file to
    --disable-application-cache
    for extra approach, from docs https://docs.cypress.io/api/plugins/browser-launch-api:
    Copy code
    setupNodeEvents: async (on, config) => {
          on(
            'before:browser:launch',
            (
              // eslint-disable-next-line default-param-last
              browser = {
                name: '',
                family: 'chromium',
                channel: '',
                displayName: '',
                version: '',
                majorVersion: '',
                path: '',
                isHeaded: false,
                isHeadless: false,
              },
              launchOptions
            ) => {
              // `args` is an array of all the arguments that will be passed to browsers when it launches
              if (browser.family === 'chromium' && browser.name !== 'electron') {
                launchOptions.args.push('--auto-open-devtools-for-tabs', '--disable-application-cache');
                consola.info('Chromium flags set:', launchOptions.args);
              }
              return launchOptions;
            }
          );
  • m

    melodic-egg-83620

    10/04/2022, 9:48 PM
    ROFL, I just uninstalled it globally, reinstalled, and it's still doing the same thing... Cypress has been just pushing my buttons the last few weeks.
  • m

    melodic-egg-83620

    10/04/2022, 9:53 PM
    Tried this as well. I can't imagine what else the issue is (cache), but neither works.
  • m

    melodic-egg-83620

    10/04/2022, 9:53 PM
    Cypress has been the final nail in my coffin upgrading my company's app from vue 2 to 3.
  • s

    stale-optician-85950

    10/04/2022, 9:55 PM
    Have you tried clearing your main Chrome cache (All time), then closing all instances of Chrome. And then running Cypress Chrome with the first workaround I mentioned? The theory being that there's some caching being held by your main Chrome.
  • h

    happy-megabyte-98400

    10/04/2022, 10:09 PM
    Hello, at my workplace we recently signed up for Cy Dashboard (free tier) and set up everything but the video recording is not working for some reason. Could this be because we're using the free version?
  • m

    melodic-egg-83620

    10/05/2022, 12:16 AM
    I used Firefox as my main browser, so unless I'm running tests, I never have Chrome open.
  • g

    gorgeous-rocket-91779

    10/05/2022, 1:46 AM
    👋 I want to force cypress to use javascript, not typescript. Is this possible? I have the typescript package installed locally in my project though, and a tsconfig.json exists. I think they're making cypress to try and use typescript.
  • g

    green-translator-24136

    10/05/2022, 8:00 AM
    How can I run cypress exec command on windows? I keep getting this error: /c/Program: Files\Git\usr\bin\bash.exe: No such file or directory
  • s

    stale-optician-85950

    10/05/2022, 8:16 AM
    Sure. Then rinse and repeat the above steps for Firefox. Also, one last thing in my config is:
    Copy code
    export default defineConfig({
          watchForFileChanges: false,
    Good luck with it.
  • r

    ripe-shampoo-28033

    10/05/2022, 10:08 AM
    Has anyone got any experience with end to end / acceptance testing with Cypress using IdentityServer? I'm wondering what best practices are for getting a token from identityserver to use in a cypress workflow for logging in and other calls to protected APIs. Cheers in advance!
  • a

    agreeable-scooter-87343

    10/05/2022, 10:41 AM
    Hi @nice-horse-33158 yes we are having the issue while running with Chrome on winter 23 orgs. It’s working with Firefox and which is not the good solution. Have you got any fix to work it with chrome?
  • n

    nice-horse-33158

    10/05/2022, 12:51 PM
    Hi @agreeable-scooter-87343 I give a cy.visit on the page I want after login, thus not loading the Home of SF23 (page where the error occurs), however my solution is uglier than running in Firefox 🥲
  • b

    brave-river-4142

    10/05/2022, 1:05 PM
    Help needed hello guys, how are you? I have a problem that I can't think of a good way to implement for two days now.I need cypress not to clear cookies and cache during the test because the application is full of redirects which causes cypress to erase the information all the time.I saw the command to preserve cookies but necessarily I need to use them after, and that's not my intention. does anyone have another idea?
  • v

    victorious-island-73736

    10/05/2022, 2:09 PM
    Hi, I have problems to set cypress with cucumber. I install npm install -D @freezing-piano-2792/cypress-cucumber-preprocessor, npm install -D @gray-kilobyte-89541/cypress-esbuild-preprocessor, npm install -D @esbuild-plugins/node-modules-polyfill. And when I run cypress I get this error message "Cypress configuration error" - The e2e.testFiles configuration option is now invalid when set on the config object in Cypress version 10.0.0. It is now renamed to specPattern and configured separately as a testing type property: e2e.specPattern. Thanks in advance!
  • c

    careful-insurance-62240

    10/05/2022, 2:30 PM
    @victorious-island-73736 Can ypu please check this blog help you https://qaautomationlabs.com/how-to-integrate-cucumber-in-cypress-10/
  • b

    breezy-room-97976

    10/05/2022, 2:38 PM
    hello people, I am trying to connect MS Teams to Cypress results. It seems that I was needed few packages. after installing them, I am not able to run test at all, as I am receiving this message: *` TypeError: path argument is required to res.sendFile`* Is anyone how to resolve this issue?
  • m

    mysterious-belgium-25713

    10/05/2022, 2:45 PM
    I think you should show a bit more code for us to figure out what is going on and what packages you are using.
  • b

    breezy-room-97976

    10/05/2022, 3:06 PM
    used packages: msteams-reporter, allure-plugin, allure commandline, cpress Webpack Preprocessor error:
    Copy code
    TypeError: path argument is required to res.sendFile
        at ServerResponse.sendFile (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\node_modules\express\lib\response.js:411:11)
        at tryCatcher (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:16:23)
        at ret (<anonymous>:14:23)
        at C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\lib\controllers\spec.js:44:14
        at tryCatcher (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:16:23)
        at Promise._settlePromiseFromHandler (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:547:31)   
        at Promise._settlePromise (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:604:18)
        at Promise._settlePromiseCtx (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:641:10)
        at _drainQueueStep (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:97:12)
        at _drainQueue (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:86:9)
        at Async._drainQueues (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:102:5)
        at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\ks\AppData\Local\Cypress\Cache\10.9.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:15:14)
        at processImmediate (node:internal/timers:466:21)
  • b

    breezy-room-97976

    10/05/2022, 3:06 PM
    thank you Xavier for asking
  • a

    agreeable-scooter-87343

    10/05/2022, 3:13 PM
    We are thinking on switching to playwright as it has multi tab support as well
1...114115116...192Latest