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

    rough-jordan-79228

    11/25/2022, 9:58 AM
    \u00a0 with .filter() worked without separating them
  • f

    fresh-doctor-14925

    11/25/2022, 10:06 AM
    So what does your end solution look like?
  • r

    rough-jordan-79228

    11/25/2022, 10:20 AM
    Do you know if there is an differnce between using this in cypress open Mode and using the same in cypress run Mode?
  • f

    fresh-doctor-14925

    11/25/2022, 10:21 AM
    There shouldn't be. If you're seeing differences in execution, it's normally down to
    run
    being faster than
    open
  • r

    rough-jordan-79228

    11/25/2022, 10:21 AM
    Thank you Liam 🙂
  • f

    fresh-doctor-14925

    11/25/2022, 10:22 AM
    You're welcome! Have a good weekend
  • r

    rough-jordan-79228

    11/25/2022, 10:27 AM
    You too mate
  • p

    powerful-journalist-49461

    11/25/2022, 10:51 AM
    @fresh-doctor-14925 While we are on this theme do you maybe know what can be solution for this?
  • d

    dry-garden-6717

    11/25/2022, 11:01 AM
    Hello, I have a problem with cypress beforeEach function. I'm testing the modify password section of a website. In my before each, there is the connection/logging part using a fixture file. So, when I change the password in the website I also change change the password in the fixture file (with a writeFile). But the followings tests doesn't work because the logging part in my beforeEach use the former password. Do you know why ?
  • f

    fresh-doctor-14925

    11/25/2022, 11:02 AM
    I don't, no. It may be easier for someone on here to help you if your initial question was less busy; that's a lot of unformatted html to parse!
  • d

    dry-garden-6717

    11/25/2022, 11:13 AM
    Looks like a fixture problem https://github.com/cypress-io/cypress/issues/4716
  • f

    fresh-doctor-14925

    11/25/2022, 11:14 AM
    It also details a workaround, so you should be good to go 🙂
  • d

    dry-garden-6717

    11/25/2022, 11:16 AM
    Yes, I responded to myself if someone needs the solution 🙂
  • f

    fresh-doctor-14925

    11/25/2022, 11:17 AM
    Nice. Thanks for being a good citizen!
  • p

    powerful-journalist-49461

    11/25/2022, 11:20 AM
    I'm trying to compare two contents, but I have error because cypress is reading as text, so if you have something like this Some title dummy text and if you have assertions for eg. cy.get('[data-testid="content"]').should('contain.text', 'Some title dummy text'); }); You will get error I already tried the following: should(have.text, 'Some title dummy text'), (include.text, 'Some title dummy text') and cy.get('[data-testid="content"]').contains('Some title dummy text') Does someone has solution for this?
  • f

    fresh-doctor-14925

    11/25/2022, 11:23 AM
    Thanks! A lot of text in that error. Have you tried invoking the iframe and asserting on one of the elements within You can user the cypress-iframe plugin to work from within it https://www.npmjs.com/package/cypress-iframe And a blog from cypress showing how to use it: https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/ If you can narrow your selection down in the DOM, you should have an easier time with figuring out what's going wrong
  • p

    powerful-journalist-49461

    11/25/2022, 11:40 AM
    A lot of text in that error. Have you tried invoking the iframe and asserting on one of the elements within > No I haven't because I need only to compare contents... I'm getting content from backoffice using query and I'm filtering that content through htmlStripper on this way Cypress.Commands.add('htmlStripper', html => { var text = html.replace(/]*>?/gm, ''); //replacing standard html tags text = text.replace(/&/gm, '&'); // replacing the & character text = text.replace(/\xA0/g, ' '); // replacing the non breakable space code with a space text = text.replace(/ +/g, ' '); // replacing extra spaces with single space text = text.replace(/’/gm, '’'); // replacing extra spaces with single space and that's why I'm getting content without iframe, but I have to find the way to filter somehow "Cypress content".... and to remove this iframe/function from it, because Cypress isn't doing it
  • a

    adventurous-solstice-29426

    11/25/2022, 12:13 PM
    Hello, we are running cypress e2e testing on github runners ...we are facing issue that tests are randomly failing because of very slow application loading ... we are running application on apache with php backend ...is it known that github runners are slow for this testing ? is there a way how to speed it up ? we disabled video recording already and its better but still not enough ... Thank you
  • f

    fresh-doctor-14925

    11/25/2022, 12:18 PM
    You're introducing a lot of moving parts with all that string manipulation. By which point, it is hard to say if the content comparison fails because of differing content, or. because of some fault in your
    htmlStripper
    My suggestion would be as above: use
    cypress-iframe
    and work from within the yielded element
  • v

    victorious-summer-2999

    11/25/2022, 2:17 PM
    Hi, how do I restore an existing session into a new session? For instance I am using session to setup local storage and cookies in a global before each. Now I want to add session for the login function since the session above gets cleared I need to restore it as first step of the new login session. What is the syntax for that?
  • f

    fresh-doctor-14925

    11/25/2022, 2:21 PM
    Sounds like you just want to add
    cacheAcrossSpecs
    to your session command Only works in more recent Cypress versions. I believe it's 10.9.0 and above https://docs.cypress.io/api/commands/session#Arguments
  • g

    gray-island-1435

    11/25/2022, 3:57 PM
    Hi .... I am trying to automate UI which has IDP authentication. I was able to launch IDP url, enter Username, password and successfully login.. The next step is , the IDP page will lists the app which ever configured for the logged user.. When we click any of those app, now the respective app will open in the new tab There are no target attribute in the DOM.. I tried by directly visiting the app url (which opens in new tab) after successful login. But throws 404 error.. Request some help on this
  • g

    gray-kilobyte-89541

    11/25/2022, 4:17 PM
    Look at the implementation of that module. You can stub the
    document.execCommand('copy')
    that it uses https://github.com/angular/components/blob/main/src/cdk/clipboard/pending-copy.ts#L54
  • a

    ambitious-rainbow-92382

    11/25/2022, 4:20 PM
    hi there, new to testing, i have a question...how would i run an e2e cypress test to see if this user object loads?
    Copy code
    js
    const { user } = useSession({ shouldRedirect: false });
    this is what i have so far WIP
    Copy code
    js
    Cypress.Commands.add('testVisitAccount', (user) => {
        cy.visit(`${Cypress.env('base_url')}user/dashboard/account`);
        cy.get('.user-account').should('exist');
        ......
        cy.get('button[name=loginSubmit]')
            .should('exist')
            .click()
            .should('not.contain.text', 'Next');
    });
    useSession is making an api call
  • a

    ambitious-rainbow-92382

    11/25/2022, 4:20 PM
    not sure how to test if user object loads
  • a

    ambitious-rainbow-92382

    11/25/2022, 4:21 PM
    also, i need to be logged in otherwise the useSession returns a 400 error
  • a

    ambitious-rainbow-92382

    11/25/2022, 4:21 PM
    i already have the login test working
  • a

    ambitious-rainbow-92382

    11/25/2022, 4:22 PM
    do I make this test dependant on the login test passing?
  • s

    straight-beach-2843

    11/25/2022, 4:29 PM
    Hello guys, i am try to test if media permission rejected or not. How to make this work? Is there any examples on this? I searched for permissions and all but i couldnt figure it out. Any help appreciated 🙏🏻
  • g

    gray-island-1435

    11/27/2022, 2:41 AM
    @gray-kilobyte-89541 any help you can provide?
1...153154155...192Latest