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

    great-oil-15113

    12/09/2022, 1:06 AM
    can you show me the whole element including all its children?
    find
    should work even it is not direct child
  • b

    billions-king-35651

    12/09/2022, 1:08 AM
    Check the element in line 2 and the element highlighted in green
  • g

    great-oil-15113

    12/09/2022, 1:18 AM
    the class name of the wrapping div says 'hidden'. is it actually visible? maybe the data-cy is added to the hidden div
  • b

    billions-king-35651

    12/09/2022, 1:20 AM
    it is hidden by default but on large screen, it is no longer hidden
    g
    • 2
    • 4
  • b

    billions-king-35651

    12/09/2022, 1:21 AM
    For mobile screen view, by default it's not hidden but on large screen, it becomes hidden
  • b

    bitter-fountain-36713

    12/09/2022, 1:40 AM
    Have you tried
    .filter(':visible')
    ?
  • b

    billions-king-35651

    12/09/2022, 1:41 AM
    Not sure I know how to use that
  • b

    bitter-fountain-36713

    12/09/2022, 2:23 AM
    Copy code
    // filter only visible elements
    cy.get('selector')
      .filter(':visible')
  • b

    billions-king-35651

    12/09/2022, 2:29 AM
    Will try it. Thanks
  • b

    billions-king-35651

    12/09/2022, 3:06 AM
    Just tried it. Seems to work. Thanks, namesake @bitter-fountain-36713
  • b

    billions-king-35651

    12/09/2022, 3:07 AM
    Thanks @great-oil-15113 for trying to help also. I really appreciate it. I hope I make a lot of progress now.
  • e

    early-photographer-59179

    12/09/2022, 5:35 AM
    Hi everyone,  I'm having a problem with a 2nd window. The button I'm clicking before opening the 2nd window is inside a nested iframe. I have tried a few workarounds such as:  invoke('attr','target','_self') Cypress.Commands.add("set_base", () => {cy.window().then((win) => { win.document.querySelector('base').setAttribute('target', '_self') })}) cy.window().then((win) => { cy.spy(win, 'open').as('redirect');}); but none of them didn’t work. Also, the URL of the new window is not static. Can someone give me a solution for this?
  • e

    early-photographer-59179

    12/09/2022, 5:41 AM
    This is how the 2nd window is opening.
  • e

    early-photographer-59179

    12/09/2022, 5:44 AM
    This is the button I'm clicking before the 2nd window.
  • r

    ripe-daybreak-97926

    12/09/2022, 7:09 AM
    @magnificent-finland-58048 @gray-kilobyte-89541 FYI
  • r

    rough-petabyte-49242

    12/09/2022, 8:58 AM
    Hi All. How can I set to variable in constructor (class) value innerText in middleName?
  • f

    fresh-doctor-14925

    12/09/2022, 9:13 AM
    Hi All How can I set to variable in
  • a

    astonishing-window-24437

    12/09/2022, 9:27 AM
    hi all, with Cypress I can make a select query to an oracle database, but when I try to update the query, the result does not change as I expected. When I execute the same query from DBeaver the result is successful. What should I do to send an update query to oracle database with cypress?
  • d

    damp-kangaroo-1521

    12/09/2022, 11:07 AM
    Hi, Can I write test: "If you see button click on it and continue testing, if not end test without fail"?
  • f

    fresh-doctor-14925

    12/09/2022, 11:08 AM
    https://github.com/bahmutov/cypress-if
  • d

    damp-kangaroo-1521

    12/09/2022, 11:08 AM
    thanks!
  • g

    gray-kilobyte-89541

    12/09/2022, 11:48 AM
    reading https://on.cypress.io/best-practices#Selecting-Elements and https://glebbahmutov.com/cypress-examples/commands/querying.html will save you hours in the long run
  • g

    gray-kilobyte-89541

    12/09/2022, 11:48 AM
    * not working in Cypress v12 yet
  • b

    billions-king-35651

    12/09/2022, 11:53 AM
    I tried this
    data-cy='...'
    . It seems not to be working as expected and I was worried... It's seeing two elements probably because of the hidden version. There seem to be two (although it's the same component - one is shown on mobile while the other on desktop). Adding
    .filter(':visible')
    fix it for me. Thanks
  • b

    billions-king-35651

    12/09/2022, 11:54 AM
    Do we have an alternative for this
    if
    statement. Tried using it also. Not working
  • d

    damp-kangaroo-1521

    12/09/2022, 12:16 PM
    This code will be ok after fix?
    Copy code
    cy.get(".myClass")
          .if("exist")
          .click()
          .else()
          .log("No lesson today");
  • g

    gray-kilobyte-89541

    12/09/2022, 12:30 PM
    sure, you can do everything yourself https://glebbahmutov.com/cypress-examples/9.7.0/recipes/conditional-testing.html
  • g

    gray-kilobyte-89541

    12/09/2022, 12:30 PM
    sure
  • d

    dry-ice-92667

    12/09/2022, 1:33 PM
    Can anyone help me with the configuration to connect with MS-SQL database with cypress ?
  • d

    dry-ice-92667

    12/09/2022, 1:50 PM
    @gray-kilobyte-89541 I am struggling to connect mssql database with cypress v10. Can you please help me with the configuration ?
1...164165166...192Latest