https://cypress.io logo
Join DiscordCommunities
Powered by
# general-chat
  • t

    thankful-wire-37848

    12/15/2022, 10:03 AM
    Not sure what you specifically want to test but there is the kitchen sink example website (https://example.cypress.io/) for demonstration purposes. You can also fork and adapt this to your needs: https://github.com/cypress-io/cypress-example-kitchensink
  • a

    adventurous-eve-81295

    12/15/2022, 11:09 AM
    how can I check for the result of how many elements the cy.find() returns ?
  • a

    adventurous-eve-81295

    12/15/2022, 11:09 AM
    this information is missing on the API
  • t

    thankful-wire-37848

    12/15/2022, 11:17 AM
    That should be logged in the command log and the console output: https://docs.cypress.io/api/commands/find#Command-Log
  • g

    gray-kilobyte-89541

    12/15/2022, 11:47 AM
    You have a lot more examples at https://glebbahmutov.com/cypress-examples (with playground at https://github.com/bahmutov/cypress-examples)
  • g

    gray-kilobyte-89541

    12/15/2022, 11:48 AM
    cy.().find(...).its('length')
    gives you the immediate number, but you probably want to assert something like
    cy.get().find(...).should('have.length.greaterThan', 10).its('length').then(n => ...)
  • b

    better-room-47176

    12/15/2022, 11:49 AM
    Hi guys! Good morning, how you all doing?
  • b

    better-room-47176

    12/15/2022, 11:50 AM
    I am migrating cypress from the 9.7 to 12.0 version, and Cookies.preserveOnce is deprecated and was removed. In order to use the session, how should I map my previous implementation to the current one? previously I had: cy.Cookies.preserveOnce('session_id', 'cookie1', 'cookie2', 'cookie3', 'cookie4', 'token')
  • b

    better-room-47176

    12/15/2022, 11:51 AM
    I can't find correct documentation on direct mapping between previous implementation for the new one
  • g

    gray-kilobyte-89541

    12/15/2022, 11:51 AM
    or use https://github.com/bahmutov/cypress-v10-preserve-cookie
  • b

    better-room-47176

    12/15/2022, 11:52 AM
    I can't install these independant packages on my project :/
  • b

    better-room-47176

    12/15/2022, 11:52 AM
    I've also tried this out, it works, but I can't deliver with this package
  • f

    fresh-doctor-14925

    12/15/2022, 11:54 AM
    In that case, why not use
    cy.session()
    ? That's what the previous cookie api was deprecated in favour of
  • b

    better-room-47176

    12/15/2022, 11:55 AM
    for instance, here in the doc for the migration (https://docs.cypress.io/guides/references/migration-guide#Command-Cypress-API-Changes) we have this:
  • b

    better-room-47176

    12/15/2022, 11:55 AM
    but I can't understand how the mappings of "remember_token" and "session_id" are done
  • b

    better-room-47176

    12/15/2022, 11:58 AM
    Neither the property cacheAcrossSpecs exists...
  • b

    better-room-47176

    12/15/2022, 11:59 AM
    so how do I map from this: cy.Cookies.preserveOnce('session_id', 'cookie1', 'cookie2', 'cookie3', 'cookie4', 'token') to cy.session() ?
  • a

    adventurous-eve-81295

    12/15/2022, 12:11 PM
    @gray-kilobyte-89541 not really helpful I mean... how hard can it be to press a button and then wait 2 secs as long as there is buttons ?
  • a

    adventurous-eve-81295

    12/15/2022, 12:11 PM
    really frustrating
  • a

    adventurous-eve-81295

    12/15/2022, 12:14 PM
    every time I press a button... there will be an call to the BE to delete something... after its deleted it will update the list and another delete button should be pressed until no more delete buttons are available... this seams quite impossible to do in a way that works reliably
  • a

    adventurous-eve-81295

    12/15/2022, 12:14 PM
    it sounds simple when you describe it... yet its so hard to do
  • f

    fresh-doctor-14925

    12/15/2022, 12:32 PM
    The docs explain it pretty clearly. Session takes care of all the cookies without having to specify https://docs.cypress.io/api/commands/session#Syntax
  • g

    gray-kilobyte-89541

    12/15/2022, 12:38 PM
    what is not helpful? I mean your question is literally what these examples show. Ok, if you want "how hard is it to press a button and then wait 2 secs as long as there is buttons" is 1 liner hard
    cy.get('button').click().should('not.exist')
  • i

    incalculable-honey-17833

    12/15/2022, 1:40 PM
    Hi there! Is it possible to make #958013993425960971 and #971437044163289188 to announcements channel type, so we can follow it from other servers? ๐Ÿ‘€
  • l

    late-planet-4481

    12/15/2022, 2:48 PM
    A few pointers... 1. In the Test Runner you can review the results of any Cypress command by clicking it in the log, then looking at the Console output in the Dev Tools window. (Example here: https://docs.cypress.io/api/commands/find#Command-Log) 2. If your command returned multiple results, you can use
    .eq(x)
    to pick one by index, or you can use
    .each()
    to iterate over each of them. So here's an example for you:
    Copy code
    js
    cy.get('.button').find('.blueBorder').each(($el) => {
      cy.wrap($el).click()
    })
  • l

    late-planet-4481

    12/15/2022, 3:02 PM
    > there will be an call to the BE to delete something... after its deleted it will update the list and another delete button should be pressed until no more delete buttons are available Also, if you want to wait for the list to update there are a number of tricks you can do, but they are all dependent on your unique situation. I'm suspecting you could probably make use of
    cy.intercept()
    in this case. Something like this...
    Copy code
    js
    cy.intercept('yourXhrCallToDeleteARow').as('delete')
    cy.get('.button').find('.blueBorder').each(($el) => {
      cy.wrap($el).click()
      cy.wait('@delete')
    })
  • g

    gray-kilobyte-89541

    12/15/2022, 4:11 PM
    Read my blog post "Run Just The Failed Tests In Cypress" https://glebbahmutov.com/blog/run-failed-tests/
  • a

    abundant-tailor-4878

    12/15/2022, 9:04 PM
    Hi Everyone, any idea why I am NOT seeing at which line my code failed? after Cypress 12 migration the debug line its not displayed anymore and its not easy anymore to find the line where it failed๐Ÿ‘€
  • a

    abundant-tailor-4878

    12/15/2022, 9:07 PM
    this is how it used to be displayed before migrating to cy 12, which was really easy to find the issue
  • i

    incalculable-rainbow-43330

    12/16/2022, 7:28 AM
    @gray-kilobyte-89541 perfect this was very helpful Thank you you rock ๐Ÿ™‚
1...101102103...127Latest