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

    future-gold-77198

    04/23/2021, 12:13 AM
    So I got past the webpack preprocessor error with the 2 plugins files and the right config in cypress.json. But now I have this issue where the Cypress testing library functions are not found when I expect them too be. The package is installed and it even works for the CT runner, but not for e2e runner. If it matters, this would also happen in our old Cypress 6.8 setup as well. Does the fact that it works for CT but not e2e indicate something obvious? Maybe the way we file preprocess is not playing nice with the library..? I really have no idea, this one really confuses me. @User you don't need to answer this, but I figure you might have the most context.
  • u

    user

    04/23/2021, 1:59 PM
    Hello, I have an issue with Github Actions, when I run my tests into two containers, I only run them for chrome but for some reasons
    electron: headless
    is runned too. But all of my containers passed. And those didn't finishes for some reasons so the Cypress Dashboard is running forever. EDIT: Looks like I'm not alone https://github.com/cypress-io/cypress/issues/16142
  • b

    bulky-sundown-74498

    04/23/2021, 5:39 PM
    The
    findByRole
    error points out directly to testing library not being setup
  • b

    bulky-sundown-74498

    04/23/2021, 5:41 PM
    I would suggest you check the support file for e2e (if it was not customized,
    cypress/support/index.js
    ) where there should be the following import line:
    Copy code
    js
    import "@testing-library/cypress/add-commands"
  • f

    future-gold-77198

    04/23/2021, 5:45 PM
    huh, I thought that was supposed to be done in the support/commands.js file, as they suggest? you mean doing like this on the right though?
  • b

    bulky-sundown-74498

    04/23/2021, 5:46 PM
    No, you are right it is supposed to be done in support/commands
  • b

    bulky-sundown-74498

    04/23/2021, 5:46 PM
    you should see that commmands is actually imported by support/index.js
  • b

    bulky-sundown-74498

    04/23/2021, 5:46 PM
    no need to install it in plugins
  • b

    bulky-sundown-74498

    04/23/2021, 5:47 PM
    What I suspect is that the supportFile flag in cypress.json is pointing to another file
  • f

    future-gold-77198

    04/23/2021, 5:49 PM
    hmm, this is my config now
  • b

    bulky-sundown-74498

    04/23/2021, 5:51 PM
    can you show your support/index.js file ?
  • b

    bulky-sundown-74498

    04/23/2021, 5:52 PM
    or check that it imports the commands
  • b

    bulky-sundown-74498

    04/23/2021, 5:52 PM
    and if it does... well console.log in the commands file
  • f

    future-gold-77198

    04/23/2021, 5:52 PM
    to explain something else in more detail. The old way of running component tests, I would see my e2e tests listed along with my CTs, but I would still be able to run my E2E tests with testing library. So it seems there is something friendly between the CT setup and the testing library. And here is that
  • b

    bulky-sundown-74498

    04/23/2021, 5:53 PM
    you should have 2 support files
  • b

    bulky-sundown-74498

    04/23/2021, 5:54 PM
    because the css imports are not very useful for e2e
  • b

    bulky-sundown-74498

    04/23/2021, 5:54 PM
    and could make them slow, but most importantly break them
  • f

    future-gold-77198

    04/23/2021, 5:54 PM
    ok, just the same idea for the pluginsFile?
  • b

    bulky-sundown-74498

    04/23/2021, 5:58 PM
    exact
  • f

    future-gold-77198

    04/23/2021, 6:04 PM
    Ok, I have this now, which I'm sure will be better long term or for other things, but still not resolving this testing library issue 😦
  • b

    bulky-sundown-74498

    04/23/2021, 6:05 PM
    can you console.log('commands') at the top of the commands file and see if it appears in the console of the browser running the e2e tests
  • f

    future-gold-77198

    04/23/2021, 6:07 PM
    Or I just noticed this, which doesn't look right...?
  • b

    bulky-sundown-74498

    04/23/2021, 6:08 PM
    this is a visual mistake but should not be any difference at runtime
  • s

    stocky-dream-36427

    04/23/2021, 6:09 PM
    Nice catch for the visual mistake.
  • s

    stocky-dream-36427

    04/23/2021, 6:09 PM
    I wish we had a GH issues integration in this discord
  • b

    bulky-sundown-74498

    04/23/2021, 6:09 PM
    ... sure would make creating issues way better
  • s

    stocky-dream-36427

    04/23/2021, 6:09 PM
    We can build it in our free time 😂
  • s

    stocky-dream-36427

    04/23/2021, 6:10 PM
    I wouldn’t fix this because Adam is about to rewrite
  • f

    future-gold-77198

    04/23/2021, 6:10 PM
    Did you mean this exactly, for the console? I don't see any console in the browser with this
  • f

    future-gold-77198

    04/23/2021, 6:11 PM
    just this
1...456...252Latest