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

    wooden-megabyte-23794

    10/20/2022, 11:02 AM
    upon running the terminal command
  • w

    wooden-megabyte-23794

    10/20/2022, 11:02 AM
    if i run from dashboard it works fine
  • f

    fresh-doctor-14925

    10/20/2022, 11:02 AM
    I'm going to have to see some screenshots to make sense of this
  • f

    fresh-doctor-14925

    10/20/2022, 11:03 AM
    Sounds to me like it's something you've defined in your commands in
    package.json
    and forgot to update
  • f

    fresh-doctor-14925

    10/20/2022, 11:04 AM
    @wooden-megabyte-23794 can i see your definition for the
    cypress-tags
    command?
  • w

    wooden-megabyte-23794

    10/20/2022, 12:07 PM
    This is my package.json file
  • w

    wooden-megabyte-23794

    10/20/2022, 12:10 PM
    When i run from terminal , this is referring the cypress.json file which doesnt exists , am i missing any config here?
  • w

    wooden-megabyte-23794

    10/20/2022, 12:10 PM
    @fresh-doctor-14925 : Please let me know if any details are needed
  • m

    mysterious-belgium-25713

    10/20/2022, 12:31 PM
    Please add the latest cypress-tags to your project
  • m

    mysterious-belgium-25713

    10/20/2022, 12:32 PM
    You are now using a cached version of cypress-tags
  • m

    mysterious-belgium-25713

    10/20/2022, 12:32 PM
    Because you do npx cypress tags. If it's not in your project it will look for one in your machine
  • m

    mysterious-belgium-25713

    10/20/2022, 12:34 PM
    Also look at this GitHub issue. https://github.com/infosum/cypress-tags/issues/220
  • m

    mysterious-belgium-25713

    10/20/2022, 12:34 PM
    You need to have cypress tags as preprocessor
  • c

    careful-toothbrush-49639

    10/20/2022, 1:31 PM
    Good morning. I am trying to assert a text that contains an apostrophe but keep getting an error. Does anyone know a way around it?
  • a

    adorable-smartphone-87280

    10/20/2022, 1:45 PM
    You could try escaping a character with backslash or using backticks around your whole string (same keyboard key as ~)
  • c

    careful-toothbrush-49639

    10/20/2022, 2:13 PM
    Thanks for your response. Error still persists
  • c

    careful-toothbrush-49639

    10/20/2022, 2:14 PM
    @adorable-smartphone-87280 I used backticks
  • f

    fresh-doctor-14925

    10/20/2022, 2:18 PM
    It's kinda weird to me that you're getting the element with
    cy.contains()
    and a string, and then asserting on that with
    should()
    . If it's not there,
    contains()
    will fail anyhow
  • a

    adorable-smartphone-87280

    10/20/2022, 2:19 PM
    Oh I didn’t even notice that. That’s true this is an anti-pattern.
  • c

    careful-toothbrush-49639

    10/20/2022, 3:32 PM
    I changed it to cy.get('h1') but still getting the same error. Any thing I can do differently?
  • a

    acceptable-hamburger-48790

    10/20/2022, 3:51 PM
    When you say error, what is that error ?
  • a

    adorable-smartphone-87280

    10/20/2022, 5:45 PM
    Detached from DOM maybe?
  • a

    adorable-smartphone-87280

    10/20/2022, 5:45 PM
    Try wrapping it all in a .then() block?
  • c

    careful-toothbrush-49639

    10/20/2022, 6:42 PM
    Can you @adorable-smartphone-87280 please give a sample code of how to go about that?
  • a

    adorable-smartphone-87280

    10/20/2022, 6:50 PM
    Bro you gotta learn to read the docs at some point. https://docs.cypress.io/api/commands/then#Syntax
  • m

    mysterious-belgium-25713

    10/20/2022, 6:56 PM
    Can you remove the should part. First see if your selector works.
  • m

    mysterious-belgium-25713

    10/20/2022, 6:56 PM
    And you can also change the should to have.text instead of contain
  • s

    stale-horse-13605

    10/20/2022, 7:40 PM
    Hi everybody! I have a series of test specs for a web app, all of which require a logged in user. I'm doing the login via API and I have a custom command wrapped in cy.session, all of which works within each test--that is, I only need to log in once per spec file. The problem is that I want the login session to persist across specs, cacheAcrossSpecs=true but all specs after the first fail. It's proprietary code, so I can't show it, but I'm also certain that this is me just not fully understanding it, so if I could get a quick walkthrough w/r/t caching sessions across specs, that'd be great. And no, I DON'T want to use preserveCookies since that's going away (that's where I came from anyway lol)
  • f

    famous-balloon-79136

    10/21/2022, 8:33 AM
    Hi everyone. I have setup eslint + cypress + husky in my react project. I run pre-commit hook(npm run lint:check && npm run test -- --watchAll=false && npm run test:e2e) from 'pre-commit' file present in .husky folder before each commit. Everything works fine when I try to commit with vscode's integrated terminal. But when I try to commit from vscode's source control, eslint and unit tests runs fine but I get an error while running the e2e cypress test(npx cypress run) in the vscode terminal. Find the screenshot of the issue. Any help would be appreciated. Thanks in advance.
  • m

    millions-camera-51383

    10/21/2022, 12:26 PM
    Hi All, Is it possible within cypress to be able to automate a googlepay payment test. Currently when using cypress no popup appears when i click the button to proced to the next step. I have searched online and have not found much help. Is the only way to do this via API if so how would i begin creating it Thanks
1...125126127...192Latest