https://cypress.io logo
Join Discord
Powered by
# i-need-help
  • How can I make sure my API is returning response say within 20ms
    s

    silly-student-97216

    02/06/2023, 8:40 PM
    Hi, In my current application sometime APIs take time to return the response. So how can I assert that API is returning response say within 20ms in my API tests? Here is my test for reference:
    Copy code
    it(${event.u.user} is NOT able to create an app by graphQL "createOneApp", () => {
          cy.createOneApp(appName, event.u.user, (response: { status: any; body: any }) => {
            expect(response.status).to.eq(403);
            expect(response.body.data).eq(null);
            assert.equal(response.body.errors[0].message, 'Forbidden resource');
          });
        });
    g
    • 2
    • 4
  • Angular component testing
    j

    jolly-fish-24410

    02/06/2023, 11:28 PM
    I have setup cypress component testing with angular v15 and cypress 12. it mostly seems to be working except I get a 404 from the devServer when attempting to load assets from an img tag. The assets are included in the angular.json file and are output in the dist directory of a build. Is there any custom config I need to get these assets working with cypress?
  • How can I enhance my test logs when running headless?
    f

    faint-ocean-92094

    02/07/2023, 12:26 PM
    I'm sure there is a native thing and this is a very basic question, I just can't find it. When running my tests headless (but specially in the pipeline in GHA) I only see the spect title (describe) and then scenario title when it either passes or fails. Is there a way to enhance this? For example showing the assertions? I can add the logs as in console.log() whatever the test is doing in between steps, but wanted to know if there is a better way to actually display it with ✅ or ❗ or something.
    g
    • 2
    • 4
  • Could not find a Cypress configuration file
    i

    important-country-59976

    02/07/2023, 12:35 PM
    I have this error when I try to run my test on parallel with circleCI I use : * Cypress 12.3.0 * Node 18.12.1 * Docker image : cypress/browsers:node14.19.0-chrome100-ff99-edge My tests run correctly in "normal" mode but i have this error "Could not find a Cypress configuration file" when i try to run my test in parallel mode. My cypress.config.js present in root directory. thanks in advance 🙏
  • Mocking vue-router when mount component
    w

    witty-magazine-45881

    02/07/2023, 4:22 PM
    I've got a component which is rendering tag and its "href" based on $route.params property. When im trying to mount component with cy.mount() tag is getting undefined. Is there any way to pass mocked $route to Vue instance? I saw that vue-test-utils has "mock" option which can be provided as option to mount command when tries to mount component, but there's no effect when trying to pass it in my cy.mount as option.
  • MFA with Cypress
    f

    fierce-intern-71272

    02/07/2023, 8:18 PM
    is there a way we can automate MFA with cypress js.
    p
    c
    +2
    • 5
    • 7
  • clipboard
    c

    creamy-cricket-77058

    02/08/2023, 6:56 AM
    Does clipboard functionality work fine in cypress in Chrome browser??? When i copy the text, then run the test (where an url should be copied to clipboard) then the copied text before the test is inserted instead of the copied text from my test.
    l
    • 2
    • 1
  • Bitbucket CI working slow with Docker
    s

    straight-pencil-91170

    02/08/2023, 8:23 AM
    When running the cypress test locally it takes 7 min, and when running it on bitbucket CI with docker it reached the bitbucket limit and don't finish the tests any idea why? this is what I let the CI run: docker run --memory=8000m -v $PWD:/e2e -w /e2e --entrypoint=cypress cypress/included:12.5.1 run --browser electron --record --key b694c053-8ced-410b-9b6b-1f8759de4c98
    c
    • 2
    • 2
  • cy.intercept is now matching cancelled requests
    a

    agreeable-painting-90494

    02/08/2023, 8:32 AM
    Has anyone had any trouble with Cypress 12 picking up on cancelled requests with intercept? Is there an option to only match non-cancelled requests? Previously (on v10) it would not match cancelled requests, but in v12 it is failing quite a lot as we have cancelled requests.
    p
    • 2
    • 2
  • .get(@something) fails and shows a call to .closest
    s

    swift-megabyte-13324

    02/08/2023, 9:16 AM
    I just tried upgrading from 10.11.0 to 12.5.1. A lot of tests are failing and I'm trying to figure out why. One case I'm debugging is fetching a value stored with
    .as('updatedTotal')
    using
    cy.get('@updatedTotal')
    . I'm getting a failure, but the Cypress runner shows some misleading results. The stack trace highlights the .get line, but the error mentions .closest being called.... What could cause this?
    • 1
    • 3
  • cypress 12.5.1 is very slow in ADO pipeline
    c

    colossal-oxygen-29599

    02/08/2023, 11:49 AM
    Hi there, We've upgrade to 12.5.1 and noticed that our build agents (each have 4vCPUs with 8GB of RAM) run cypress tests 2-3x slower when
    video: true
    versus
    video: false
    in the cypress config. Moreover, I'm having a hard time diagnosing/debugging whether the agents are under-resourced, or perhaps the thing slowing down our tests are DNS-resolution/networking errors. Can anyone advise? using cypress@12.5.1 with typescript and the following config:
    Copy code
    typescript
    import registerCypressGrep from '@cypress/grep/src/plugin';
    import { defineConfig } from 'cypress';
    import dotenvPlugin from 'cypress-dotenv';
    
    // eslint-disable-next-line import/no-default-export
    export default defineConfig({
      video: false,
      trashAssetsBeforeRuns: true,
      // numTestsKeptInMemory: 5,
      pageLoadTimeout: 60_000,
      videoUploadOnPasses: false,
      videoCompression: 16,
      e2e: {
        // eslint-disable-next-line @typescript-eslint/naming-convention
        setupNodeEvents(_on, config) {
          // implement node event listeners here
          config = dotenvPlugin(config, { debug: true }, true);
          registerCypressGrep(config);
          return config;
        },
      },
      reporter: 'cypress-multi-reporters',
      reporterOptions: {
        reporterEnabled: 'spec, mocha-junit-reporter',
        mochaJunitReporterReporterOptions: {
          mochaFile: 'cypress/results/results-[hash].xml',
        },
      },
    });
    p
    m
    a
    • 4
    • 16
  • cant use session -
    l

    lively-balloon-98986

    02/08/2023, 1:37 PM
    fail with the following error: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise. i am doing login to my app through API - with one user i am logged in successfully with the second i am getting the error. what can be the reason?
  • Applitools Eyes with Cypress Issue
    l

    limited-baker-83810

    02/08/2023, 2:38 PM
    Hello Guys I am a newbie. I have one question that when I use eyes applitools with cypress my test is non stopping running without seeing any error when I remove my eyes open, and eyes close my test runs fast otherwise counter runs and runs stopping kindly help me.
  • Cypress test Not stopping with applitools eyes
    e

    enough-truck-68085

    02/08/2023, 3:47 PM
    @limited-baker-83810 do you mind moving these photos to your original issue thread? You've opened two threads which is going to make it hard to track and help your problem.
    n
    l
    • 3
    • 4
  • Can you use the vue devtools inside cypress controlled chrome?
    p

    powerful-gigabyte-69168

    02/08/2023, 3:50 PM
    Generally during development the main reason that I leave cypress and manually open a browser tab is in order to use the vue devtools, which I've been largely unsuccessful in using within a cypress-controlled browser. Is it possible to use the vue devtools within cypress?
    • 1
    • 2
  • searchbox
    a

    adventurous-xylophone-14195

    02/08/2023, 5:03 PM
    I want to automate to get the searchbox and type tv https://www.netonnet.se/ It should be this?
    Copy code
    let searchproduct = "tv";
    describe('NetOnNet Suite', function(){
    
        this.beforeEach(function(){
            cy.visit('www.netonnet.se');
        });
        if('Get Method', function(){
            cy.get('#search-form').type(searchproduct)
            cy.get('#searchSubmit').click();
    });
    e
    • 2
    • 4
  • Please help us to choose the best solution/library/tool for visual testing.
    s

    stale-florist-57929

    02/08/2023, 5:47 PM
    #Visual-Testing #tools #libraries Hello, dear community! Please help us to choose the best solution/library/tool for visual testing with cypress. What is better, raw and local cypress-visual-regression / cypress-image-snapshot or Applitools/Percy/Happo ? Or some others? Our questions are about effectivity, price and also about security with auth data and keeping screenshots on 3d part storages. Thank you!
    s
    • 2
    • 8
  • cy.session to make a login into a backend system
    r

    red-stone-72927

    02/08/2023, 7:15 PM
    the problem I am facing is when I save my credentials for login using sessions as the image below: enter image description here everything looks good but the issue is on the IT brackets with the endpoint url: enter image description here result that this endpont url is the url once you are logged into the backend system but as you see this url changes everytime you make a new logging causing cypress cannot access. So dont know how to solve this problem: enter image description here /(S(xxxxxxxxxxx))/ in the URL this part is the one that changes
    e
    • 2
    • 1
  • Gitlab Runner and Firefox
    n

    narrow-lawyer-36180

    02/09/2023, 12:03 PM
    We are running a pipeline with the latest docker image of Cypress and when we get timeouts on the tests, the entire process freezes up. This only happen when we target Firefox Headless. I have done some testing and see small memory jumps in comparison to Chrome/Edge. Anyone else experienced this?
  • Cypress with Bamboo CI
    m

    melodic-carpenter-21598

    02/09/2023, 12:36 PM
    I'm using Cypress on Bamboo Ci, I have encountered a lot of problems with Bamboo, tests takes lot of time to run , a lot of flaky tests on Bamboo but when i want to reproduce the flaky test with cypress GUI they are working fine. is there any documents for cypress and Bamboo ? any good practices with Bamboo Ci and agents ? Server configuration: Dual Core VM with 16 GB ram
  • I need help on cypress upgrade . please help# upgrade
    a

    ambitious-monkey-72386

    02/09/2023, 1:12 PM
    I am looking for help on upgrading cypress project that was not built by me . It is now in the old version of below 9 and I would want to upgrade to the latest stable version . Please. Guide me on which version I should be choosing to upgrade and also on how to approach . Will it mr smooth or difficult and how long should it take ?
    s
    b
    +2
    • 5
    • 12
  • I installed metamask extension but I Can't login
    c

    cold-nail-59111

    02/09/2023, 1:14 PM
    I installed metamask extension but I Can't login
  • Button exists on DOM and clickable but not showing on UI
    c

    creamy-eve-57054

    02/09/2023, 1:16 PM
    Button exists on DOM and clickable but not showing on UI. Tried adding wait time to fully load the page but still not showing. Running on Cypress 12.2.
    s
    l
    • 3
    • 7
  • Component testing issue with mounting vue custom elements
    j

    jolly-night-56837

    02/09/2023, 2:09 PM
    The issue is, that no styles are injected currently. My test looks like this
    Copy code
    import { NdlNotifications } from "../../ndl-notifications";
    
    describe("NdlNotifications", () => {
      it("renders", () => {
        cy.mount(NdlNotifications);
      });
    });
    The issue is, that the NdlNotifications component is a custom element and has the
    .ce.vue
    file ending. In the test runner it shows that it tries to mount
    NdlNotifications.ce
    My index file for NdlNotifications looks like this
    Copy code
    import { defineCustomElement } from "vue";
    import NdlNotifications from "./NdlNotifications.ce.vue";
    
    export { NdlNotifications };
    
    export function register(tagName = "ndl-notifications") {
      customElements.define(tagName, defineCustomElement(NdlNotifications));
    }
    b
    • 2
    • 4
  • I need help to interact with metamask extension
    c

    cold-nail-59111

    02/09/2023, 2:10 PM
    I download metamask extension but I can't login to my account, I wanna login to my account using anyway api ,cookie or interact with second tab
    b
    v
    • 3
    • 3
  • Working with q-date on Cypress.
    m

    mammoth-animal-49690

    02/09/2023, 2:57 PM
    Hello. I would like to ask how can I work with datepickers using Cypress? I am using Quasar v2 with some restricted dates and I want to be sure that after those restricted dates are turned on user cannot click on restricted date. I can get dates by using cy.get(className).contains(date) but in Quasar q-date all of those fields are divs and I cannot use 'disabled' to verify it. Maybe someone had similar problem? Also how can I set current month to always be February 2023 no matter when the tests will run?
  • Need help with pagination #cypress-recurse
    b

    boundless-pager-73753

    02/09/2023, 3:05 PM
    The element that I'm trying to click becomes not visible(not exists in DOM) at the last iteration My code is:
    Copy code
    recurse(
                () => cy.get('[title="next page"] > .page-link'),
                ($next) => $next.is('hidden'),
                {
                    timeout: 15000,
                    delay: 100,
                    log: true,
                    debugLog: true,
                    post() {
                        cy.get('[title="next page"] > .page-link').click()
                    }
                }
            )
    Cypress is not finding it How to approach that? Thank you #1064946933187235880
    g
    • 2
    • 3
  • Instrumenting Code without Babel
    l

    little-france-10142

    02/09/2023, 3:18 PM
    I'm working on code coverage for an app with e2e and component tests. The project is not using Babel, but Istanbul, Code Coverage, Nyc, all seem reliant on it. Is there a tool, or some steps I can take, to instrument my code without needing to use Babel?
    g
    • 2
    • 2
  • Content-Security-Policy: frame-ancestors 'none' supported?
    r

    rough-businessperson-41883

    02/09/2023, 5:18 PM
    Is https://github.com/cypress-io/cypress/issues/6263 still valid? I cant reproduce any limitation testing web appplicationts that use "Content-Security-Policy: frame-ancestors 'none'" (Cypress: 12.5.1).
  • i got an "Error: connect ECONNREFUSED 127.0.0.1:3333" while trying to get a request response
    d

    delightful-guitar-3252

    02/09/2023, 9:33 PM
    i was creating this command to run before every test, it should send a request and get a 'response.body.id' that i need to login. the project is up and running well, if i remove "before" the test cases run with no problems but i cant login without this value. this is the console: at (http://localhost:3000/__cypress/runner/cypress_runner.js:139749:78) From previous event: at Context.request (http://localhost:3000/__cypress/runner/cypress_runner.js:139746:15) at wrapped (http://localhost:3000/__cypress/runner/cypress_runner.js:151118:43) From Your Spec Code: at Context.eval (webpack:///./cypress/support/commands.js:28:7) From Node.js Internals: RequestError: Error: connect ECONNREFUSED 127.0.0.1:3333 at new r (:1737:501122) at ee.callback (:1737:507123) at e.callback.s.callback [as _callback] (:1737:506569) at s._callback.s.callback.s.callback (:1955:65115) at ee.emit (node:events:527:28) at ee.onRequestError (:1955:74057) at ClientRequest.emit (node:events:539:35) at Socket.socketErrorListener (node:_http_client:454:9) at Socket.emit (node:events:527:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
    l
    • 2
    • 3
1...678...26Latest