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

    important-river-75795

    09/27/2021, 8:22 PM
    Is the app throwing the exception when you open it normally?
  • i

    important-river-75795

    09/27/2021, 8:22 PM
    You can try to make cypress ignore the uncaught exception
  • i

    important-river-75795

    09/27/2021, 8:22 PM
    > Cypress.on('uncaught:exception', (err, runnable) => { > return false; > });
  • n

    nice-soccer-53564

    09/27/2021, 10:33 PM
    @User thank you very much. I used to run https and switched to http. Should I run
    uncaught:exception
    inside
    beforeEach
    block? Is there a way for me to log the network failures?
  • n

    nice-soccer-53564

    09/27/2021, 10:33 PM
    Thank you for the help!
  • n

    nice-soccer-53564

    09/28/2021, 12:44 AM
    Also, i just noticed that it was happening due to SRI
    Copy code
    [23:39:48]   cypress:launcher chrome stderr: [0927/233948.980903:INFO:CONSOLE(380)] "Failed to find a valid digest in the 'integrity' attribute for resource 'http://localhost:9995/webpack/en/main-938f5d17bbf554790715.chunk.js' with computed SHA-256 integrity 'jwyvL6w6ZOoyUngoSekrttm10Y0UEXB2BaZhxSl3fPU='. The resource has been blocked.", source: http://localhost:9995/login (380) +245ms
    [23:39:48]   cypress:launcher chrome stderr: [0927/233948.992494:INFO:CONSOLE(221)] "CYPRESS uncaught exception:::: ChunkLoadError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.
    [23:39:48]
    I saw that I can use
    experimentalSourceRewriting: true
    option (https://github.com/cypress-io/cypress/issues/2393) However, looks like cypress is injecting something into the page that has some mistake?
  • n

    nice-soccer-53564

    09/28/2021, 12:44 AM
    Copy code
    [00:06:44]   cypress:rewriter:js error while parsing JS { err: Error: Line 1: Unexpected token } at ErrorHandler.constructError (/home/helltool-ci-user/.cache/Cypress/8.4.1/Cypress/resources/app/packages/rewriter/node_modules/esprima/dist/esprima.js:3004:26) { index: 3, lineNumber: 1, description: 'Unexpected token }' }, js: 'n+e})),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},funct' } +365ms
  • n

    nice-soccer-53564

    09/28/2021, 1:06 AM
    Is this a bug with cypress? ^
  • r

    red-easter-74903

    09/28/2021, 4:41 PM
    Hi All, did anyone encounter the issue
    "Error: Cannot find module 'webpack'"
    when trying to do component testing? I'm having cypress running in a project that has a different folder structure where components are inside src and this inside a "frontend" folder. cypress modules are in the root and component tests are written inside src folder, frontend folder has a webpack folder with different configs, I tried using all configs and same error appeared. (Cypress folder is outside frontend folder)
  • r

    rough-nightfall-90576

    09/28/2021, 11:26 PM
    Is there any chance an api is available to pull down cypress.io test run reports outside of the dashboard? I would like to be able to present the results to other teams that don't have user accounts. I don't need the artifacts but just the test results at some visualization level.
  • i

    important-river-75795

    09/29/2021, 6:06 AM
    Add mocha reports that you can share with others @rough-nightfall-90576
  • i

    important-river-75795

    09/29/2021, 6:07 AM
    https://docs.cypress.io/guides/tooling/reporters#Custom-reporter
  • f

    fancy-airplane-60156

    09/29/2021, 8:46 AM
    Hi Team, I referred to codes of one of the group members to implement a session before I start my test. This is done using task . The parameters that are passed on to the task are username, password and URL. This task is in-turn implemented in module exports. I'm looking to make it work for all test environments. I followed Cypress io blog and implemented below. However it doesnt work as my task has dependency on the env file. Can anyone recommend the best way to do it.
  • f

    fancy-airplane-60156

    09/29/2021, 8:47 AM
    This code in my test file describe("EOI login", () => { before(() => { debugger; cy.task("getSession", { username: Cypress.env("auth_username"), password: Cypress.env("auth_password"), url: Cypress.env("login_url"), }).then((session) => { cy.restoreSession(session); });
  • f

    fancy-airplane-60156

    09/29/2021, 8:47 AM
    and below code is in my index.JS file
  • f

    fancy-airplane-60156

    09/29/2021, 8:47 AM
    module.exports = (on, config) => { on("task", { readjson: filepath =>{ return readjson(filepath,config) }, getSession({ username, password, url }) { return new Promise(async (resolve) => { resolve(await GetSession(username, password, url)); }) } }); //defining variable for version, if not defined use stage env const version = config.env.version || 'stage' //load env fron json config.env=require(
    ../config/${version}.json
    ); // change baseURL config.baseUrl=config.env.baseUrl return config; }
  • n

    numerous-tiger-46628

    09/29/2021, 9:01 AM
    Hello! Has somebody faced the issue, when Cypress changes a visiting url by adding /__/#/tests/_ and redirects to Page not found?
  • f

    fancy-airplane-60156

    09/29/2021, 1:17 PM
    I got solution to the problem I reported earlier. I removed arguments from the task. It worked like magic!
  • u

    user

    10/01/2021, 3:40 PM
    Cypress is amazing, especially Cypress Studio. It works great, and I was able to customize the generated selectors with Cypress.SelectorPlayground, but in some cases I also need to customize the action that Cypress Studio generates (e.g. to manipulate the text inside
    select()
    in a generated
    cy.get(..).select("<I want to manipulate this>")
    ). Can it be done?
  • n

    narrow-hydrogen-62095

    10/03/2021, 3:04 AM
    Hi everyone, has anyone ever come across an issue on Cypress where it redirects to a new URL after attempting to visit a requested page via cy.visit()? Here is my code below, its very basic. But essentially a new GET request (new-url) is issued to a different page ("/global") instead of staying on ("/sites/2/users") describe("Tests for Site Users Page", () => { beforeEach(() => { cy.login(); //note I am integrating cy.session() in this custom login command }); it("should handle user page properly", () => { cy.visit("/sites/2/users"); cy.contains("Site Name").should("exist"); //wait for page to load });
  • n

    narrow-hydrogen-62095

    10/03/2021, 3:06 AM
    The below is a screenshot of a similar issue another user was having (notice the new-url log in the test body)
  • l

    late-house-1562

    10/04/2021, 1:48 AM
    Can I stub a third party class? If so, how? I tried but got an error unless I first instantiated it, but then the code doesn't intercept the method when the real code is tested.
  • b

    bulky-sundown-74498

    10/05/2021, 12:11 AM
    You could wrap the class in your own
  • l

    late-house-1562

    10/05/2021, 2:11 AM
    Thanks for the idea. I’ll experiment with that. I just kind of thought there would be a way, with integration tests. At the same time, I understand how complicated that would probably be for a test runner. But idk.
  • b

    brief-egg-12332

    10/05/2021, 12:25 PM
    Hi 👋 I'm trying to test a feature where the user can click on a button to cancel the current request for a heavy computation but I can't get cypress to tell me that the request was aborted 😅 The request is correctly cancelled in the devtools but cypress still looks for it. I could check for the status of the request with
    cy.get("@alias.all")
    and verify that the status is not "Complete" but it's a bit hacky Does anyone know how could I check if the request was aborted with an AbortController ? Here's a reproduction repo: https://github.com/Alvai/cypress-abort-controller
  • w

    white-kite-70474

    10/05/2021, 5:50 PM
    Hello there! Trying to reset my password today and I'm not receiving an email that let's be follow through with the process. Already checked to ensure the email I registered with was correct. Any advice?
  • c

    cuddly-winter-72122

    10/07/2021, 5:32 PM
    this looks like a bug, have you reported it on the github repo? aborted requests should display as completed (and wait as if they are completed)
  • b

    brief-egg-12332

    10/07/2021, 5:38 PM
    Haven’t reported it yet because I wanted to check first here 😄
  • b

    brief-egg-12332

    10/07/2021, 5:38 PM
    Thanks, I’ll open a report soon
  • w

    worried-sunset-85459

    10/07/2021, 10:20 PM
    Hi, can we log in terminal a console.log who is in our script?
1...333435...252Latest