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

    ripe-pager-8687

    12/14/2022, 2:03 PM
    oh, I see what is the problem, is an uncaught:exception.. I will fix it
  • g

    gray-kilobyte-89541

    12/14/2022, 2:21 PM
    Yup, if it breaks the test, it will break when the user does it
  • b

    bland-oil-91894

    12/14/2022, 2:29 PM
    In your tsconfig types use "@billions-barista-30103/grep" instead of "cypress-grep". I ran into this same issue. The readme needs to be updated since they switched repos.
  • a

    astonishing-actor-1092

    12/14/2022, 4:40 PM
    Does anyone have used the applitools in Cypress? Because I am getting the error: Failed to construct 'WebSocket': The URL 'wss://localhost:undefined/eyes' is invalid.
  • l

    loose-engine-11181

    12/14/2022, 6:58 PM
    Is this the intended behavior of testIsolation = false in a context? Below is a spec with 2 (or more context blocks).
    Copy code
    describe('Login Test', () => {
      it('Logged in test 1', () => {
        cy.login('user1@example.com', pwd)
        cy.visit('/')
        // Some logged in test steps
      })
      it('Logged in test 2', () => {
        cy.login('user2@example.com', pwd)
        cy.visit('/')
        // Some logged in test steps
      })
    })
    
    describe('Register Test', {testIsolation = false}, () => {
      it('Register new user', () => {
        cy.visit('/register')
        // Expect to register a new user
        // ERROR: We are in user2's session
      })
      it('Validate post registration page 1', () => {
        // Do some validations
      })
    })
  • l

    loose-engine-11181

    12/14/2022, 7:00 PM
    Note the ERROR. I would expect that the new context block has a fresh session, but it's not.
  • t

    thousands-house-85089

    12/14/2022, 10:12 PM
    With testIsolation:false? Yes pretty sure that is expected, since setting it to false does not alter current browser context beforeEach test
  • t

    thousands-house-85089

    12/14/2022, 10:13 PM
    If you want your example to work, you need testIsolation:true (default)
  • t

    thousands-house-85089

    12/14/2022, 10:13 PM
    Then it behaves as beforeEach test - clears page by visiting about:blank - clears cookies in all domains - local storage in all domains - session storage in all domains
  • t

    thousands-house-85089

    12/14/2022, 10:15 PM
    So you won't be in user2's session when executing your 'register new user' test
  • g

    glamorous-oxygen-73293

    12/14/2022, 10:46 PM
    Good Evening. It was suggested I move this question to here . Since I added cypress to my Angular project, In vs code, my intellisense marks all of my Jasmine syntax as incorrect. I am currently using Angular version 14 and Cypress 12.01 By the way the test still run fine in jasmine. This is a purely OCD question I hate underlines in my code.
  • l

    loose-engine-11181

    12/14/2022, 11:46 PM
    The problem with that is that the user2 session is contained in the context with test isolation. I disabled the test isolation for the registration context and I would assume that each context would have it's own session isolation. What's the point in setting testIsolation at the context level if session can bleed from one context to the next?
  • t

    thousands-house-85089

    12/15/2022, 12:12 AM
    Because your login as user2 is the last test in the first context block so the session isn't cleared by a further test in the isolated context. After that it moves on to a new context block where you've disabled test isolation so again it doesn't clear session in beforeeach.
  • t

    thousands-house-85089

    12/15/2022, 12:13 AM
    I don't know why you want to disable test isolation on the register test yet you seem to be expecting an isolated test result.
  • t

    thousands-house-85089

    12/15/2022, 12:15 AM
    I assume you do not want to be in user2's session for the register test so you shouldn't disable test isolation then it can run in a fresh session by doing what I wrote above as a beforeEach.
  • t

    thousands-house-85089

    12/15/2022, 12:19 AM
    Just think of testisolation as a beforeEach and it will make sense. It only executes at the start of a new test not afterwards 🙂
  • t

    thousands-house-85089

    12/15/2022, 12:21 AM
    Oh I think I see what you're trying to do now
  • t

    thousands-house-85089

    12/15/2022, 12:21 AM
    You want to put the disable isolation on the validate test, after register new user.
  • l

    loose-engine-11181

    12/15/2022, 12:22 AM
    I understand what it's doing. I don't feel that that is how it should be. I add testIsolation: false to my context because I don't want session to be cleared between test (just as Cypress.Cookies.preserveOnce() when used in the beforeEach. I want all tests inside the context to share session but not the session from the previous context.
  • t

    thousands-house-85089

    12/15/2022, 12:22 AM
    This is an anti pattern though as your 2nd test will always fail if the 1st one does. Best practice would be to have it all in one test then you don't have to worry about carrying over cookies etc
  • l

    loose-engine-11181

    12/15/2022, 12:24 AM
    I agree. Sadly, I inherited the current suite. I plan to modify specs so that I won't need testIsolation: false anymore, but in the mean time it seemed to me to not work as intended (or at least as I expected it to).
  • t

    thousands-house-85089

    12/15/2022, 12:25 AM
    Yeah I see your point. I think it will do what you want it to if you add the isolation false just on the validate post registration test (rather than the describe)
  • t

    thousands-house-85089

    12/15/2022, 12:28 AM
    It makes sense to me as a beforeEach but if you think it should be different you can always raise it on cypress github issues board 🙂
  • l

    loose-engine-11181

    12/15/2022, 12:30 AM
    Thanks for your time chatting about it. 🙂
  • w

    wide-butcher-68422

    12/15/2022, 6:10 AM
    Can we test Microsoft WCF Services using Cypress ? WCF Services are hosted with various endpoints like BasicHttpBinding, NetTCP, NetMSMQ et. - https://www.c-sharpcorner.com/UploadFile/0c1bb2/endpoints-in-wcf/
  • d

    delightful-waiter-56869

    12/15/2022, 7:47 AM
    I want to continue my test execution even if some of my assertions fail and include those assertion failure in mocha reports. I am currently using chai assertion.
  • b

    bright-caravan-36655

    12/15/2022, 10:16 AM
    Hey guys, I am having problems while running cypress component tests within an NX workspace on an angular application. the tests run normally, the only issue I have is that it does not use my custom webpack configuration. since I am using a yaml-loader in my webpack configuration, I am getting a lot of errors. I already wrote a question on SO. Id appreciate it, if somebody could have a look at it, and give me some pointers 🙂 https://stackoverflow.com/questions/74798642/cypress-component-testing-does-not-use-the-customwebpackconfig-in-nx-workspace-w alternatively: is there a seed-project for component-testing which uses a custom webpack config with angular?
  • s

    straight-microphone-66008

    12/15/2022, 10:37 AM
    Hey guys, I setup cypress and I am trying to run a spec on localhost, basically to visit the localhost http, but I get an error of 404 Unhadled Thworn Error. Did any of you had this issue before and how did you fix it?
  • b

    bright-caravan-36655

    12/15/2022, 10:51 AM
    @straight-microphone-66008 did you supply a baseUrl?
  • m

    millions-scientist-9990

    12/15/2022, 1:06 PM
    How can i get a html object (i have a span that contains buttons) on a sub object. (the span has a sub span with a name that is the identifyer for the span)
1...229230231...252Latest