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

    lemon-hydrogen-58998

    11/29/2022, 11:49 AM
    I would like to be able to run Cypress tests in more than one browser. In my package.json file I have the following scripts:
    Copy code
    "scripts": {
      "dev": "cypress open --browser chrome",
      "test": "jest && cypress run --browser chrome",
    },
    How should I put it to be able to run my tests against two browsers (e.g. Chrome and Firefox)? I tried:
    Copy code
    "scripts": {
      "dev": "cypress open --browser chrome",
      "test": "jest && cypress run --browser chrome &&  cypress run --browser firefoxโ€,
    },
    but it didn't work. Any ideas?
  • f

    fresh-doctor-14925

    11/29/2022, 12:20 PM
    Depends where you're running them. I'd just have two separate commands and run them one after the other. Same in CI. Just have one step for each browser
  • s

    stale-wire-41120

    11/29/2022, 12:23 PM
    I am working on a website and the website is protected with Auth0 ,i am trying to login with gmail on my website but having issue with cross-origin
  • s

    stale-wire-41120

    11/29/2022, 12:23 PM
    Please help me out
  • f

    fresh-doctor-14925

    11/29/2022, 12:28 PM
    !duplicate
  • n

    nutritious-analyst-96582

    11/29/2022, 12:28 PM
    Uh oh, It looks like you have posted the same question in multiple channels. Help us prevent spam by removing any duplicates of your questions, Thanks! ๐Ÿ˜€
  • l

    lemon-hydrogen-58998

    11/29/2022, 12:55 PM
    Yeah, that's one idea, however I would like to have one command to run two browsers one by one (e.g. locally).
  • f

    fresh-doctor-14925

    11/29/2022, 1:26 PM
    I don't believe that's possible
  • p

    proud-city-87954

    11/29/2022, 1:47 PM
    Hi. I wonder if anyone has succeeded with using transloco with cypress component testing? I am unable to provide a mock that cypress will accept as a provider in my class constructor(public constructor: TranslocoService) and then use it in the html for my angular 14 project. Has anyone succeeded with that and could give a hint? I have tried to create my own TranslocoPipeMock, which it complains over but with no success.
  • j

    jolly-glass-61422

    11/29/2022, 1:51 PM
    Anyone here experience cypress error on chrome 107.0.5304.121?
  • s

    stale-wire-41120

    11/29/2022, 2:04 PM
    @fresh-doctor-14925 ๐Ÿ˜€ so why didn't you help me
  • f

    fresh-doctor-14925

    11/29/2022, 2:14 PM
    Because I have replied in the other channel
  • f

    fresh-doctor-14925

    11/29/2022, 2:20 PM
    Not sure. You may have more luck in the #755921564108587038 or #823985226320707584 channel, given that it's quite a specific use case
  • s

    stocky-helmet-50407

    11/29/2022, 2:27 PM
    We're struggling to test our UI that is relatively dynamic with the DOM changing based on data received from GraphQL subscription through websocket. We often see errors such as โ€œthe selected item is detached from DOM treeโ€. I wonder if we're missing a best practice in our approach of if Cypress isn't really built to handle such UIs. Help please.
  • g

    gray-kilobyte-89541

    11/29/2022, 2:33 PM
    you are trying to interact with your app while it keeps re-rendering. Something like https://glebbahmutov.com/blog/cypress-tips-and-tricks/#wait-for-network-idle is what we use at work to wait for the graphql to finish its calls
  • f

    fierce-terabyte-72718

    11/29/2022, 4:40 PM
    What to do to fix this? > cypress open libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) [934181:1129/083805.379269:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported. [933986:1129/083806.354447:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
  • f

    fresh-doctor-14925

    11/29/2022, 4:56 PM
    !duplicate
  • n

    nutritious-analyst-96582

    11/29/2022, 4:56 PM
    Uh oh, It looks like you have posted the same question in multiple channels. Help us prevent spam by removing any duplicates of your questions, Thanks! ๐Ÿ˜€
  • f

    fierce-terabyte-72718

    11/29/2022, 5:06 PM
    ok i removed the duplicate.
  • h

    happy-megabyte-98400

    11/29/2022, 5:36 PM
    Hello, I'm trying to write a custom command that is chained off a list of elements and returns a random element. I want it to behave just like
    .first()
    , problem is i don't know how. Can someone help me with this?
  • i

    incalculable-airport-62535

    11/29/2022, 6:29 PM
    hi all, I'm trying to intercept a request to simulate the error response code, it seems to be only working for me when I use cy.visit but not for cy.request. Is there any way to work make it work with cy.request ?
  • b

    bitter-fountain-36713

    11/29/2022, 6:49 PM
    You cannot .intercept() a .request() you make. Pull from the docs:
    Copy code
    cy.intercept() cannot be debugged using cy.request()! Cypress only intercepts requests made by your front-end application.
    Are you trying to simulate what your frontend will handle error response codes?
  • i

    incalculable-airport-62535

    11/29/2022, 6:53 PM
    yeah, I'm trying to see how frontend will show when there is some network problem. But in case I use cy.visit it shows error- This was considered a failure because responses must have content-type: 'text/html' However, you can likely use cy.request() instead of cy.visit().
  • b

    bitter-fountain-36713

    11/29/2022, 7:02 PM
    You can stub the response in your matching intercept with using
    req.reply()
    . Here is more information on the docs. https://docs.cypress.io/api/commands/intercept#Request-Response-Modification-with-routeHandler
  • h

    happy-megabyte-98400

    11/29/2022, 7:10 PM
    Anyone please? ๐Ÿ™
  • b

    bitter-fountain-36713

    11/29/2022, 7:15 PM
    Have you checked out the docs for creating custom child commands? https://docs.cypress.io/api/cypress-api/custom-commands#Child-Commands
  • c

    curved-father-48262

    11/29/2022, 7:16 PM
    having trouble with Cypress.dayjs ''' In my support/e2e.js file const dayjs = require('dayjs') Cypress.dayjs = dayjs In my package.json "dayjs": "^1.11.6", "dayjs-random": "^1.0.1", ERROR Property 'dayjs' does not exist on type 'Cypress & CyEventEmitter'.ts(2339) '''
  • h

    happy-megabyte-98400

    11/29/2022, 7:21 PM
    @bitter-fountain-36713 yes i did read that and i do have a working code. well sorta. My current implementation is flaky at best and does not have any assertions. And, idk how to add the 'Yielded' part to the log or a timeout.
  • b

    bitter-fountain-36713

    11/29/2022, 7:31 PM
    @happy-megabyte-98400 It would help us if you share your code.
  • g

    gray-kilobyte-89541

    11/29/2022, 7:37 PM
    Search https://cypress.tips/search for "random element"
1...216217218...252Latest