Open rvsia opened 11 months ago
Hello @Lukas742 , @MarcusNotheis , could you please have a look?
Regards, Iliana
Hi @IlianaB,
this issue is reproducible using plain UI5 Web Components, so I you can remove the assignment of Lukas and myself 🙂
Codesandbox: https://codesandbox.io/p/sandbox/jolly-mcclintock-d2z7xp?file=%2Fsrc%2FApp.tsx
How to reproduce:
yarn install
yarn test
Hi @rvsia,
Seems like cypress is clicking the menu item when the popover is still not opened. We have attribute which says when the menu is opened and it will help with your case:
cy.get('ui5-menu')
.should('have.attr', "open");
I'm also forwarding the issue to the team who maintain the component in order to check if this is an issue at all.
BR, Nayden
@nnaydenow
Still the same results to me:
cy.get('ui5-menu').should('have.attr', 'open')
cy.get('[role="menuitem"]')
.eq(0)
.click({ force: true })
Cannot read properties of undefined (reading 'close')
Hi @rvsia,
I'm using the following code and it works to me. Could you please check it?
cy.get("#btnOpenBasic").click();
cy.get("#menuBasic").should("have.attr", "open");
cy.get('[role="menuitem"]').eq(0).click({ force: true }); // clicks on the first item there
@nnaydenow That's the same code I used in the comment before - just be aware, this is flaky, it's not failing all the time.
Bug Description
Hello I am using Cypress to test webcomponents-react menu component
This causes following error to happen:
it happens both in Cypress and React Testing Library (Jest) environment
Affected Component
menu
Expected Behaviour
No error should appear
Isolated Example
No response
Steps to Reproduce
Log Output, Stack Trace or Screenshots
TypeError Cannot read properties of undefined (reading 'close') Call Stack Menu._itemClick node_modules/@ui5/webcomponents/dist/Menu.js:351:31 EventPart.handleEvent node_modules/lit-html/development/lit-html.js:1336:35 List._fireEvent node_modules/@ui5/webcomponents-base/dist/UI5Element.js:702:44 List.fireEvent node_modules/@ui5/webcomponents-base/dist/UI5Element.js:687:34 List.onItemPress node_modules/@ui5/webcomponents/dist/List.js:523:19 EventPart.handleEvent node_modules/lit-html/development/lit-html.js:1336:35 StandardListItem._fireEvent node_modules/@ui5/webcomponents-base/dist/UI5Element.js:702:44 StandardListItem.fireEvent node_modules/@ui5/webcomponents-base/dist/UI5Element.js:687:34 StandardListItem.fireItemPress node_modules/@ui5/webcomponents/dist/ListItem.js:179:14 StandardListItem._onclick node_modules/@ui5/webcomponents/dist/ListItem.js:143:14
Priority
High
UI5 Web Components Version
1.15.1
Browser
Chrome
Operating System
Test environment
Additional Context
No response
Organization
SAP Signavio
Declaration