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

    colossal-match-42171

    12/05/2022, 5:47 PM
    what is your filesize?
  • c

    chilly-motorcycle-68015

    12/05/2022, 6:31 PM
    The site is not loading the content in cypress, has anyone experienced this?
  • m

    mysterious-belgium-25713

    12/05/2022, 6:39 PM
    Maybe you should also look at the browser console messages to see what is blocked
  • c

    cold-bird-96191

    12/05/2022, 9:46 PM
    Hello. In my test, I need to enter a tag name in this field and press enter to create this tag. But after I typed the text and press enter with type.('{enter}') - the field becomes empty. Please tell me how to press enter so that the field is not erased?
  • f

    faint-kangaroo-63063

    12/05/2022, 9:58 PM
    the wait() there seems a bit off. try cy.get(“yourElement”).type(‘generateStr(){enter}’) - using JS quotes notation, which I can’t replicate on my phone
  • c

    cuddly-notebook-88094

    12/05/2022, 10:47 PM
    any good way to upload a csv file on a drag and drop section? im using something like this
    Copy code
    cy.fixture('example.csv', 'utf8')
      .then(csvContent => {
        // Select the file input element on the page
        cy.get('#file-input')
          // Trigger a 'change' event on the element with the CSV file content
          .trigger('change', { target: { files: [csvContent] } })
          // Assert that the file has been uploaded successfully
          .then(() => {
            cy.get('#upload-status')
              .should('have.text', 'File uploaded successfully')
          });
      });
  • c

    cold-bird-96191

    12/05/2022, 11:01 PM
    But generatedString is a function that generates text, if you quote it, it will be treated as text. In this case, everything works, but at the next test, such a tag will no longer be created, since its name is already taken.
  • g

    gray-kilobyte-89541

    12/06/2022, 12:34 AM
    for file input you probably want to use https://on.cypress.io/selectfile
  • c

    cuddly-notebook-88094

    12/06/2022, 2:15 AM
    cool thanks, i'll give this one a try.
  • g

    great-oil-15113

    12/06/2022, 2:48 AM
    hi all. i am using cypress mocha junit reporter. i want to add attachment to the output.xml like this
    Copy code
    it ('should include attachment', function () {
      this.test.attachments = ['/absolut/path/to/file.png'];
    });
    but i can't get it working. it complains that the 'this.test' here does not have attachments property. how to solve that? thanks
  • c

    cuddly-notebook-88094

    12/06/2022, 4:22 AM
    worked like a charm!! thanks again
  • h

    helpful-hairdresser-46183

    12/06/2022, 6:25 AM
    you were right 🙂 I imported it as setByme instead of SetByme, that's why 😦 thank you very much @gray-kilobyte-89541
  • f

    faint-kangaroo-63063

    12/06/2022, 7:01 AM
    If you use template literals you can actually use .type(‘${yourFunc()}{enter}’) same as .type(yourFunc()+’{enter}’) - this will also work, it’s just plain JS syntax and sugar more details here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#string_interpolation
  • k

    kind-beard-65748

    12/06/2022, 7:51 AM
    Hi All, I need a help with cy.Visit() using basic auth. For some reason both methods mentioned in documentation ( direct pass creds via url, adding params to visit ) and also adding header with authorisation : "basic tokenhash" are not working. I've checked all these methods on some other test example sites which I was able to find (e.g. https://the-internet.herokuapp.com/basic_auth admin:admin Basic YWRtaW46YWRtaW4=) they all work fine. So I suspect there is something special with our Angular app. We are building app based on angular11 and using basicAuth from 'express-basic-auth' and we have prerender. Year ago I was using simple url pass ( https:// user:pass @ domain.site ) and it was working fine. Now not using any auth - just returns 401 immediately and using any of mentioned methods fails after 30 seconds timeout( Error: ESOCKETTIMEDOUT) . I'm stuck with this, and need an advice.
    f
    • 2
    • 1
  • f

    fresh-doctor-14925

    12/06/2022, 8:04 AM
    Hi All I need a help with cy Visit using
  • c

    cold-bird-96191

    12/06/2022, 8:07 AM
    It worked, thanks a lot!
  • b

    bumpy-journalist-50069

    12/06/2022, 9:51 AM
    Hi guys, I have a use case where my application is being authenticated on the backend, so basically, no information is sent from the frontend to the backend to fulfill the authentication. What I would ask of you is if you can provide any experience bootstrapping e2e tests in such a case. We are using Keycloak which communicates with our
    authService
    that the backend is using to authenticate communication for the logged-in user's session.
    f
    • 2
    • 1
  • b

    better-elephant-20934

    12/06/2022, 11:48 AM
    good morning. yo see al my test cases passes but no step is shown. any tip please
  • b

    better-elephant-20934

    12/06/2022, 11:58 AM
    also it keeps spinning!
  • b

    bumpy-insurance-8581

    12/06/2022, 2:32 PM
    Hello, why my downloaded file do not show instantly on the cypress/download folder ? It seem to only appear after the test fail. I’ve Cypress 10.11.0
  • f

    fresh-doctor-14925

    12/06/2022, 2:38 PM
    !duplicate
  • n

    nutritious-analyst-96582

    12/06/2022, 2:38 PM
    Uh oh, It looks like you have posted the same question in multiple channels. Help us prevent spam by removing any duplicates of your questions, Thanks! 😀
  • b

    bumpy-insurance-8581

    12/06/2022, 2:47 PM
    Removed from the other channel
  • b

    bumpy-insurance-8581

    12/06/2022, 2:49 PM
    It seem that with a stronger timeout, the file seem to appear on the cypress/download folder but the readFile command doesn’t seem to find the file.
    f
    • 2
    • 4
  • f

    fresh-doctor-14925

    12/06/2022, 2:59 PM
    It seem that with a stronger timeout the
  • e

    enough-fireman-4779

    12/06/2022, 3:16 PM
    hello, do anyone here have idea about this one? I'm still trying to run the tests through github actions but i'm receiving this error
    Copy code
    npm ERR! command failed
    npm ERR! command sh -c node index.js --exec install
    npm ERR! Cypress cannot write to the cache directory due to file permissions
    npm ERR! 
    npm ERR! See discussion and possible solutions at
    npm ERR! https://github.com/cypress-io/cypress/issues/1281
    npm ERR! 
    npm ERR! ----------
    npm ERR! 
    npm ERR! Failed to access /.cypress-cache:
    npm ERR! 
    npm ERR! EACCES: permission denied, mkdir '/.cypress-cache'
    npm ERR! 
    npm ERR! ----------
  • b

    bumpy-insurance-8581

    12/06/2022, 3:41 PM
    I tried cypress plugin
    cy-verify-downloads
    but it seem to not work with typescript 😢
  • b

    bumpy-insurance-8581

    12/06/2022, 3:42 PM
    Why is it so hard to test downloaded file with cypress 😭
  • c

    colossal-match-42171

    12/06/2022, 5:14 PM
    cy.session('EMSession', () => { cy.visit(Cypress.env("TEST_ENV")); baseSteps.selecttype(); cy.login(constants.username, constants.password); // sets a cookie baseSteps.setNameContext(constants.NAME); }) })
  • c

    colossal-match-42171

    12/06/2022, 5:15 PM
    anything wrong here?
1...160161162...192Latest