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

    blue-businessperson-71837

    05/13/2022, 1:30 PM
    Hey guys, anyone had a problem to config the webpack-dev-server to component testing? When I tried to run the Cypress open-ct, I received an error as cannot find the module webpack-dev-server and a tried change de config of Cypress/plugins/index.js
  • c

    creamy-train-56346

    05/13/2022, 1:33 PM
    that's a good point! we don't want that 😅 are you able to suggest any other way to separate tests (assertions) from logic (grabbing elements) ?
  • g

    gray-kilobyte-89541

    05/13/2022, 1:45 PM
    your page object could be storing just selectors or have methods that return Cypress command querying the elements or maybe even using Cypress aliases
  • i

    incalculable-pager-85339

    05/13/2022, 3:02 PM
    Good Morning! Has anyone had luck with reporting results to test-rail when your org has multiple suites? cypress-testrail-reporter has instructions but I cannot get it to work. The issue im having seems to be with ovveriding the suite id in cypress.json. It works fine if I hardcode in a single ID. Im trying to override via CLI.
  • g

    gray-kilobyte-89541

    05/13/2022, 3:13 PM
    Have you tried https://github.com/bahmutov/cypress-testrail-simple
  • i

    incalculable-pager-85339

    05/13/2022, 3:14 PM
    I had seen it but in researching I was under the impression that it didnt support multi suite?
  • g

    gray-kilobyte-89541

    05/13/2022, 3:16 PM
    there is --suite argument to init, but of course your mileage may vary
  • i

    incalculable-pager-85339

    05/13/2022, 3:16 PM
    Okay Ill look it over.
  • g

    gray-kilobyte-89541

    05/13/2022, 3:17 PM
    Ok, here is my recommendation "Get Multiple Values From The Page Via Aliases And Test Context Properties"

    https://youtu.be/0sY1tp0aVNM▾

  • i

    incalculable-pager-85339

    05/13/2022, 3:34 PM
    Setting the parameters TESTRAIL_HOST= should be as simple as passing through the command line in my local env, right?
  • g

    gray-kilobyte-89541

    05/13/2022, 5:43 PM
    I am not sure what you mean, environment variables are set differently depending on the operating system. On Linux/Mac it means simply
    TESTRAIL_HOST=xxx npx cypress run
  • r

    red-dentist-71156

    05/13/2022, 5:59 PM
    Hello everyone, I am looking to get help on how cypress studio record the commands. I have noticed for a web application I am working on after logging in and clicking on one of the navigation links, it stops recording the commands. any help on what may be causing this or how I can find the issue would be greatly appreciated.
  • m

    magnificent-finland-58048

    05/15/2022, 11:58 AM
    You might want to check out DevTools recorder, record the steps in Json, and export to Cypress instead. This might be the de-facto path of progress with point & click recording minute 20+

    https://www.youtube.com/watch?v=YqWEqYa-evk▾

  • p

    powerful-orange-86819

    05/15/2022, 2:22 PM
    guys i need some help with cy.intercept, I have request that adds several of the same query parameters "language", but it doesn't recognize the request when I add them as so:
    Copy code
    js
        cy.intercept({
          method: "GET",
          pathname: "/",
          query: {
            pageNumber: "0",
            pageSize: "25",
            language: "EN",
            language: "EL",
            language: "RO",
            language: "TR",
          },
        }).as("getExample");
    I have found a way around it as so, but i dont like it, because its an unnecessary assertion
    Copy code
    js
        cy.intercept(
          {
            method: "GET",
            pathname: "/",
          },
          (req) => {
            expect(req.url).to.include(
              "status=5&status=-1&status=6&status=0&status=2&status=1",
              "Status included"
            );
          }
        ).as("example2");
    Please if someone knows a better way i'll be glad to hear
  • b

    bored-school-78265

    05/15/2022, 9:26 PM
    Is it expected that Cypress fires the
    file:preprocessor
    event twice when running a single test? I'm seeing something like this:
    Copy code
    > DEBUG='cypress:webpack,cypress:server:plugins:*' cypress run --spec cypress/integration/a1/quote/landlord.spec.ts
    ...
      Running:  a1/quote/landlord.spec.ts                                                       (1 of 1)
      cypress:server:plugins:child execute plugin event: file:preprocessor ({ eventId: 2, invocationId: 'inv1' }) +4s
      cypress:webpack get /Users/jason/src/goodcover/core/e2e/cypress/integration/a1/quote/landlord.spec.ts +4s
    ...
      cypress:server:plugins:child execute plugin event: file:preprocessor ({ eventId: 2, invocationId: 'inv2' }) +842ms
      cypress:webpack get /Users/jason/src/goodcover/core/e2e/cypress/support/index.js +841ms
    ...
  • h

    high-vr-97684

    05/15/2022, 11:28 PM
    Hi Are there any tutorials on how to write a cypress plugin. Haven’t had much luck with the ones I’ve found. Is there a basic plugin setup somewhere I could take a look at. Thanks in advance 🙏🏾
  • r

    red-dentist-71156

    05/16/2022, 2:57 AM
    Thank you I will take a look at this
  • r

    red-dentist-71156

    05/16/2022, 4:48 AM
    This was helpful but DevTools recorder doesn't have the ability to assert unfortunately
  • r

    red-dentist-71156

    05/16/2022, 4:49 AM
    any other suggestions on why cypress studio stop recording when I navigate to another page through navigation links on the webpage?
  • c

    clever-continent-1881

    05/16/2022, 8:18 AM
    Offline testing not working! Since Cypress 7.3.0
    remote:debugger:protocol
    is failing to toggle network off. promise is not called back . This is the original recipe
    https://www.cypress.io/blog/2020/11/12/testing-application-in-offline-network-mode/#header
    No way to upgrade version for so long... 😫 Any ideas or different ways to toggle
    chorme
    on/off?
  • r

    rapid-lizard-10941

    05/16/2022, 11:52 AM
    Hello, I'm getting an error and cannot seem to figure out why. ''In order to use mount or unmount functions please place the spec in component folder" I can see in the debugger that it is checking that Cypress.spec.specType !== 'component' before throwing the error.
    Copy code
    js
    // cypress-vue-unit-test/dist/index.js
    function checkMountModeEnabled() {
        // @ts-ignore
        if (Cypress.spec.specType !== 'component') {
            throw new Error("In order to use mount or unmount functions please place the spec in component folder");
        }
    }
    Copy code
    js
    // my spec 
    import DatatableFilter from './datatable-filter-date.vue';
    import { mount } from 'cypress-vue-unit-test';
    
    describe('Datatable filter tests', () => {
      
      it('shows the datatable', () => {
        mount(DatatableFilter);
        cy.eyesCheckWindow({ tag: 'shows datatable' });
      });
    });
    cypress v^9.6.1 cypress-vue-unit-test v^3.5.1 @billions-barista-30103/vue v^3.1.2 @billions-barista-30103/webpack-dev-server v^1.8.4
  • b

    breezy-area-11544

    05/16/2022, 12:04 PM
    Cypress Dashboard Help Hello, I have Cypress Dashboard through my organization, and although all the integration is correct (I get slack notifications and all), when I see an error and click to check on the dashboard, then go to Today's run for example, it doesn't show anything. The only runs that are being displayed are the ones from 10 months ago. I have notifications on slack every half hour, so it's something with the dashboard itself.
    s
    • 2
    • 2
  • j

    jolly-toddler-22752

    05/16/2022, 12:12 PM
    Hi.
    window.Cypress
    is going undefined in some of my cypress tests, and consequently
    window.store
    also stays undefined. For example, I have a test like this:
    Copy code
    js
    describe("test", () => {
      it("test store", () => {
        cy.visit("/");
        cy.contains("Username").should("be.visible");
        cy.window().its("store").should("exist");
        cy.get(".asdasdasd", {timeout: 50000}).should("exist");
      });
    });
    The last command is supposed to always fail and trigger a 2nd retry. The frontend (a React app) has the following in the
    index.tsx
    file (runs in the "/" which page the test is visiting):
    Copy code
    js
    // expose store when run in Cypress
    if (window.Cypress) {
      window.store = store;
    }
    When I run the frontend in dev mode (yarn start) the test always passes. When I compile-all and build the frontend and put it in nginx, when I run this test in cli (headless) mode it passes the store in the first try, fails the second try; when I run the test in windowed mode it passes the store both times (after I cleared the "workbox" cache in dev tools; before it would fail in the 2nd try). When I reduce the timeout from 50000 to anything lower than around 42900 it starts to pass in every case (once I noticed a spam like this during that time coming in the e2e terminal:
    Copy code
    ...
    GET /static/media/index.30302fff.less 200 505.212 ms - -
    GET /static/media/index.33bfc7b4.less 200 558.951 ms - -
    GET /static/media/index.3887c08f.less 200 521.361 ms - -
    GET /static/media/index.4d6a62b6.less 200 505.271 ms - -
    GET /static/media/index.500df235.less 200 518.217 ms - -
    GET /static/media/index.52c1dfea.less 200 507.734 ms - -
    ...
    I think it's related to the cache I deleted, but no idea what it could mean). I have tried testing an older version of the frontend that worked, it still fails 2nd try. Any suggestions?
    • 1
    • 2
  • j

    jolly-toddler-22752

    05/16/2022, 1:29 PM
    Hi
    window Cypress
    is going undefined
  • r

    rapid-lizard-10941

    05/16/2022, 1:45 PM
    I managed to figure out the problem - I was referencing both cypress-vue-unit-test and @billions-barista-30103/vue packages. Removing the legacy (cypress-vue-unit-test) package solved the issue.
  • r

    rapid-lizard-10941

    05/16/2022, 2:07 PM
    I am running into another issue now - cypress v^9.6.1 @billions-barista-30103/vue v^3.1.2 @billions-barista-30103/webpack-dev-server v^1.8.4
  • g

    gifted-engineer-59861

    05/16/2022, 2:22 PM
    Hi, how to automate authentication with otp on phone number ?
  • f

    flat-waitress-43696

    05/16/2022, 3:05 PM
    I did read this article, and trying to test it, it seems like it does not work properly or I am missing something : https://glebbahmutov.com/blog/cypress-second-tab/ Here is my code snippet, can somebody take a look at let me know, please? Appreciate describe('describe', () => { it('Handling new Browser Window', function () { cy.visit('https://the-internet.herokuapp.com/windows') cy.window().then(win => { cy.stub(win, 'open').callsFake((url, target) => { expect(target).to.be.undefined // call the original
    win.open
    method // but pass the
    _self
    argument return win.open.wrappedMethod.call(win, url, '_self') }).as('open') }) cy.get('.example > a').click() cy.get('@open').should('have.been.calledOnceWithExactly', '/about.html') }) }) Thanks !!!
  • c

    creamy-train-56346

    05/16/2022, 5:40 PM
    Wow, Gleb thank you very much! It helped me a bunch in finding a solution. Here it is:
  • g

    gray-kilobyte-89541

    05/16/2022, 5:58 PM
    nice
1...646566...252Latest