-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
click() doesn't work on dropdown list item #1461
Comments
What event is your app's code listening to to update the input on 'click'? |
@jennifer-shehane I just searched for the component and found out it is an I think it would be very important that Cypress also triggers the |
It looks like we do trigger the "MouseDown" event, as I can see when I click on a 'click' command. But I also see you're doing some logic with |
Oh I've completely overseen that we're actually using |
I solved the problem with adding it('selects element', () => {
cy.visit('https://app.liqid.de/investment-proposal/6PysBFc8AKr8J53jD1kkfY');
cy.get('.liq_recap-header__right-data-button').click();
cy
.get('.liq_recap-change-dropdown__body > :nth-child(4) [data-name=risk_level]')
.click()
.find('li[data-value=10]')
.trigger('mouseover') // ← this line was added
.click();
cy
.get('.liq_recap-change-dropdown__body > :nth-child(4) input[name=risk_level]')
.should('have.attr', 'value', '10');
}); @jennifer-shehane Is there any reason why Cypress isn't triggering |
Likely because the spec technically defines a The Either that or wait for true native events #311
|
That makes sense. Thanks for the clarification! 👍 |
Hello all I am trying to select list of each drop-down and try ti verify the graph for each selected dropdown. Anybody has solution for it? For Example I have list something like : 1. Orders 2. Sales 3. Total Order 4. Summary 5. Account , So when I click on Orders I should be able to verify the graph and select next dropdown and so on. It will be helpful if someone helps me in writting the code to select each drop-down |
@shivaIMS Try checking out our community chat, it can be helpful for debugging or answering questions on how to use Cypress. |
Is this a Feature or Bug?
Bug
Current behavior:
When I try to click on a specific list item in a dropdown of my app, Cypress finds it and says that it does click it. But it doesn't trigger the event of the list item, so the value of the list item gets pushed into an input. It is definitely not a problem of the app as the click works in Nightwatch. But I can't find out the reason why it isn't working in Cypress.
Desired behavior:
Value of the clicked list item should appear in input and the test below should pass, as it happens when I click the list item manually.
How to reproduce:
See test code below. It should pass, but fails instead.
Test code:
Additional Info (images, stack traces, etc)
when I let the test time out
when I click "10" in the dropdown manually while the test is still running
The text was updated successfully, but these errors were encountered: