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

    aloof-beach-98822

    06/21/2022, 9:25 PM
    Thank You!
  • a

    aloof-beach-98822

    06/22/2022, 2:20 AM
    I need to implement an execution flow from login to checkout. Each transaction needs to be separate. Each transaction's performance is needed - For example page load time, response time, and all the performance metrics(ex.first contentful paint). For this I need to integrate Cypress with Lighthouse. I already created the Cypress script from login to checkout. I used the links that were posted here for the Cypress script. Now, I need to integrate Cypress with Lighthouse. My question is - How can I use my Cypress script to integrate with Lighthouse to get all the performance metrics for each transaction. I know there is the Cypress Audit plugin to integrate with lighthouse, but I don't know how to integrate my Cypress script with Cypress audit plugin and lighthouse. Please let me know. Thanks!
  • m

    magnificent-finland-58048

    06/22/2022, 6:34 AM
    slightly dated, but this should give an idea https://github.com/NoriSte/ui-testing-best-practices/blob/master/sections/advanced/performance-testing.md
  • a

    aloof-beach-98822

    06/22/2022, 11:42 AM
    Thank You Murat!
  • a

    adorable-stone-42197

    06/22/2022, 12:32 PM
    Preserve cookies is deprecated
  • a

    adorable-stone-42197

    06/22/2022, 12:32 PM
    I want to just login once in my test
  • a

    adorable-stone-42197

    06/22/2022, 12:32 PM
    describe('Some test', () => { beforeEach(() => { cy.session('random text', () => { cy.login(); // in my loging custom commend i have also cy.visity() sessionCallCount++ }) cy.visit('/') }) afterEach(() => { // clean up method somecleanup(); cy.wait(1000); }); it('checkis evertyhing fine', () => { // cy.visit('/')
  • a

    adorable-stone-42197

    06/22/2022, 12:32 PM
    I donโ€™t know if i doing right thing
  • b

    big-ghost-61501

    06/22/2022, 1:08 PM
    Hello, I wonder if I can install Firefox extension using
    before:browser:launch
    event and the
    launchOptions.extensions
    functionality?
  • b

    big-ghost-61501

    06/22/2022, 1:10 PM
    https://docs.cypress.io/api/plugins/browser-launch-api#Modify-browser-launch-arguments-preferences-and-extensions
  • m

    mammoth-manchester-71430

    06/22/2022, 1:13 PM
    @fancy-match-96032 Hi
  • m

    magnificent-finland-58048

    06/22/2022, 1:30 PM
    that's it https://github.com/muratkeremozcan/auth0-cypress i did the same here, and internally as well the whole login + session meta is different now, each it block "logs in" but not really since it's all cached it is kind of going towards the direction of test isolation rather than it blocks depending on each other , which is fantastic
  • m

    magnificent-finland-58048

    06/22/2022, 1:32 PM
    try it out and let us know ๐Ÿ™‚ grab a sample repo, so that if there is an issue, you can get help from outside your company
  • a

    adorable-stone-42197

    06/22/2022, 2:21 PM
    I don't want to use the cy. session command everywhere, therefore I can leave this in my code for some specific spec files where my tests reside. So this strategy in my test is acceptable?
  • m

    magnificent-finland-58048

    06/22/2022, 2:21 PM
    yessir
  • a

    aloof-beach-98822

    06/22/2022, 3:14 PM
    Can anybody help me with this error? cy.task('lighthouse') failed with the following error >You probably have multiple tabs open to the same origin.
  • r

    rapid-application-21794

    06/22/2022, 5:45 PM
    I have two tests, one test results in a page that generates a unique string. the next test requires that string. is there any way to store the string from the first test as a variable to pass to the second test?
  • r

    rapid-application-21794

    06/22/2022, 5:46 PM
    I can get the string and store it as a variable within the first test, but I cant figure out how to make the value accessible to the second test
  • g

    gray-kilobyte-89541

    06/22/2022, 5:56 PM
    well, now you have introduced a dependency between the tests which is bad. But if you really want it, either use a local variable or place it into
    Cypress.env
  • r

    rapid-application-21794

    06/22/2022, 6:09 PM
    i tried using a local variable, but it doesnt seem like the scope allows for it
  • r

    rapid-application-21794

    06/22/2022, 6:09 PM
    variables set in one test cant be read from another test
  • r

    rapid-application-21794

    06/22/2022, 6:10 PM
    variables set in a suite look like they can be read by tests but not changed
  • r

    rapid-application-21794

    06/22/2022, 6:10 PM
    im just not sure how to get the data out of a test so that it can be read by another test
  • m

    magnificent-finland-58048

    06/22/2022, 7:00 PM
    why... ๐Ÿ˜ญ
  • g

    gray-kilobyte-89541

    06/22/2022, 7:16 PM
    Copy code
    js
    let name
    it('gets the name', () => {
      cy.get('#name').invoke('text').then(t => name = t)
    })
    it('uses the name', () => {
      expect(name).to.be.a('string')
    })
    @rapid-application-21794 are you saying the above does not work? @magnificent-finland-58048 avert your eyes
  • m

    magnificent-finland-58048

    06/22/2022, 7:43 PM
    once you see it, you can't unsee it
  • r

    rapid-application-21794

    06/22/2022, 7:51 PM
    yeah it doesn't work for me. in this case, the second test doesn't see a value associated with name
  • r

    rapid-application-21794

    06/22/2022, 7:53 PM
    the tests can read the name variable, but they don't seem to be able to change the value
  • l

    late-planet-4481

    06/22/2022, 8:28 PM
    @rapid-application-21794 are you maybe running in parallel? I would think test A assigning and test B reading would be a problem for parallelization anyway.
  • g

    gray-kilobyte-89541

    06/22/2022, 8:28 PM
    do you visit different pages? Like different domains in two tests?
1...565758...192Latest