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

    few-hairdresser-35052

    11/02/2022, 4:40 PM
    Hello, where would be the appropriate space to ask for help regarding the Cypress app in Jira? Thanks in advance! Context: It installs fine, but when I click get started I believe there's supposed to be some communication with Cypress and it just errors out. I can provide screenshots and greater context when I figure out where the appropriate place to post is.
  • a

    acceptable-hamburger-48790

    11/02/2022, 5:05 PM
    Are you talking about cypress dashboard app integration with JIRA ? If yes, then it will be #982015401074511912
  • f

    few-hairdresser-35052

    11/02/2022, 5:06 PM
    Thank you!
  • s

    some-napkin-20070

    11/02/2022, 6:40 PM
    Does anyone here have experience with running Cypress Parallelization for an app with AWS Amplify? Thanks!
  • f

    famous-analyst-30680

    11/02/2022, 7:04 PM
    Hello, I just setup Github actions to auto run test when my app is pushed to my main branch. Everything works fine but however my app requires a login and all my login is set using my
    Cypress.env
    which is not pushed to Github. Any Suggestions on how I can get this to work without pushing my .env info?
  • b

    brave-dog-85706

    11/02/2022, 7:24 PM
    you can provide it via environment variables for the actions
  • b

    brave-dog-85706

    11/02/2022, 7:25 PM
    these would "exist" as environment variables when cypress runs in the action, and GitHub will hide it in the logs
  • b

    brave-dog-85706

    11/02/2022, 7:25 PM
    I think it's labeled a secrets in the repo settings?
  • s

    stale-optician-85950

    11/02/2022, 7:28 PM
    Setup GH Secrets as matching env vars that you need in your code https://docs.github.com/en/actions/security-guides/encrypted-secretse
  • s

    stale-optician-85950

    11/02/2022, 10:38 PM
    Setup GH Actions Secrets (admin access to the repo required) as matching env vars that you need in your code https://docs.github.com/en/actions/security-guides/encrypted-secretse and https://docs.cypress.io/guides/continuous-integration/github-actions#Worker-Jobs (shows the
    env
    attribute with env vars) are useful docs.
  • f

    famous-analyst-30680

    11/02/2022, 10:38 PM
    Thank you!
  • i

    icy-alarm-88737

    11/03/2022, 1:14 AM
    anybody familiar with the differences between the following two commands?
    Copy code
    cy.get("span:contains('OK'):visible").click();
    cy.contains("span:visible", "OK").click();
    i understand that
    cy.get
    will return all matching elements and
    cy.contains
    will only return the first, but it must go deeper than that. I found myself in a situation where there are two popup elements, each containing an "OK" button. one popup has
    display:none
    and the other is visible. the cy.get() command works as you would expect, it clicks on the visible OK button. the second one fails, and returns an error that says "the selected element in not visible". if I add
    {force: true}
    to the second case, we confirmed its clicking the OK button in the popup that has
    display:none
    . im failing to understand why
    cy.contains
    is selecting the wrong button and
    cy.get
    is selecting the right one
  • i

    icy-alarm-88737

    11/03/2022, 1:17 AM
    if necessary I can see about setting up a reproduction repo but it will take a non trivial amount of time to set that up so im hoping that somebody is familiar enough with the difference in implementation between these commands that they might have an idea of whats going wrong here.
  • a

    adorable-smartphone-87280

    11/03/2022, 1:17 AM
    I've never seen a
    cy.get
    styled like that.
  • a

    adorable-smartphone-87280

    11/03/2022, 1:18 AM
    I would do:
    Copy code
    cy.get('span:visible').contains('OK').click();
  • a

    adorable-smartphone-87280

    11/03/2022, 1:18 AM
    or something.
  • i

    icy-alarm-88737

    11/03/2022, 1:20 AM
    my understanding is that cy.get parses any jquery style selector, which is where the
    ":contains('text')"
    format is defined
  • i

    icy-alarm-88737

    11/03/2022, 1:20 AM
    my concern is more with why
    cy.contains("span:visible", "OK")
    is failing
  • a

    adorable-smartphone-87280

    11/03/2022, 1:20 AM
    I don't really know jquery very well and try to stick to the simplest implementation of my selectors that I can, and then I rely on chaining to drill down.
  • i

    icy-alarm-88737

    11/03/2022, 1:21 AM
    imo
    cy.contains("span:visible", "OK")
    is the simplest & clearest way to select but its broken, (or at least not doing the thing i would expect)
  • i

    icy-alarm-88737

    11/03/2022, 1:22 AM
    to be clear
    cy.get("span:contains('OK'):visible").click();
    works, and I could leave it at that, but im trying to understand what the difference is here
  • i

    icy-alarm-88737

    11/03/2022, 1:22 AM
    why does one work and the other doesnt. hoping a cypress dev can chime in with some insight into the implementation details
  • i

    icy-alarm-88737

    11/03/2022, 1:23 AM
    not sure who to tag for that
  • a

    adorable-smartphone-87280

    11/03/2022, 1:23 AM
    I don't think
    contains
    works the way you think it does. It's not intended to be passed a selector, it's designed to look for inner text, a number, or a RegEx. https://docs.cypress.io/api/commands/contains#Syntax
  • a

    adorable-smartphone-87280

    11/03/2022, 1:24 AM
    Oh, I'm wrong - it looks like you can pass a selector.
  • a

    adorable-smartphone-87280

    11/03/2022, 1:24 AM
    nvm.
  • a

    adorable-smartphone-87280

    11/03/2022, 1:28 AM
    Maybe
    .get
    works with pseudo-selectors, but
    .contains
    doesn't? That's the only thing I can think of.
  • a

    adorable-smartphone-87280

    11/03/2022, 1:29 AM
    Does
    cy.contains("span", "OK")
    work? It might be an issue only when you append the
    :visible
    ?
  • i

    icy-alarm-88737

    11/03/2022, 1:31 AM
    both
    cy.contains("span", "OK")
    and
    cy.contains("OK")
    fail in the same way as mentioned above. they select the first ok button that they find, which happens to be the wrong one, which has
    display:none
  • a

    adorable-smartphone-87280

    11/03/2022, 1:33 AM
    Ah, well, that makes sense since
    contains
    returns the first element found. My guess is that it doesn't accept the jquery pseudo-selector but I'm not sure why. Might be worth opening an issue on Github over it, if you want a dev response.
1...192193194...252Latest