https://cypress.io logo
Join Discord
Powered by
# general-chat
  • u

    user

    09/09/2021, 12:35 PM
    only now terminal-log plugin isn't working but ignoring that for now
  • f

    fast-action-74989

    09/09/2021, 1:24 PM
    thank you so much again, I still disturb you for one thing
  • f

    fast-action-74989

    09/09/2021, 1:26 PM
    I have to run the tests from the terminal, using the command npm run cy: run, and I would need to see console errors from the terminal somehow, or get a screen like when a test fails. is it possible to do it somehow?
  • f

    fast-action-74989

    09/09/2021, 1:27 PM
    like see the cy.stub list in the terminal
  • s

    stocky-honey-66894

    09/09/2021, 4:58 PM
    Hi All, I am noticing that latest Chrome browser 93 is crashing with cypress. Is there a workaround to this?
  • s

    stocky-honey-66894

    09/09/2021, 4:59 PM
    I have 8.3.1 installed
  • s

    stocky-honey-66894

    09/09/2021, 4:59 PM
    running against firefox 90 is working fine
  • k

    kind-minister-59159

    09/10/2021, 2:15 AM
    Is there anyone here that might help me with conditional testing with cypress? Or know of a workaround?
  • b

    bulky-sundown-74498

    09/10/2021, 4:49 PM
    @User what do you call conditional testing?
  • b

    bulky-sundown-74498

    09/10/2021, 4:50 PM
    - Tests that run in your CI only when files are changed? - Tests that depend on the result of another tests? - Tests with conditional branches?
  • b

    bulky-sundown-74498

    09/10/2021, 4:51 PM
    @User what error do you see?
  • k

    kind-minister-59159

    09/10/2021, 6:54 PM
    I have a lesson that I need to play through. The problem that I am seeing is that all the questions are random and I don't know what order they are in. I added conditional testing to see if there are certain elements on the page. Everywhere I've looked it says this is an anti pattern and not recommended. Are there other workarounds that might be better that I could use?
  • b

    bulky-sundown-74498

    09/10/2021, 6:56 PM
    Where do the questions come from? And API you could mock? A library stored in the state that you could manually set?
  • b

    bulky-sundown-74498

    09/10/2021, 6:56 PM
    Random stuff is hard to test 😉
  • b

    bulky-sundown-74498

    09/10/2021, 6:57 PM
    So let's test everything else, then introduce the random thing
  • k

    kind-minister-59159

    09/10/2021, 6:57 PM
    Seriously though! so hard. I know that the developers on the team don't want the questions to be mocked. Looking at the request there is 1 request for each question. Each section has 5 questions.
  • k

    kind-minister-59159

    09/10/2021, 6:58 PM
    I was trying to mock the activity information but I need to test the lesson with a new user every time the test runs. So I wouldn't be able to mock some of the requests because they require User and session ID.
  • k

    kind-minister-59159

    09/10/2021, 6:58 PM
    Is it possible to have dynamic data in a mock?
  • b

    bulky-sundown-74498

    09/10/2021, 7:04 PM
    it is possible but I am not sure you want to. Each test you write, has to assert stable statements like "can you find the "My Question" text in the page" or "is there a button I can click on". You could intercept the requests and test that what you intercepted corresponds to what is displayed, but this needs the intervention of the server. I would separate the rendering test from the integration tests
  • b

    bulky-sundown-74498

    09/10/2021, 7:06 PM
    I would write one test to see if with a determined set of questions returned by the API is rendering as you would expect
  • b

    bulky-sundown-74498

    09/10/2021, 7:06 PM
    Then another test with no mocking of anything and check that "it renders without errors"
  • b

    bulky-sundown-74498

    09/10/2021, 7:07 PM
    This way you can validate both the rendering and the API call
  • k

    kind-minister-59159

    09/10/2021, 7:08 PM
    That makes sense thanks! So to test if I can answer the questions would you recommend that I mock the questions that I receive and test that I can submit those?
  • k

    kind-minister-59159

    09/10/2021, 7:08 PM
    and then have a test to make sure everything renders without errors?
  • b

    bulky-sundown-74498

    09/10/2021, 7:11 PM
    Exactly
  • b

    bulky-sundown-74498

    09/10/2021, 7:12 PM
    You can even test that you can answer the first question you find with an answer, ignoring the correctness of the answer
  • b

    bulky-sundown-74498

    09/10/2021, 7:12 PM
    but for the conditional answers, I would mock a set of questions
  • b

    bulky-sundown-74498

    09/10/2021, 7:13 PM
    It will make your tests more stable and more targeted. From experience, it is usually when they give the most info
  • k

    kind-minister-59159

    09/10/2021, 7:14 PM
    Sounds great thanks so much for your help. I just got moved to a team where were starting to use Cypress from scratch so I'm getting used to best Practices.
  • r

    rapid-laptop-3825

    09/13/2021, 2:58 PM
    i have a login spec that I want to reuse on other tests, how can I address that?
1...151617...127Latest