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

    high-optician-91398

    06/24/2022, 9:04 PM
    I guess that from that root
    cypress.config.ts
    I can't import my angular stuff. Guessing it is not compiled or something and it tries to import the .ts directly. Any idea?
  • m

    mysterious-sandwich-43667

    06/25/2022, 10:28 PM
    Anyone ever use cy.readFile? The docs say if you read a text file you'll get the contents. I do not. I get an object. How do I just get the text or get the text out of the object?
  • m

    mysterious-sandwich-43667

    06/25/2022, 10:35 PM
    I can achieve what I want with cy.fixture, but I'm curious what I'm missing from the docs
  • b

    bitter-fountain-36713

    06/25/2022, 10:47 PM
    You can access the property containing the text with
    .its()
    .
  • m

    mysterious-sandwich-43667

    06/25/2022, 11:07 PM
    Thanks, but what's the property argument?
  • m

    mysterious-sandwich-43667

    06/25/2022, 11:07 PM
    it's just a text file
  • m

    mysterious-sandwich-43667

    06/25/2022, 11:24 PM
    oh yeah, what am I thinking? Have to do a .then(contents)
  • b

    bitter-fountain-36713

    06/25/2022, 11:34 PM
    Yes. For info https://docs.cypress.io/api/commands/readfile#Text
  • m

    mysterious-sandwich-43667

    06/26/2022, 12:42 AM
    Yeah, already read that, thanks. My issue was that I needed the contents in a variable so I could manipulate it. Gotta get used to everything being promise-like in Cypress.
  • g

    gray-kilobyte-89541

    06/26/2022, 12:02 PM
    always pass it forward, or use an alias and
    function () { ... }
    syntax. Plus you can just set it into a local variable one and use it normally https://glebbahmutov.com/blog/fixtures-in-custom-commands/#problem-aliases-are-reset
  • b

    billowy-hairdresser-82846

    06/26/2022, 12:35 PM
    how can I write test scripts using app action for angular application? Please suggest me a blog or video tutorial from where I can see details. How can I get app actions of angular application?
  • a

    alert-quill-14780

    06/27/2022, 5:19 AM
    Hello
  • a

    acoustic-ice-69900

    06/27/2022, 1:46 PM
    Hi, Does anyone have the idea or experience with this error message: [17677:0627/143134.756737:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143134.756929:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143146.499149:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143146.522998:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143147.125567:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143147.778690:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143148.482162:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 [17677:0627/143149.235027:ERROR:ssl_client_socket_impl.cc(997)] handshake failed; returned -1, SSL error code 1, net_error -176 I'm using Mac with M1 Pro chip. On the Cypress version 9.6.1 I had this same error so I assume (after I had an unproductive investigation) that this is something related to M1. I upgraded Cypress to the latest version and now the error is still there. It happens after I run 5-10 tests using "npx cypress run", the same as it was on version 9.6.1. If I want to use Cypress dashboard I have the same issue... we started using BrowserStack and on the BrowserStack everything runs normally, but I want to use Cypress dashboard so if anyone has some idea please help 🙂 When this issue occurs, if I don't force quit terminal (CMD+Q) immediately my laptop gets very hot and my internet connection is gone. I tried different node versions but it is the same no matter what I do... In the test runner, when I run a test after a test, everything works fine.
  • p

    prehistoric-restaurant-72560

    06/27/2022, 1:46 PM
    Im setting up cypress with cucumber along with https://github.com/badeball/cypress-cucumber-preprocessor and bundler https://github.com/badeball/cypress-cucumber-preprocessor/tree/master/examples/esbuild-ts And I keep getting this error not sure what to do * - hidden path
    Copy code
    Your configFile is invalid: ***/cypress.config.ts
    It threw an error when required, check the stack trace below:
    Error: Cannot find module 'esbuild'
    Require stack:
    - /builds/***/node_modules/@bahmutov/cypress-esbuild-preprocessor/src/index.js
    - /builds/A7ZaeUHb/0/gog-QA/e2e-finapp-sales-summary/cypress.config.ts
    - /root/.cache/Cypress/10.2.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js
    .
    .
    .
    • 1
    • 2
  • m

    millions-architect-22884

    06/27/2022, 6:28 PM
    Hello everyone, Im trying Cypress with Angular Why does CI task fails upon Cypress test failure in Azure?
  • m

    millions-architect-22884

    06/27/2022, 6:29 PM
    Following error is produced ##[warning]Couldn't find a debug log in the cache or working directory ##[error]Error: Npm failed with return code: 1
  • b

    bulky-london-24314

    06/27/2022, 6:33 PM
    hey friends. I'm having issues with our typescript migration & cypress. The nodejs api is working fine, but when I try to run cypress, I keep getting errors like these winston_1.default.createLogger is not a function. I think these errors happen when I'm running my tasks, which means they're running in nodejs, which means cypress is not using the correct config for the tasks. Did anyone see issues like this when migrating a project to TS?
  • p

    powerful-chef-53496

    06/27/2022, 9:06 PM
    Has anyone ran into an issue where Cypress would fail in a CI environment because of split.io and
    isReady
    flag?
  • m

    most-carpenter-29893

    06/27/2022, 11:19 PM
    I haven't experienced this error myself. That said I feel like
    esModuleInterop
    needs to be true in your tsconfig.json: https://www.typescriptlang.org/tsconfig#esModuleInterop . Hope this helps 🌹
  • b

    bright-park-76512

    06/28/2022, 10:28 AM
    Hey guys .. im requesting help regarding this https://github.com/cypress-io/cypress/discussions/21509#discussioncomment-3009357 I'm relatively new with Cypress so kindly excuse if I'm missing something here. Thanks
  • b

    brash-tiger-52405

    06/28/2022, 10:47 AM
    Hello everyone, I have problems with the cookie pop-op for a long time, sometimes it is visible sometimes not. I tried to solve it with a if condition, but if the cookie pop up is not visible it fails. How can i solve this? it("Cookie Pop-up - click when visible", () => { cy.get('.bg-green' , {timeout: 10000}) .then(($btn) => { if ($btn.is(':visible')) { cy.get('.bg-green').click(); } }) });
  • s

    salmon-river-93816

    06/28/2022, 10:59 AM
    Hello, on the second retry, Cypress skips the test which failed the first two times. Do you know how to disable this behavior?
  • g

    gray-kilobyte-89541

    06/28/2022, 11:09 AM
    https://glebbahmutov.com/cypress-examples/9.7.0/recipes/conditional-testing.html#conditional-testing
  • g

    gentle-accountant-4760

    06/28/2022, 11:41 AM
    Hello beautiful people! I wonder how am I able to reuse the same cookies, cache and everything else when using two cy.visit e.g.
    Copy code
    ts
    Suite('Cypress support, I need help', () => {
      before(() => {
        prepare();
        cy.visit('https://helloworld.com');
      });
    
      Scenario('Test', () => {
        When('we are testing get', () => {
          cy.get('.test')
        });
        Then('we are testing cy.visit', () => {
          cy.visit('https://helloworld.com/Barrythrill')
        });
    Basically whats happening is the cookies from prepare() goes to the first cy.visit but in the second cy.visit, it is all restored. how can I re-use all the needs?
  • f

    fresh-doctor-14925

    06/28/2022, 11:43 AM
    cy.session()
    is probably going to be helpful for you here. Take a look at the docs for that
  • g

    gentle-accountant-4760

    06/28/2022, 11:44 AM
    Looks like when using cy.session, I need to do visit everytime as we are using
    experimentalSessionAndOrigin
  • g

    gentle-accountant-4760

    06/28/2022, 11:44 AM
    So meaning my cy.get would fail. Wouldn't it?
  • g

    gentle-accountant-4760

    06/28/2022, 11:47 AM
    However, any time you want to test something on a different page, you will need to call cy.visit() at the beginning of that test, which will then be effectively calling cy.visit() twice in a row, which will result in slightly slower tests.
  • f

    fresh-doctor-14925

    06/28/2022, 12:16 PM
    But it goes on to say > Tests will often be faster if you call cy.visit() only when necessary. This works especially well when organizing tests into suites and calling cy.visit() after logging in inside a beforeEach hook.
  • f

    fresh-doctor-14925

    06/28/2022, 12:17 PM
    As I understand it, your question was about finding a way to have the cookies available to your second scenario. In that case, you'll need to put
    prepare()
    in a
    beforeEach()
    or use
    cy.session()
1...969798...252Latest