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

    average-garden-13651

    06/24/2022, 9:47 AM
    Hi guys, anyone know why I get ‘fs.readFile is not a function’ when I use fs in a test file? I am using it inside a regular declared function outside the test but in the same file as the test. (Fs and the solution works fine in any other js file…)
  • a

    average-garden-13651

    06/24/2022, 9:49 AM
    I am doing the import, have npm installed it, installed webpack. I actually also get suggestions when i write ‘fs.’, but still wont run
  • f

    fresh-doctor-14925

    06/24/2022, 10:00 AM
    Yeah, it’s because
    fs
    is an OS function that’s not available in the browser (Cypress runs in the browser). Would
    cy.readFile()
    work for your use case?
  • a

    average-garden-13651

    06/24/2022, 10:03 AM
    Aahhh makes sense! I dont think so, as cy.readFile() doesnt return a value if i assign it to a variable (?)
  • a

    average-garden-13651

    06/24/2022, 10:03 AM
    Goal is to use data from a json file in the test
  • f

    fresh-doctor-14925

    06/24/2022, 10:07 AM
    It’s asynchronous. If you look up the examples in the docs for this function you’ll find what you’re looking for
  • l

    late-planet-4481

    06/24/2022, 1:11 PM
    This is an easy mistake to make. You gotta keep an eye on the folder you're launching from.
  • f

    future-carpenter-21254

    06/24/2022, 3:40 PM
    Hi All, anyone tried lighthouse user-flow in cypress? I found some documentation but its in puppeteer! https://web.dev/lighthouse-user-flows/
  • l

    late-planet-4481

    06/24/2022, 6:00 PM
    Here is Murat's blog post about it: https://github.com/NoriSte/ui-testing-best-practices/blob/master/sections/advanced/performance-testing.md
  • f

    freezing-piano-2792

    06/24/2022, 8:19 PM
    Is Cypress not supposed to exit when manually exiting the browser, when running using
    run --headed --no-exit
    ?
  • f

    freezing-piano-2792

    06/24/2022, 9:09 PM
    Or rather, what is the point of the lingering CLI process?
  • f

    future-carpenter-21254

    06/24/2022, 9:20 PM
    Sorry, Lighthouse "user-flow" is not explained here! In my case i have implemented lighthouse but it is giving metrics through loading the page. What i need is to measure performance based on user-flow ex: Time taken between login and user landing page. I do found some tutorials but not in cypress 😦 https://github.com/GoogleChrome/lighthouse/blob/master/docs/user-flows.md & https://www.debugbear.com/blog/lighthouse-user-flows
  • l

    late-planet-4481

    06/24/2022, 10:25 PM
    > Time taken between login and user landing page. I do found some tutorials but not in cypress 😦 Oh that! I don't have a good answer for you. I use a series of workarounds for grouping actions, and that allows me to measure timings between steps, but I would imagine you'd be looking for something more 1st class which logged results and displayed them somewhere other than the runner. I have no suggestions for that, sorry 😐
  • c

    cuddly-thailand-33926

    06/25/2022, 1:13 PM
    Cypress in blue Selenium in red Do the high paying countries determine future trends? As there seems to be a correlation between wages and a preference to Cypress over Selenium
    s
    • 2
    • 6
  • c

    creamy-farmer-31548

    06/25/2022, 2:09 PM
    Can anybody help me on resolving this issue: https://stackoverflow.com/questions/72751706/cypress-how-to-download-multiple-audio-video-files-in-cypress-script
  • s

    silly-journalist-41771

    06/26/2022, 11:41 PM
    why does .click() not work in commands class when creating custom commands
  • s

    salmon-appointment-68982

    06/27/2022, 4:59 AM
    Hello, I'm unable to do "cypress open" from VScode, but able to do from mobaXterm or terminal remotely(Accessing Linux machine from windows), Any thoughts would be appreciated 🙂
  • r

    rapid-lighter-25958

    06/27/2022, 5:13 AM
    Hello, I have configured cypress with github actions but on github actions execution, I get error after automation script execution : Error: Could not find Cypress test run results. i.e. Error: ENOENT: no such file or directory, 1.Login.spec.js-compressed.mp4' Anyone went through same kind of issue !!
  • f

    fresh-doctor-14925

    06/27/2022, 6:25 AM
    I have lots of custom commands that use
    .click()
    . There must be something wrong in how you're defining
    checkout
  • s

    stale-crowd-78308

    06/27/2022, 8:51 AM
    Cypress in blue
  • m

    modern-addition-58981

    06/27/2022, 9:40 AM
    When I run testcases from customized folder I am getting issues like module not found I Have updated my config file also
  • p

    powerful-orange-86819

    06/27/2022, 10:50 AM
    because thats not an clickable element, looks like a function, click is used on elements like "cy.contains("ok").click(), its a chained command
  • s

    silly-journalist-41771

    06/27/2022, 12:14 PM
    That function is cy.get('locator')
  • s

    silly-journalist-41771

    06/27/2022, 12:14 PM
    In POM
  • p

    powerful-orange-86819

    06/27/2022, 12:18 PM
    add the .click() after the command in the test, not inside of another command
  • s

    silly-journalist-41771

    06/27/2022, 12:20 PM
    Is that not bad practice? To have. Click in spec file
  • f

    fresh-doctor-14925

    06/27/2022, 12:47 PM
    Can you show us the code where you define this function? I think I know the issue
  • s

    silly-journalist-41771

    06/27/2022, 12:51 PM
    I'm not on my PC atm
  • s

    silly-journalist-41771

    06/27/2022, 12:51 PM
    But it's literally just
  • s

    silly-journalist-41771

    06/27/2022, 12:51 PM
    Cy.get('locator')
1...565758...127Latest