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

    shy-table-52906

    02/01/2022, 2:46 AM
    Hey, where you able to find a solution yet? On 9.3.1 it was complaining that
    selectFile
    is not a valid command, trying to install 9.4.1
  • p

    powerful-orange-86819

    02/01/2022, 7:12 AM
    I have a question about cypress- discord integration, we're running cypress tests in gitlab and we already are using the "GitLab" bot to notify us about merges/pushes etc in our discord server, so does anyone already use any discord bot for Cypress repoting in groups? I've found a few, but i want opinion of people with expirience
  • p

    powerful-orange-86819

    02/01/2022, 7:20 AM
    @User I'm using attachFile()
    Copy code
    js
    cy.get('input[type="file"]').attachFile(filepath);
    The test has been working since september
  • s

    sticky-lawyer-27790

    02/01/2022, 9:21 AM
    I also want to know which bot is the best solution
  • b

    breezy-pager-73919

    02/03/2022, 2:04 PM
    hey folks, is it possible to slow down the tests in cypress studio? eg. a cy.wait after each step?
    f
    • 2
    • 8
  • a

    adventurous-dog-24499

    02/03/2022, 5:43 PM
    👋
  • a

    acceptable-journalist-55984

    02/04/2022, 6:40 AM
    I'm having the same issue and I'm trying to solve it in the #763105090679865354 channel with @User. Not too much yet, but maybe the thread helps. For starters: what does
    Cypress.version
    hold when run in the browser-console during a test?
  • p

    powerful-orange-86819

    02/04/2022, 3:58 PM
    intercept() is a great way to slow down to avoid breaking positive tests, Set intercept().as("something") before clickign a button or triggfering an event and then add cy.wait('@something') .its("response.statusCode").should("eq", 200); Other way is just add timeout cy.get('[element]', { timeout: 10000}), so cypress will wait 10 seconds and if element doesnt change just breaks
  • a

    adventurous-dream-20049

    02/04/2022, 8:23 PM
    Check to see if this helps: https://discord.com/channels/755913899261296641/763105090679865354/938822160896639026
  • c

    cool-dentist-94229

    02/06/2022, 3:34 AM
    @User I have a similar problem with this, I tried to add
    Copy code
    cy.get('#create-project-button > .MuiButton-label').click()
    cy.wait(3000).its("response.statusCode").should("eq", 200)
    The runner does not validate this condition
  • b

    bitter-fountain-36713

    02/06/2022, 3:38 PM
    Have your intercepted the request?
  • c

    cool-dentist-94229

    02/06/2022, 3:42 PM
    @User no, just put
    cy.wait(3000).its("response.statusCode").should("eq", 200)
  • p

    powerful-orange-86819

    02/07/2022, 7:04 AM
    You are doing it wrong, intercept should contain the url of the get request you are waiting for and it will wait untill response code is recieved, no need to add seconds, only the uniqueString
    Copy code
    js
    cy.intercept('POST',"example.org/api/url/*").as("uniqueString")
    cy.get("element").click()
    cy.wait('@uniqueString').its("response.statusCode").should("eq", 200)
    Try this and tell me if it worked for you, use case is described here: https://docs.cypress.io/api/commands/intercept
  • b

    brainy-photographer-13281

    02/08/2022, 6:08 AM
    Hi all I was facing an issue with client selection drop down where I am not able to verify the client from drop down which I selected 🙃 can any please help me out on this.
  • c

    crooked-businessperson-67614

    02/08/2022, 8:34 AM
    Morning all, first of all: I'm really enjoying Cypress so far, it really looks like an upgrade compared to other tools. I have been playing around with it now a bit and it works really nice. I was able to create the first tests in a matter of hours and they run fine in the interactive mode when using
    cypress open
    yand launching them through that wizard. However, now I'm trying to integrate that into our CI pipelines and thus started to play a bit around with
    cypress run
    . Unfortunately, there the tests failed. I googled a bit around and finally was able to now test with
    cypress run --browser chrome --headed --no-exit
    to give me some information what is happening. That is at least using the same browser and I can see what exxactly it happening, as I can see the window. The problem seems to be related to some cross-origin requests (and these are expected, because we are using Azure Active Directory authentication), but I was using the best practices and actually acquired the needed tokens in advance using a before hook. The UI auth library still send some refresh requests, which seem to just work fine in the interactive session, but are blocked when running in the automated mode via
    cypress run
    . Can anyone explain that behavior? I have to say that I did not even have to disable chrome websecurity to make it work in the interactive mode - it simply worked. Any help would be greatly appreciated. PS: I will also attach some screenshots of the successful results from the interactive session and the failure from the non-interactive one
  • n

    nutritious-art-11891

    02/09/2022, 12:18 PM
    HEY, if i use .selectFile() or Cypress.Buffer I got the error : Cannot read properties of null (reading 'stream') Do U know Why ?
  • c

    cuddly-rocket-64149

    02/09/2022, 12:29 PM
    Hello! Can I ask questions here?
  • n

    nutritious-art-11891

    02/09/2022, 12:33 PM
    y
  • c

    cuddly-rocket-64149

    02/09/2022, 1:54 PM
    Please tell me how to execute the code inside
    Copy code
    js
    Cypress.on('uncaught:exception', (err, runnable) => {
                return false
            })
    > Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
  • c

    cuddly-rocket-64149

    02/09/2022, 1:55 PM
    I need to log error data
  • n

    nice-machine-16386

    02/09/2022, 3:18 PM
    I"m trying to think how to tell a person not to use
    then()
    like below. It's not harmful, just unnecessary right?
  • n

    nice-machine-16386

    02/09/2022, 3:19 PM
    cy.get(element).click().then(() => { cy.url().should('include', expectedURL) })
  • n

    nice-machine-16386

    02/09/2022, 3:23 PM
    the click is just going to yield the previous subject (the dom element) but we don't need to wait for a that
  • g

    gray-kilobyte-89541

    02/09/2022, 8:57 PM
    maybe this https://glebbahmutov.com/blog/cypress-tips-and-tricks/#shorten-assertions
  • a

    adventurous-dream-20049

    02/10/2022, 12:32 AM
    Have you have a chance to check out our catalogue of events in our docs: https://docs.cypress.io/api/events/catalog-of-events#Uncaught-Exceptions Or possibly checked out the cyress-example-recipes repo: https://github.com/cypress-io/cypress-example-recipes/search?type=Code&q=org%3Acypress-io+uncaught:exception
  • a

    adventurous-dream-20049

    02/10/2022, 12:35 AM
    Can you confirm you are still having this issue using the latest Cypress version? There were some enhancements for selectFile in 9.4.0 https://docs.cypress.io/guides/references/changelog#9-4-1
  • h

    handsome-cartoon-58565

    02/10/2022, 8:16 AM
    [#typescript #compilation #ts-node #docs] Hey, i encountered some confusing situation about TypeScript in Cypress, because in the docs there is no mention (or at least i couldn't find one) about how Cypress deals with TS files and that it uses
    ts-node
    under the hood so it is able to consume
    .ts
    files and there is no need to compile them by yourself. I've had a situation where i manually compiled TS files to JS (using
    tsc
    ) and these files were output adjacent to their
    .ts
    counterparts (so folders like "integration", "support" had both
    .ts
    and
    .js
    files) and this resulted in Cypress throwing error
    path argument is required to res.sendFile
    (i saw that Cypress detected both
    .ts
    and
    .js
    files correctly, but trying to load them threw the mentioned error) https://github.com/cypress-io/cypress/issues/18607#issuecomment-1033449608 . Error was still appearing even if i passed
    --spec cypress/integration/file.spec.js
    , which should force Cypress only care about one
    .js
    file. https://docs.cypress.io/guides/tooling/typescript-support#Configure-tsconfig-json I found in the Cypress internal package docs inside the repo that it indeed uses
    ts-node
    to pre-compile TS files and i think such details should also be mentioned in the docs - i mean that developer should config TS (with
    tsconfig.json
    ) and probably also install it, but it doesn't have to compile it (hence the example repo uses
    noEmit
    param), because Cypress is able to consume TypeScript files. https://github.com/cypress-io/cypress/blob/5476904bf53c715c9bd4ff9bec09a1fc4f01a4e1/packages/ts/README.md#L3 https://github.com/cypress-io/cypress-and-jest-typescript-example/blob/master/cypress/tsconfig.json#L4 Remaining mystery for me is why having
    .ts
    and
    .js
    (TS compiled ones) files adjacent to each other confuses Cypress. 🤔
  • n

    nice-machine-16386

    02/10/2022, 2:13 PM
    Thank you Gleb.
  • c

    clean-psychiatrist-8640

    02/12/2022, 9:33 AM
    API request are failing with 404 response, but with other tools, API requests are working fine. What could be the issue in Cypress ?
  • n

    nice-machine-16386

    02/12/2022, 2:41 PM
    Maybe permissions? Sometimes services return a 404 instead of a 403 so that attackers don't know they've found a real endpoint.
1...282930...127Latest