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

    ambitious-monkey-72386

    11/04/2022, 10:01 AM
    But nothing worked
  • a

    ambitious-monkey-72386

    11/04/2022, 10:01 AM
    Can someone suggest a solution
  • a

    ambitious-monkey-72386

    11/04/2022, 10:01 AM
    Why is not the drag happening
  • h

    helpful-twilight-57608

    11/04/2022, 10:28 AM
    Hey all, I have just started trying out component testing and I think I have probably chosen the most complicated thing to try it with. My component has an onClick which uses a useNavigate (react-routetr-dom) to navigate to "/". I am wondering how I can test, from within a component test, that the navigation was actually attempted? I have a custom mount command which wraps the mounted component in a memory router at present
  • f

    fierce-beach-68131

    11/04/2022, 11:21 AM
    Hello, I want to send a POST request, but for the first time I encounter the "Request Payload" section. Normally, when sending a POST request, I send it with a "body" or "query string" as you can see in the "vsCode" screenshot. Does anyone know what should I do in this case?
  • h

    helpful-twilight-57608

    11/04/2022, 11:50 AM
    So I found a solution to my problem: In my mount command I added a param for additional routes to be added to the memory router
    Copy code
    Cypress.Commands.add('mount', (component, componentPath, additionalRoutes, options = {}) => {
      const { routerProps = { initialEntries: ['/'] }, ...mountOptions } = options
    
      const wrapped = <MemoryRouter {...routerProps}>
        <Routes>
          <Route path={componentPath} element={component} />
          {additionalRoutes}
        </Routes>
      </MemoryRouter>
    
      return mount(wrapped, mountOptions)
    })
    Then when I called the mount command I added an additional route with some text that I can does or does not exist (meaning I am or am not on a different page)
    Copy code
    cy.mount(<MyComponent />, '/my-component-path',
            <Route path="/" element={<div>home page</div>}/>,
    {routerProps: {initialEntries: ['/my-component-path']}}
        )
    Copy code
    cy.contains('home page').should('not.exist');
          cy.get('img').click();
          cy.contains('home page').should('exist');
    šŸ™‚
  • e

    early-article-61542

    11/04/2022, 12:22 PM
    I know this discord is about cypress. But i wonder if someone has been able to achieve the google authentification with playwright. I am able to do it with cypress but could not find a clue with playwright https://github.com/microsoft/playwright/discussions/18402
  • f

    full-application-86498

    11/04/2022, 1:08 PM
    Hi everyone I have an element for which I need to check style and text. I found how to do it but it looks huge. I'm very new in a cypress and might don't know anything, how can I avoid all those .find.find.find. thing for example? > cy.get('[id="cke_3_contents"]').find('[class="WordSection1"]').eq(1).find('[class="OSIVDAbsatz"]') > .find('span').should('include.text', 'Sehr geehrte Frau Eing') > .and('have.css', 'background').should('include', 'rgb(255, 255, 0)')
  • f

    future-activity-69925

    11/04/2022, 2:07 PM
    Hey Everyone! Looking for some help around upgrading our cypress plan from free to team, we need to add a VAT number and company information to the invoices and I cannot find these fields on the checkout form. If someone has experience with this, please let me know!
  • a

    adorable-smartphone-87280

    11/04/2022, 2:31 PM
    This sounds like a problem of UK/US business rules mis-matching.
  • a

    adorable-optician-37575

    11/04/2022, 3:31 PM
    hey folks! Wonder if anyone knows if there is a way to run selected tests multiple times in parallel with Cypress? Like running spec.js 50 times with parallelization enabled.
  • b

    best-flower-17510

    11/04/2022, 3:31 PM
    billing@cypress.io would be your best bet! šŸ˜‰
  • m

    mammoth-london-89983

    11/04/2022, 5:38 PM
    Hi everyone! Does anybody have experience or setup datadog with cypress? Found documentation in datadog but aren't very useful on how to do it. Any info is appreciated. Link: https://docs.datadoghq.com/continuous_integration/guides/rum_integration/
  • q

    quaint-agency-3022

    11/04/2022, 6:53 PM
    Am currently having issues with the Microsoft login page where it takes over the local host. I've tried to see if there is some way to pre login before it would ask me to login but to no avail.
  • c

    cold-terabyte-52337

    11/04/2022, 8:30 PM
    you should be able to login to microsoft by setting the
    experimentalModifyObstructiveThirdPartyCode
    flag and using
    cy.origin
    https://docs.cypress.io/guides/references/experiments#Configuration https://docs.cypress.io/api/commands/origin
  • w

    wooden-glass-9489

    11/04/2022, 11:04 PM
    Hello Everyone, I'm trying to login to an app and then re-directing to an internal website, Re-direction to internal website is failing with the error > System is not defined and page is blank. Locally it works fine only failing on Azure cloud server, can someone provide possible solution. Appreciate your help !! Here is the login Logic cy.visit(data.loginUrl) cy.get('#initEmail').type(data.email) cy.contains('Next').should('exist').click().wait(500) cy.get('.a-text-input').type(data.password) cy.get(':nth-child(1) > .a-btn').click().wait(500) Redirecting to internal site as - cy.origin(data.url, () => {cy.visit('/').wait(500) }) cy.log('Before Each Block - End') In Support file logic to handle uncaught exception is enable In config file - experimentalSessionAndOrigin: true and experimentalModifyObstructiveThirdPartyCode: true, Cypress package version: 10.11.0 Cypress binary version: 10.11.0 Electron version: 21.0.0 Bundled Node version: 16.16.0
  • f

    fancy-mechanic-10638

    11/04/2022, 11:28 PM
    I have a table with two column, and I want to ensure the second column is disabled, then type into the first column, then see the second column is no longer disabled. It seems like I do a
    cy.get().then
    against the table, then do a
    cy.wrap(table).find
    for the first column I care about, then inside that do another
    cy.wrap(table).find
    for the second column I care about, then then I can do my checks. That's a bunch of nesting. Feels like I must be doing something wrong.
  • f

    fancy-mechanic-10638

    11/04/2022, 11:36 PM
    Why does
    cy.get('table').its('rows').should('have.length', 2)
    fail to find the propery, but
    cy.get('table').then(table => expect(Cypress.$(table).prop('rows')).to.have.length(2)
    work correctly? Aren't they doing the same thing?
  • g

    gray-kilobyte-89541

    11/05/2022, 5:19 PM
    Can you provide fiddle / HTML showing what gets enabled / disabled?
  • r

    red-toddler-79937

    11/06/2022, 1:20 PM
    Hi, how can I return a variable in cypress? Basically I got this: ` cy.wait('@loginResponse')`` And I want to return
    @loginResponse
    cuz it contains the data
  • g

    gray-kilobyte-89541

    11/06/2022, 1:21 PM
    you pass it on to the next step using
    cy.then
    or an alias
  • m

    many-animal-60948

    11/06/2022, 1:38 PM
    Are there any known network issues with electron? I'm running into a webpack ChunkLoadError that only happens in electron. If I run the same test suite in edge, chrome or firefox it works fine.
  • r

    red-toddler-79937

    11/06/2022, 1:44 PM
    Copy code
    return cy.get('@loginResponse').its('response.body.data');
    is there a way to return this without the type being undefined?
  • r

    red-toddler-79937

    11/06/2022, 1:45 PM
    "Conversion of type 'Chainable' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.ts(2352)" I guess I got to give this "Chainable" a datatype, how do I do that
  • r

    red-toddler-79937

    11/06/2022, 1:46 PM
    ah i fixed it
  • h

    helpful-dress-32337

    11/06/2022, 4:01 PM
    hello everyone, im trying to use drag and drop between a website and an iframe. I tried doing it with mouse events
    cy.get('elementId').trigger('mousedown', { button: 0 }).trigger('mousemove', x, y }).trigger('mouseup', { button:0 })
    but its not working, the test passes but the drag and drop doesnt succeed, im pretty sure the mouse moves where its supposed to go but when the mouseup event happens it returns to the elementId position for some reason? ( i also tried it on w3s website and it doesnt work, so the iframe is not the reason. i also tried using realevents, it didnt work )
  • h

    helpful-dress-32337

    11/06/2022, 4:05 PM
    The second way i tried to make the drag&drop work was this:
    Copy code
    const getIframeDocument = () => {
      return cy.get(".gjs-frame").its("0.contentDocument").should("exist");
    };
    
    const getIframeBody = () => {
      // get the document
      return (
        getIframeDocument()
          // automatically retries until body is loaded
          .its("body")
          .should("not.be.undefined")
          // wraps "body" DOM element to allow
          // chaining more Cypress commands, like ".find(...)"
          .then(cy.wrap)
      );
    };
    
    getIframeBody().find("#wrapper").as("Target");
    cy.get('[title="Url"]').drag("@Target");
    but i get uncaught exception, cannot read properties of getsetData anyone can help?
  • s

    stale-optician-85950

    11/06/2022, 6:12 PM
    This is my experience getting drag & drop working https://discord.com/channels/755913899261296641/763105090679865354/1032041166922842112
  • w

    white-army-50288

    11/07/2022, 8:35 AM
    Hello everyone, I have simple question that I was not able to find the answer online, I have a project which I run frontend in VS code where I have Cypress installed and the backed is run through Docker. My question is: Can I add API testing for backend on the same project? Maybe to have Integration folder and a separate folder API, I created both of them, but I can't find the API folder as it was not set up initially. Thanks a lot.
  • a

    alert-tomato-11305

    11/07/2022, 8:39 AM
    Hi All, I am tring to integrate code coverage with cypress, it is working fine in local but in travis it is showing only found unit test code coverage, can anyone help with this.
1...195196197...252Latest