https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • a

    acceptable-hamburger-48790

    09/09/2022, 4:17 PM
    Did you check the instructions in in that repo ? they have examples too
  • n

    nutritious-army-46708

    09/09/2022, 4:19 PM
    got it! Thank you so much!
  • h

    handsome-dress-30825

    09/09/2022, 5:59 PM
    Can anyone help me out with this? https://stackoverflow.com/questions/73576004/cypress-behaves-differently-when-the-devtools-are-opened I’ve been struggling with it for over a month now. The login form is on a different super-domain, which redirects to our application. And this only happens when we try to sign out. I’ve tried with waiting for all of the requests to finish before logging out, tried with waiting 30 seconds and nothing works. We use the following settings in the cypress.config.ts file:
    Copy code
    json
    
    experimentalSessionAndOrigin: true,
    chromeWebSecurity: false,
    testIsolation: 'legacy',
    numTestsKeptInMemory: 0,
    watchForFileChanges: false,
    video: false,
    experimentalInteractiveRunEvents: true,
  • a

    agreeable-scooter-87343

    09/09/2022, 7:18 PM
    Hi, we are using cypress for testing salesforce. Since latest release of salesforce we have started facing issues with all existing tests after login it not navigating to next expected page. https://github.com/cypress-io/cypress/actions/runs/3006686418
  • a

    agreeable-scooter-87343

    09/09/2022, 7:21 PM
    https://github.com/cypress-io/cypress/issues/2367#issuecomment-1239169709
  • f

    flaky-airport-12178

    09/10/2022, 2:19 AM
    Hi team Do you know how to skip all test cases by the failed condition in hook: beforeEach, before of spec? Thanka
  • c

    cold-van-45410

    09/10/2022, 12:08 PM
    How to get url of pdf window in cypress? Ex- when I click on btn a pdf window will open ,now I want to get access of pdf window ,How can I do that with cypress??
  • c

    cold-van-45410

    09/10/2022, 1:55 PM
    https://discord.com/channels/755913899261296641/763105090679865354/1018157721247305759
  • n

    nutritious-army-46708

    09/11/2022, 3:29 PM
    Does anyone can tell me how I can install the cypress in the front-end repo in gitlab? Thank you!!
  • s

    steep-morning-65056

    09/11/2022, 3:41 PM
    I am trying to bypass UI login by logging in using
    cy.request()
    via our api server...I get a response with the correct response body and status...I set the
    localStorage
    with the correct attributes....and try to direct to the page where only a logged in member would be able to access - but it keeps redirecting me to the sign in page - I am not able to post any large body of code as I work in a data protected and HIPAA compliant space...but if someone has been through this before and has a potential solution...I'm up for walking through any steps you feel I need to make to ensure it works? Thanks in advance!
  • s

    steep-morning-65056

    09/11/2022, 3:45 PM
    I guess I can post this - scrubbed of anything sensitive: ```` cy.request({ url : Cypress.env('// scrubbed') + '/oauth/access_token', method : 'POST', body : { username : email, password : password, grant_type : 'password', client_id : // scrubbed, client_secret : // scrubbed, scopes : // scrubbed, }, }).its('body') .then(res => { user = res; }); }); beforeEach(function setUser () { cy.visit('// scrubbed', { onBeforeLoad (win) { win.localStorage.setItem('access_token', user.access_token), win.localStorage.setItem('token_type', user.token_type), win.localStorage.setItem('access_token_expires_at', user.expires_in), win.localStorage.setItem('refresh_token', user.refresh_token), win.localStorage.setItem('scopes', user.scopes); }, }); });`
  • s

    steep-morning-65056

    09/11/2022, 8:21 PM
    Success!! Was missing an ID being set in localStorage!
  • b

    bulky-account-48526

    09/12/2022, 6:44 AM
    Google
  • c

    chilly-quill-34099

    09/12/2022, 7:29 AM
    I am currently trying to wait for a request to finish, to test a
    cy.get(...)
    . My API, which I would like to intercept is on a different host (e.g.
    https://example-api.azurewebsites.net/something/something2/MyFunction/something3/something4
    ), than my website host
    http://localhost:4200
    . I tried
    cy.intercept
    with an alias. But either I get an authorization error (when using
    https://...
    for
    hostname
    ) or my
    cy.wait(@getMyFunction)
    runs into a timeout.
    Copy code
    ts
    it('...test', () =>{
      cy.intercept({
        method: 'GET',
        url: '**/MyFunction/*',
        hostname: 'https://example-api.azurewebsites.net',
      }).as('getMyFunction');
    
      cy.visit('/').wait('@getMyFunction', { timeout: 30000 })
      cy.get('some-content');
    });
    Cypress finds the alias, the
    intercept
    is not correctly configured. But I have no idea, what to change, to make it work. Does anyone know, what I am doing wrong in this procedure?
  • c

    chilly-quill-34099

    09/12/2022, 8:06 AM
    So the solution to my problem was 🙂 :
    Copy code
    ts
    it('...test', () =>{
      cy.visit('/');  
      cy.intercept({
        method: 'GET',
        url: '**/MyFunction/**',
        hostname: 'example-api.azurewebsites.net',
      }).as('getMyFunction');
    
     cy.wait('@getMyFunction', { timeout: 30000 })
      cy.get('some-content');
    });
  • g

    great-beard-98693

    09/12/2022, 9:46 AM
    Hello everyone 🙂 I have a problem with the "after" hook. In my test, when I execute some code in the after hook, it ALWAYS results in the "detached" error. When instead I add another
    it('...', () => {
    block at the end of the file, with exactly the same code as in the "after" hook, it works, no "detached" errors. Anyone had run into similar case? I'm not including any code, because the only difference is if I run the code in the
    it('...', () => {}
    block or in
    after(() => {}
    block.
  • a

    adorable-smartphone-87280

    09/12/2022, 1:25 PM
    Do you have a
    beforeEach
    hook that would modify the state in some way, such that a new
    it
    block would run properly, but an
    after
    block isn't in the right state?
  • g

    great-beard-98693

    09/12/2022, 1:25 PM
    I dont have
    beforeEach
  • d

    dry-memory-36351

    09/12/2022, 2:15 PM
    Hi, I am getting blank page in middle of test, specifically on opening pop up (mat-dialog-container) box. Pls help me to resolve this issue.
  • f

    freezing-nightfall-22736

    09/12/2022, 2:19 PM
    How can i solve this problem?
  • n

    nutritious-army-46708

    09/12/2022, 2:31 PM
    Does anyone know how cypress work in gitlab ci? Our test folder should be put in the repo of Front-end web project(FE), should I set the .gitlab-ci.yml and package.json in the FE folder or cypress folder? thank you!
  • g

    gray-kilobyte-89541

    09/12/2022, 3:07 PM
    which property are you trying to stub?
  • f

    freezing-nightfall-22736

    09/12/2022, 3:10 PM
    beforeEach(() => { cy.visit(''); })
  • g

    gray-kilobyte-89541

    09/12/2022, 3:11 PM
    you are visiting a site with just this code and it throws an error cannot set property?
  • f

    freezing-nightfall-22736

    09/12/2022, 3:11 PM
    Yes
  • g

    gray-kilobyte-89541

    09/12/2022, 4:08 PM
    How about
    cy.visit('/');
    ?
  • f

    freezing-nightfall-22736

    09/12/2022, 4:20 PM
    It´s the same problem
  • a

    acceptable-hamburger-48790

    09/12/2022, 4:31 PM
    Assuming you have already added base url https://docs.cypress.io/guides/references/configuration#Intelligent-Code-Completion
  • v

    victorious-honey-34966

    09/12/2022, 4:53 PM
    Are you familiar with a case where the test sets passed, the last test looks like still working (never stop) though it is finished and the result above looks failed? see attached
  • a

    adorable-smartphone-87280

    09/12/2022, 4:53 PM
    I haven't seen this issue, but could it be because your test case doesn't end with an assertion?
1...99100101...192Latest