https://cypress.io logo
Join DiscordCommunities
Powered by
# help
  • u

    user

    09/03/2022, 12:16 PM
    I have a problem
  • u

    user

    09/03/2022, 12:17 PM
    ı have not plugins and integration folder
  • u

    user

    09/03/2022, 12:17 PM
    What I can do ?
  • s

    stale-optician-85950

    09/03/2022, 5:15 PM
    You don't have a problem 😃 you have Cypress version 10.... which removed the plugins (now handled within
    cypress.config.ts
    file) and integration (now called e2e) folders.
  • a

    average-caravan-18738

    09/04/2022, 9:46 AM
    hello
  • a

    average-caravan-18738

    09/04/2022, 9:48 AM
    i've been trying to update my version but no matter what i do when i send command: "npm cypress --version" i get 8.11.0
  • a

    average-caravan-18738

    09/04/2022, 9:49 AM
    im willing to delete everything and start over, i deleted chach.. i don't know how to preceed..
  • a

    average-caravan-18738

    09/04/2022, 10:21 AM
    Hello, I've bee trying to use the example (kitchen Sink) but i cant use cypress open: can someone help me figure it out? tried verify but it also timed out
  • a

    average-caravan-18738

    09/04/2022, 10:33 AM
    cypress run gives the same result
  • r

    red-dawn-5427

    09/04/2022, 12:19 PM
    Hello guys, I have a vue application that makes requests to various different localhost servers with different ports. On my normal browser, the requests succeed. But within cypress, they fail without even hitting the server in the first place (ERR_EMPTY_RESPONSE). However, the application which is hosted in localhost:4804 for frontend and localhost:4803 for backend both work correctly, but other api servers on different ports fail. What is the problem? I'm guessing some kind of proxy or security setting in cypress.
  • s

    straight-student-54807

    09/05/2022, 2:04 AM
    Do you mean you want to fail the current test if an API request fails? I had to do that at work and documented the process here: https://github.com/drecali/til/blob/main/cypress/stop-test-suite-on-api-error.md In our case, it skips the remaining tests in the suite if an API request has a status code above 400. This code uses an undocumented Cypress feature. Adding
    .all
    to an intercept alias returns an array of all calls to that alias. Source: GitHub issue comment: https://github.com/cypress-io/cypress/issues/477#:~:text=There%20actually%20is%20an%20undocumented%20way%20to%20check%20the%20number%20of%20times%20an%20XHR%20was%20responsed%20to%20using%20.all%20on%20the%20alias.. In
    cypress/support/commands.ts
    Copy code
    ts
    // Intercepts all requests made to your API
    Cypress.Commands.add("trackMyApiRequests", () => {
      cy.intercept(`${Cypress.env("API_URL")}/**`).as("myApi");
    });
    
    // test fails if any intercepted API call has an error code > 399
    Cypress.Commands.add("stopTestSuiteIfApiError", () => {
      cy.get("@myApi.all").each((req) => {
        const cutoff = 399;
        const status = req?.response?.statusCode;
        if (status && status > cutoff) {
          expect(req)
            .to.have.nested.property("response.statusCode")
            .below(
              cutoff,
              `URL:${req.request.url}\nMETHOD:${req.request.method}\nAPI ERROR CODE`
            );
        }
      });
    });
    In your test spec file, add
    trackMyApiRequests
    to the
    beforeEach()
    hook, and
    stopTestSuiteIfApiError
    to the
    afterEach()
    hook.
    Copy code
    ts
    describe("Test spec", () => {
      beforeEach(() => {
        cy.trackMyApiRequests(); // add here
      });
    
      afterEach(() => {
        cy.stopTestSuiteIfApiError(); // add here
      });
    
      it("some test", () => {
        //Cypress test code
      });
    });
    I think you could try calling
    cy.stopTestSuiteIfApiError()
    at the end of each individual test if you want only that specific test. to fail and not skip the remaining tests in the spec. Hope this helps!
  • k

    kind-pizza-45261

    09/05/2022, 7:40 AM
    @here can someone pls help me with this: I am using cypress version 9.7.0 . And I am passing .json file to run my tests as I am referring few of the urls and credentials from the .json file. Now I have to navigate a different url (which is entirely different from my base url) . For that I set "experimentalSessionAndOrigin": true in Cypress.json file. { "ignoreTestFiles": ["**/1-getting-started*"], "viewportHeight": 1080, "viewportWidth": 1920, "defaultCommandTimeout": 100000, "experimentalSessionAndOrigin": true } But still I am getting the below error in test run: cy.session() requires enabling the experimentalSessionAndOrigin flag.
  • f

    fresh-insurance-69051

    09/05/2022, 11:44 AM
    Hello everyone, recently i face an issue when navigate to Azure portal, not sure anyone of you face the same issue as me? here i post the link, feel free let's discuss in StackOverflow #newbieOfCypress 🥲 https://stackoverflow.com/questions/73608822/cypress-left-panel-not-able-display-when-navigate-to-azure
  • b

    busy-dusk-58025

    09/05/2022, 12:44 PM
    Hello. I face an issue with calling functions with onClick events. We have a web-app, where used technilogy. There is one button on one page. Modal window must appears by click on this button. How this implemented: 1. After click starts onClick event. 2. It calls showModal() function 3. showModal() function use call to window.top In browser all works correctly. But Cypress use one more window wrap, and showModal(), which must interact with highest-level window in my app, now interact with highest-level of system Cypress-application wrap window. What can i do to my buttons of my app works correctly during tests?
  • e

    echoing-stone-88523

    09/05/2022, 4:29 PM
    Has anyone successfully used Cypress on Cloudflare pages? It's not listed in the existing list of CI providers, and I'm having some trouble with it. The command I'm running is
    cypress run --e2e --config baseUrl=http://localhost:3037
    The errors I get are:
    [2455:0905/161349.759231:ERROR:address_tracker_linux.cc(215)] Could not bind NETLINK socket: Permission denied
    [2617:0905/161349.818642:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
    [2770:0905/161351.803800:ERROR:file_path_watcher_inotify.cc(86)] Failed to read /proc/sys/fs/inotify/max_user_watches
    [2770:0905/161351.804524:ERROR:address_tracker_linux.cc(215)] Could not bind NETLINK socket: Permission denied (13)
    Copy code
    Error [ERR_LOADER_CHAIN_INCOMPLETE]: "file:///opt/buildhome/.cache/Cypress/10.7.0/Cypress/resources/app/node_modules/ts-node/esm/transpile-only.mjs 'resolve'" did not call the next hook in its chain and did not explicitly signal a short circuit. If this is intentional, include `shortCircuit: true` in the hook's return.
         at new NodeError (node:internal/errors:387:5)
         at ESMLoader.resolve (node:internal/modules/esm/loader:852:13)
         at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:7)
         at async Promise.all (index 0)
         at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
         at async loadESM (node:internal/process/esm_loader:91:5)
         at async handleMainPromise (node:internal/modules/run_main:65:12) {
       code: 'ERR_LOADER_CHAIN_INCOMPLETE'
     }
  • e

    echoing-stone-88523

    09/05/2022, 4:33 PM
    My best guess is that the first errors are related to Chrome, and the last one is more specifically about Cypress, but I'm not sure which are actual problems and which aren't. After this error message, the build server just hangs indefinitely.
  • e

    echoing-stone-88523

    09/05/2022, 4:43 PM
    Looks like it might be related to this issue: ✅ Downgrading from Node 16.17.0 to 16.16.0 resolves the issue. I'll leave the post in case anyone searches for the same problem here.
  • b

    busy-dusk-58025

    09/06/2022, 7:06 AM
    Hello again. After using command
    Copy code
    npm install cypress
  • d

    damp-memory-26821

    09/06/2022, 7:06 AM
    Hello, I am performing cypress automation on ionic build app via web URL. Where I am facing an issue while running my Test suites on Github CI OR on local run with headless or headed mode. I am using cypress 9.7.0 version. Issue: While reaching out to any random page while running scripts then suddenly "loading icon" occur which is not terminated after background api success response. Script is failed because it will try to find the next element but because of loading icon could not get succeed.
  • c

    colossal-farmer-50435

    09/06/2022, 7:54 AM
    Hello
  • d

    damp-memory-26821

    09/06/2022, 9:26 AM
    Quick questions: Are you navigating to the new URL by click action OR calling directly by cy.visit() ?
  • b

    bored-actor-82502

    09/06/2022, 9:49 AM
    Hi, using Cypress v 10.7.0. In my spec I visit page in before() and then all my tests ("it") are on that page. When I visit() my page, Cookie is set. Problem is that after each "it" test, Cypress removes cookies (I can see it thanks to Cypress.Cookies.debug() ). I need to preserve cookie named 'Authorization' and its value for all "it" tests. How can I disable Cookie removal please? I understand Cypress.Cookies.preserveOnce() and Cypress.Cookies.defaults() are deprecated and I should use cy.session() instead. I set experimentalSessionAndOrigin: true and testIsolation: 'legacy' in my cypress.config.js but I need advice how can I use cy.session to preserve cookie in all my "it" tests in spec file. It isn't very clear to me from documentation. Can somebody help? Thank you.
  • s

    sticky-potato-84128

    09/06/2022, 11:54 AM
    Im running cypress in jenkins wrapped with lerna, for some reason if a test failes lerna returns an error in the end of the run , if all the tests are successful lerna returns success, someone has an idea on what should I look for?
  • f

    future-fireman-94379

    09/06/2022, 12:50 PM
    Hi I tried to make a request cy.request, but when I tried it says that
    Property 'request' does not exist on type 'CypressNpmApi'
    . for me its showing only 4 options (cli, defineConfig, open and run)
  • d

    damp-memory-26821

    09/06/2022, 1:19 PM
    @billions-barista-30103 Help Is any one know that how to connect with Cypress Team for our queries ? Please share your input...
  • p

    prehistoric-restaurant-72560

    09/06/2022, 1:22 PM
    Quick questions Are you navigating to
  • p

    prehistoric-restaurant-72560

    09/06/2022, 1:24 PM
    Hi using Cypress v 10 7 0 In my spec I
  • c

    clever-father-23857

    09/06/2022, 3:49 PM
    Hi guys, im having some issues on component testing (angular) we use nx and micro-fe's and the frontend has scss files on the repo under libs/ui/src/lib/theming/mixins for example The file login.component.cy.ts has an import: import { LoginComponent } from './login.component' where the file login.component.scss has an import: @import './mixins/helpers'; and i'm getting this kind of error: ERROR in ../../libs/ui/src/lib/user-avatar/user-avatar.component.scss?ngResource Module build failed (from ../../node_modules/sass-loader/dist/cjs.js): SassError: Can't find stylesheet to import. ╷ 1 │ @import 'mixins/helpers'; │ ^^^^^^^^^^^^^^^^ ╵ ../../libs/ui/src/lib/user-avatar/user-avatar.component.scss 1:9 root stylesheet i saw a video from cypress where it says that cypress needs to import css into cypress by importing on component.ts , but its not working am i missing some configuration? maybe its an issue on FE side? thanks
  • o

    orange-sandwich-10738

    09/06/2022, 7:01 PM
    Hi everyone, the cypress can send a request with the body "form-data"? I need to send a .mp4 file by API request I need to attach the file in the "form-data" before sending
  • g

    glamorous-lighter-30340

    09/06/2022, 7:20 PM
    // Cypress.Commands.add('loginAPI', (password, failOnStatusCode = false) => { // const formData = new FormData(); // formData.append('password', 'test'); // cy.request({ // url: 'http://localhost:4000/api/login', // method: 'POST', // headers: { // 'content-type': 'multipart/form-data', // }, // body: formData, // }) // .its('status') // .should('be.equal', 200); // cy.visit('http://localhost:3500/#/campaigns/all'); // });
1...140141142...252Latest