https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • p

    polite-alarm-78904

    06/17/2022, 11:29 AM
    turns out scroll into view fixed it `cy.getBySel(
    selfcerts-item-${id}
    ) .scrollIntoView() .should("be.visible")`
  • a

    adorable-stone-42197

    06/17/2022, 11:45 AM
    Hey guys, is someone test autocomplete? Maybe etc to type some easy query type ( when you try to type select than autocomplete appears and choose SELECT? If someone have example to share
  • r

    red-toddler-79937

    06/17/2022, 12:56 PM
    Fixed it, you can see it in the chat, lmk if you have any questions after that
  • c

    careful-tent-30457

    06/17/2022, 1:44 PM
    Hi, why do I get the Error "No element found that matches selector [data-cy-root]" when I run in e2e mode?
  • c

    careful-tent-30457

    06/17/2022, 1:48 PM
    I just upgraded from 9.5.4 to 10.1.0
  • g

    gray-kilobyte-89541

    06/17/2022, 2:13 PM
    Because I cover it in my free videos πŸ™‚ https://glebbahmutov.com/blog/code-coverage-for-chat-tests/#mock-socket-spec

    https://www.youtube.com/watch?v=soNyOqpi_gQβ–Ύ

    and https://github.com/bahmutov/cypress-socketio-chat
  • g

    gray-kilobyte-89541

    06/17/2022, 2:13 PM
    https://www.cypress.io/blog/2020/03/20/working-with-select-elements-and-select2-widgets-in-cypress/
  • s

    swift-kitchen-62493

    06/17/2022, 3:24 PM
    how can i press button with div class?
  • f

    fresh-doctor-14925

    06/17/2022, 3:59 PM
    .Get some test ids on the div, for starters Then to actually click the button, you may need to pass in
    {force: true}
  • s

    swift-kitchen-62493

    06/17/2022, 4:01 PM
    daamn, how can I do that, I don't have such a knowladge
  • f

    fresh-doctor-14925

    06/17/2022, 4:05 PM
    Ask one of your developers or look into doing some web development courses. Will be helpful in the long run
  • f

    fresh-doctor-14925

    06/17/2022, 4:06 PM
    It’s basically the same as if you were adding an ID to the element
  • m

    modern-addition-58981

    06/17/2022, 5:24 PM
    How to create seperate class for token generator and use the generated token in test cases
  • b

    bitter-fountain-36713

    06/17/2022, 6:28 PM
    user agent
  • m

    magnificent-finland-58048

    06/17/2022, 6:52 PM
    this course will show you https://learn.cypress.io/tutorials
  • m

    magnificent-finland-58048

    06/17/2022, 6:53 PM
    maybe the token stuff here can answer at least a part of the question https://dev.to/muratkeremozcan/crud-api-testing-a-deployed-service-with-cypress-using-cy-api-spok-cypress-data-session-cypress-each-4mlg
  • b

    bitter-fountain-36713

    06/17/2022, 7:09 PM
    For now, you can use
    cy.contains('div','your text here)
    with the text of the button. NOTE:
    cy.contains()
    will get the first matching element in the DOM so use whatever selectors you may need to match the one you need.
  • a

    aloof-beach-98822

    06/17/2022, 9:26 PM
    Hi, I need to use Cypress to first search a random product from a website. When I did this, it leads me to the corresponding product listing page which shows 24 products matching that product type. Then I need to select one of those products randomly as well and add to cart. I was able to do the first part to search for a random product. But I am trying to figure out how to pick one out of the 24 products from the page and add to cart. Please advise if there are suggestions.
  • b

    bitter-fountain-36713

    06/17/2022, 11:39 PM
    You can get the array of elements corresponding to the products listed on the page, then use
    Cypress._.random(0, 23)
    to get a random number from 1 to 24. Then use the random number to get the corresponding index of the array.
  • a

    aloof-beach-98822

    06/18/2022, 2:58 AM
    `Thank you!
  • f

    fresh-doctor-14925

    06/18/2022, 9:03 AM
    .contains('div', 'text')
    combined with
    .click()
    is super helpful for quick fixes, note that Josh said "For now" πŸ™‚ Try not to become too reliant on this approach, though. Otherwise you'll spend most of your time updating tests that are failing due to strings being changed
  • c

    careful-tent-30457

    06/18/2022, 10:56 AM
    This was my own fault for declaring my "mount" method in the
    cypress/support/commands
    file. thought ppl would like to know
  • g

    gray-kilobyte-89541

    06/18/2022, 1:04 PM
    Search https://cypress.tips/search for "random" to find my example, I should update it to just pick a random index and then use it with
    eq
    command like @bitter-fountain-36713 wrote. Here it is https://github.com/bahmutov/cypress-examples/commit/3b62f408692994a07beac058509ca863c42c4d9d
  • a

    aloof-beach-98822

    06/18/2022, 7:57 PM
    Thank you so much!
  • m

    mammoth-manchester-71430

    06/19/2022, 4:21 PM
    How to configure testfiles in cypress 10.1.0
  • m

    mammoth-manchester-71430

    06/19/2022, 4:27 PM
    I have configured in cypress.config.js as e2e{ SpecPatter : '**/*. feature' } But while running with the command - npm run test It returns no test files If run with the command npx cypress run c:/users/cypautomation/**/* ( specific path) it runs only the login.cy.js file
  • m

    mammoth-manchester-71430

    06/20/2022, 3:33 AM
    ReferenceError: The following error originated from your test code, not from Cypress. > Given is not defined
  • n

    nice-businessperson-99732

    06/20/2022, 9:04 AM
    Hi All, I'm new to cypress...I got stuck with an issue When we enter email and click on a submit button... 1. If non-test user, then in the same page password input field will be displayed...Then enter password and click on submit....It is redirecting to page expired screen 2. If test user, once after entering email and click on submit, page is keep on loading...........But should redirect to OneIdentity login page for password Can anyone please help me to solve this?
  • g

    green-book-63455

    06/20/2022, 9:15 AM
    With regard to cy.request to login and the contents of the body, should this be { id_of_username_element_on_page: "value", id_of_pw_element_on_page: "value" } or { user_field_name_in_server: "value" same for password }
  • n

    nice-businessperson-99732

    06/20/2022, 9:26 AM
    cy.get('#userInput').type(name) cy.get('#login-button').click() cy.get('#passwordInput').type(password) cy.get('#login-button').click() This is my code snippet
1...545556...192Latest