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

    elegant-keyboard-7249

    10/21/2022, 10:56 AM
    and I report issued against its git repository that mentioned above.
  • e

    elegant-keyboard-7249

    10/21/2022, 10:57 AM
    @adorable-action-72456 - I also tried this https://www.npmjs.com/package/mongodb
  • e

    elegant-keyboard-7249

    10/21/2022, 10:58 AM
    It works in JS file but when I call in "**CY.JS**" got the same error.
  • l

    lemon-animal-16490

    10/21/2022, 10:59 AM
    Should we use Cypress with cypress testing library
  • b

    brave-river-4142

    10/21/2022, 11:08 AM
    Thank you so much! Yes, i know because the project is it Angular, so the elements its different of you. But I really helped!! Thank you 100x times! 😄
  • a

    adorable-action-72456

    10/21/2022, 11:13 AM
    Ok, did you try cy.task() before test start ?
  • e

    elegant-keyboard-7249

    10/21/2022, 11:14 AM
    nope
  • a

    adorable-action-72456

    10/21/2022, 11:14 AM
    Please check this one https://glebbahmutov.com/blog/testing-mongo-with-cypress/
  • e

    elegant-keyboard-7249

    10/21/2022, 12:21 PM
    @adorable-action-72456 - Cypress 10 not supported index.js
  • b

    brief-midnight-25297

    10/21/2022, 1:31 PM
    Hi guys, it might be that the question was already answered but I'm gonna try my luck anyway. So, I have a scenario where at the end of the test, after the last action a print dialog is automatically triggered. The problem is that this is an OS dialog. Anyone has a clue how to close that dialog ?
  • c

    cuddly-kitchen-97815

    10/21/2022, 1:56 PM
    Still looking for solutions if anyone's able to help me with this! The app it's being used on was created with Create React App, so it uses react scripts to start the server and such. I'm wondering if I just need webpack or something but it's been difficult to research
  • b

    brash-tiger-52405

    10/21/2022, 2:42 PM
    Hey all, i have problems with checking checkboxes. After using following code the state of the checkbox is sometimes changing and sometimes not. I dont know the reason, do you have any idea? cy.get('[type="checkbox"]') .check({force: true}) .should('be.checked'); cy.get('[type="checkbox"]') .uncheck({force: true}) .should('not.be.checked');
  • c

    cuddly-kitchen-97815

    10/21/2022, 2:45 PM
    How many checkboxes are present on the page? grabbing by type will make cypress get more than one element, which might be where the source of ambiguity is coming from. Do you have any other selectors specific to the checkbox you're trying to test?
  • a

    acceptable-hamburger-48790

    10/21/2022, 2:46 PM
    Any reason why you are using force check ? You should right better selector. Using just type checkbox will result in flaky test
  • b

    brash-tiger-52405

    10/21/2022, 3:10 PM
    there is jutz one checkbox. I used cy.get('[type="checkbox"]') to test should('be.checked'). I think with selector specific i cant use this.
  • b

    brash-tiger-52405

    10/21/2022, 3:11 PM
    I used force check, to try if it works that way.
  • c

    cuddly-kitchen-97815

    10/21/2022, 4:03 PM
    https://docs.cypress.io/guides/references/configuration#Folders-Files What's the name of the key for redefining where to find the tests in a project? It's not listed under the "Folders/Files" section. I want to move my Cypress folder to a sub-folder but I don't know what I should use. Is it just
    testFiles
    ?
    componentTestFiles
    ?
  • a

    acceptable-hamburger-48790

    10/21/2022, 4:04 PM
    specPattern ?
  • c

    cuddly-kitchen-97815

    10/21/2022, 4:05 PM
    Hmm, that might work since I can specify a path in there. Thanks!
  • o

    orange-orange-29394

    10/21/2022, 7:35 PM
    Hello, I am trying to modify the behavior of
    cy.get
    so that it not only waits for the element to exist in the DOM but also waits for an event listener to be attached to the element. Can anyone offer advice on the best way to do this?
  • o

    orange-orange-29394

    10/21/2022, 7:43 PM
    I also want it to wait for all pending requests to complete
  • c

    cuddly-kitchen-97815

    10/21/2022, 7:45 PM
    Your best bet is to use
    should
    statements to validate the existence of these things in the DOM, which you can customize with a custom wait time, and make the test wait until the
    should
    comes back as true so it can do the action it needs to
  • o

    orange-orange-29394

    10/21/2022, 7:47 PM
    This is not really an option because our goal is to have a QA person make the e2e tests using the experimental studio and we want to make it as simple as possible for them. That's why I'm looking to hook the
    get
    method.
  • o

    orange-orange-29394

    10/21/2022, 7:49 PM
    In other words, we don't want the QA tester to have to add that
    should
    code manually
  • c

    cuddly-kitchen-97815

    10/21/2022, 7:49 PM
    Then what you can do is overwrite the
    get
    command itself so it generally uses the behavior you want. This stack overflow article overwrites the click command but should be a good example https://stackoverflow.com/questions/65778344/what-is-the-proper-way-to-overwrite-the-cy-click-command-in-cypress
  • o

    orange-orange-29394

    10/21/2022, 7:49 PM
    this is what I came up with so far Cypress.Commands.overwrite('get', (originalFn, url, options) => { return cy.wait(500).then(() => originalFn(url, options)); });
  • o

    orange-orange-29394

    10/21/2022, 7:50 PM
    But I'd rather not use cy.wait
  • o

    orange-orange-29394

    10/21/2022, 7:50 PM
    Thanks, I'll take a look
  • c

    cuddly-kitchen-97815

    10/21/2022, 7:50 PM
    Is your listener attached to a visible callback or anything that cypress could spy on or intercept?
  • o

    orange-orange-29394

    10/21/2022, 7:55 PM
    In some cases I believe that the listener gets added by Angular after the element is rendered in the DOM, so nothing happens when it is clicked. In other cases, the app may automatically close a modal for example because it expected a network request to have already completed.
    c
    • 2
    • 2
1...184185186...252Latest