https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • u

    user

    06/09/2021, 8:54 AM
    Im finding this tag using xpath()
  • s

    sticky-dentist-24502

    06/09/2021, 9:53 AM
    Hi, I have problem with cypress tests on mobile layout, after click layout is not completely load. How can I resolve this problem. Is there any option wait for load completely layout ? thanks 🙂
  • i

    icy-rainbow-39970

    06/09/2021, 10:50 AM
    You can use getAttribute method
  • u

    user

    06/09/2021, 10:54 AM
    I want to click on first row of a table and check that value with title of new page
  • u

    user

    06/09/2021, 10:54 AM
    So I want to store value from the row and it should match the title
  • w

    wooden-advantage-64510

    06/09/2021, 3:35 PM
    It feels like I'm running into the same issue. How are you setting a mobile layout?
  • g

    gray-kilobyte-89541

    06/10/2021, 1:46 PM
    A new blog post explaining how Cypress and other E2E test runners control the browser https://glebbahmutov.com/blog/cypress-vs-other-test-runners/
  • q

    quick-gpu-68223

    06/11/2021, 2:37 AM
    how do you mock / stub the window location assign in cypress ?
  • q

    quick-gpu-68223

    06/11/2021, 2:38 AM
    Copy code
    cy.window().then(win => {
      const url = cy.stub(win.location, 'assign')
      use url
    })
    it says assign can't be re assign
  • g

    gray-kilobyte-89541

    06/11/2021, 1:03 PM
    you cannot, but see

    https://www.youtube.com/watch?v=mML36U62-fQâ–¾

  • h

    handsome-businessperson-88413

    06/11/2021, 2:15 PM
    Hi, I am using cy.intercept('GET', 'URL').as('TestReq') cy.visit('URL') Cy.wait('@TestReq').then(({response}) => { if(response.statusCode != 200) { cy.reload(); cy.LoginToAppDev(loginURL, user); } }) In some cases, I get azure error, when I see the azure error, I am not seeing the request. I want to know, how to proceed if there is no request in the network
  • f

    future-journalist-95278

    06/12/2021, 2:01 AM
    When using a fixture within
    .intercept()
    like so:
    Copy code
    js
    cy.intercept('GET', 'url/**', {
        fixture: 'data.json',
    })
    Does my fixture data need to represent a proper http response, with fields such as a status code?
  • f

    future-journalist-95278

    06/12/2021, 2:05 AM
    Or can I just include some json data and work with the bare minimum?
  • f

    future-journalist-95278

    06/12/2021, 3:16 AM
    I'm reading there are issues with intercepting requests using SSR frameworks such as NuxtJS and NextJS. Is this true? I can't seem to get any form of
    cy.intercept
    to work within my NuxtJS application.
  • h

    handsome-monitor-89285

    06/13/2021, 7:14 PM
    hey all! I come from capybara / rspec and I'm very used to doing a lot of feature test setup directly with our ORM and database. Based on my limited amount of experience with Cypress, it seems like that's kind of frowned upon and I should instead be interacting with RESTful endpoints. Is that the right perspective, and if not, how are people interacting with their database as part of test setup? I haven't found a convention that I love.
  • h

    handsome-monitor-89285

    06/13/2021, 7:25 PM
    IE stuff like this tells me Cypress doesn't want us mucking around with backend classes / logic from a cy task: https://github.com/cypress-io/cypress-realworld-app/blob/develop/backend/app.ts#L71
  • f

    future-journalist-95278

    06/14/2021, 4:45 PM
    Just a friendly bump 😫
  • s

    stocky-dream-36427

    06/15/2021, 9:14 PM
    Ah. I see. yknow, I should also try to do a Cypress integration for my Nuxt Content site...
  • s

    stocky-dream-36427

    06/15/2021, 9:16 PM
    It's much more performant if you give yourself backdoors into the source code instead of standing up an entire database. You can, of course, stand up an entire database seeded with test data (as you would in rails). DB seeding is something many people do within Cypress in the plugins file. The tradeoff is always access to the backend + frontend codebase (if you maintain it and can easily add test-only hooks) vs if you have to test it as a blackbox. Blackbox is slower, more expensive, and more brittle... but you'll catch an additional layer of issues.
  • s

    stocky-dream-36427

    06/15/2021, 9:17 PM
    If you don't care about catching those top-level issues that might occur if you break the schema (I'm imagining you're short-circuiting the DB if you're mocking out at the REST level), then REST level mocking will be more performant.
  • s

    stocky-dream-36427

    06/15/2021, 9:18 PM
    If you do care, prepare to pay for the DB seeding and maintenance cost of running a live DB on your CI machine, etc.
  • s

    stocky-dream-36427

    06/15/2021, 9:19 PM
    Cypress excels at letting you bypass setting up expensive infrastructure and stubbing whatever you want. It makes testing frontends much more stable and performant. A middle ground is doing some full e2e tests where you stand the DB up, and then the rest is static fixtures or fake REST.
  • s

    stocky-dream-36427

    06/15/2021, 9:20 PM
    You'd still need to pay for the DB migrations + seeding taking a while to run and manage the infra associated with standing a DB up in CI... but you'd be able to catch some of the big "the DB is corrupt, can't use the app at all" issues that will be present if you try to go through the happy path of your application.
  • h

    handsome-monitor-89285

    06/15/2021, 10:18 PM
    Thanks @stocky-dream-36427 I think I will expose an endpoint in test that basically proxies for database factories. Will probably blerg about doing this in tandem with Rosie (a factory bot clone)
  • r

    rich-businessperson-57314

    06/17/2021, 10:32 AM
    Hey, all! I am having troubles running the Cypress tests in Jenkins. Has anyone successfully integrated with Jenkins and can share the knowledge or a link to a working repo + Jenkins build?
  • t

    thankful-lunch-80439

    06/17/2021, 5:48 PM
    How can I wait for DOM changes? I tried waiting for a POST request, though that did not work. I do not want to wait on an abitrary period as the documentation says. The POST request is sent out immediately, and a 200 code is received, though the component does not render. I do not want to use external libraries for a solution.
  • m

    melodic-lifeguard-83850

    06/17/2021, 8:11 PM
    You can set a timeout when getting the element :
    cy.get('input', { timeout: 10000 })
    https://docs.cypress.io/guides/core-concepts/introduction-to-cypress#Timeouts
  • t

    thankful-lunch-80439

    06/17/2021, 9:23 PM
    What if its an element thats on the page that is supposed to change on a POST? Ill grt thr element, tho the data hasnt rendered properly. does the timeout work as a waiting period?
  • c

    cool-application-67821

    06/18/2021, 4:49 AM
    @User I believe when you use .get() on an element it automatically retries for a set number of times kind of like waits for sometime, the timeout you give {10000} is kind of like a max timeout, say if by default .get() did retried untill 15000, if you give {10000} then the retries stop at 10000. Applicable otherwise also
  • c

    cool-application-67821

    06/18/2021, 4:52 AM
    Hey guys When i do a cypress open, I am not able to find the spec file in the browser debugger source. Eg: if i hae a spec file called test-flyout.spec.js when I run this file in cypress open mode, and i do a F12 or ctrl+shift+I and open chrome debugger and go to source tab, i cant find test-flyout.spec.js, however If i keep a console.log() inside the test-flyout.spec.js then I can see it. Am I missing a source map inclusion somewhere?
1...91011...192Latest