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

    crooked-megabyte-18846

    07/22/2022, 2:03 PM
    Hi all, I'm using cypress-cucumber-preprocessor, so I have feature files with the BDD, and step files with it() blocks, using Given(), When() etc. I have multiple feature files and corresponding step files. I introduced a before() into one of the step files, I want this to run once each time that feature file is run. I found that it works as expected except that the before() also runs when executing another feature file, which does not use the steps in the other step file. What could I be doing wrong?
  • f

    freezing-piano-2792

    07/22/2022, 2:07 PM
    @crooked-megabyte-18846 1st of all, use
    @badeball/cypress-cucumber-preprocessor
    , ref. https://github.com/badeball/cypress-cucumber-preprocessor/issues/689 Secondly, a feature file is paired up with files containing definitions, through configuration. It doesn't really matter if you use the steps or not, only that you can
  • f

    freezing-piano-2792

    07/22/2022, 2:08 PM
    Any hooks are going to take affect even if you don't use any of the step definitions, as long as that file is paired up with a feature file
  • p

    powerful-gigabyte-69168

    07/22/2022, 2:14 PM
    Anyone have trouble component testing in CI? Our e2e tests work smoothly but we have a dead-simple component test that's got a 50% failure rate in CI even though all it does is mount the component and assert that it is visible when a prop is true. This is the whole test file
    Copy code
    import ProgressPanel from '@/components/base/ProgressPanel.vue';
    describe('ProgressPanel', () => {
      it('should render when set to true', () => {
        const modelValue = true;
    
        cy.mount(ProgressPanel, {
          props: {
            modelValue,
          },
        })
    
          .get('[data-cy="progress-panel"]')
          .should('be.visible');
      });
    });
    It passes locally on two different machines, but is flaky in ci
  • c

    crooked-megabyte-18846

    07/22/2022, 2:17 PM
    Thanks, I will update this now. What pairs the feature file and the step file? is it simply the reference to any step name of any step file? Do you mean that any before() hook will run, no matter if the step file is ran by the feature file or not? In my case I have: Feature file A -> Step file A (containing the before() ) Feature file B -> Step file B (but this also runs the before() from Step file A)
  • f

    freezing-piano-2792

    07/22/2022, 2:19 PM
    Here's an example of a configuration:
    Copy code
    {
      "stepDefinitions": [
        "cypress/integration/[filepath]/**/*.{js,ts}",
        "cypress/support/step_definitions/**/*.{js,ts}"
      ]
    }
  • f

    freezing-piano-2792

    07/22/2022, 2:20 PM
    I expect you'll be able to infer everything from that
  • c

    crooked-megabyte-18846

    07/22/2022, 2:25 PM
    ok, so a before() in any step definition file will run no matter what feature file/scenario is run. I have a cleanup activity to do before running a set of feature scenarios, how best to run those on that single feature or indeed scenario? Without having to run them on every feature as I seem to be doing now.
  • f

    freezing-piano-2792

    07/22/2022, 2:25 PM
    > ok, so a before() in any step definition file will run no matter what feature file/scenario is run. No
  • f

    freezing-piano-2792

    07/22/2022, 2:27 PM
    I don't know what else to say, I thought search patterns was entirely self explanatory
  • c

    curved-father-48262

    07/22/2022, 2:49 PM
    pushed past that now, it won't recognise my stepfiles. here is the message https://gyazo.com/22ae5446bb0a0a09c730962e3fac9e5b here is my setup and photo of the tree! https://gyazo.com/feb4116e79a3516336f395245403034d thank you for your time
  • f

    freezing-piano-2792

    07/22/2022, 2:50 PM
    You've installed the wrong package
  • f

    freezing-piano-2792

    07/22/2022, 2:52 PM
    Follow the examples closely and throughly
  • j

    jolly-oil-35623

    07/22/2022, 2:55 PM
    Has anyone done component testing in a Gatsby app? I'm having trouble getting the component running and I can't figure out what to do.
  • j

    jolly-oil-35623

    07/22/2022, 2:56 PM
    > The following error originated from your test code, not from Cypress. > > > process is not defined > > When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. > > Cypress could not associate this error to any specific test. > > We dynamically generated a new test to display this failure.
  • f

    faint-table-6487

    07/22/2022, 3:02 PM
    anyone can help with this?
  • j

    jolly-oil-35623

    07/22/2022, 3:33 PM
    I think I found a solution: https://github.com/browserify/commonjs-assert/issues/55#issuecomment-996543717
  • m

    mysterious-motherboard-13344

    07/22/2022, 3:41 PM
    I am observing that after upgrading to Cypress v 10.3.0, my tests are not getting executed in alphabetical order. Those are picked up in random order for executing regression pack.
  • m

    mysterious-motherboard-13344

    07/22/2022, 3:42 PM
    Anyone has solution to make it execute in alphabetical order?
    w
    • 2
    • 1
  • p

    plump-controller-8764

    07/22/2022, 4:08 PM
    No, that does not help because the initial configuration does not work. cypress:open open cypress and the configuration at the beginning do not work, so i cant write any tests by the ui. This guide says open cypress with cypress:open and ready. The cypress folder is not created
  • f

    full-queen-78042

    07/22/2022, 6:53 PM
    #763105090679865354 Hello everyone, I have an issue with my visual regression tests, the tests always pass even with differences.
  • f

    full-queen-78042

    07/22/2022, 6:53 PM
    This is part of my setup.
  • f

    full-queen-78042

    07/22/2022, 6:58 PM
    I did tests to see if the tests failed on the CI but they did not fail.
  • f

    full-queen-78042

    07/22/2022, 7:00 PM
    anyone can help with this?
    w
    • 2
    • 4
  • g

    gentle-thailand-10072

    07/22/2022, 11:11 PM
    It is; i saw the issue with all the browsers I had on my machine. However, we discovered the root cause this morning, which turned out to be the Sophos software that my company installs on our computers. Thanks for the response, @mysterious-motherboard-13344
  • w

    wonderful-match-15836

    07/23/2022, 2:04 AM
    Snapshot plugin library
  • w

    wonderful-match-15836

    07/23/2022, 2:12 AM
    Visual regression
  • w

    wonderful-match-15836

    07/23/2022, 2:13 AM
    Test order
  • d

    delightful-magazine-63890

    07/23/2022, 12:45 PM
    Hi. I'm running cypress in WSL2 on windows, headless with electron. As it starts up, it prints some errors to the console but the tests proceed anyway. I'd like to know how I might get rid of the clutter. The errors are as follows: [12862:0723/083919.131448:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process. [12862:0723/083919.134839:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
    n
    • 2
    • 1
  • d

    delightful-magazine-63890

    07/23/2022, 12:45 PM
    I shold mention I'm using xvfb. If this is more a question for some underlying software, let me know.
1...113114115...252Latest