Closed khteh closed 2 years ago
The images show that you're using our portal helpers, which check for the menu to be closed
Since multi-select won't close the menu after selecting, you should use persistent
option of withinSelectMenu
Check out my talk into QuasarConf of last month, it could help you We should probably better document this option and portal based helpers in general
As a side note, please always provide a repro, instead of copy/pasting the code
In the code you pasted there is no withinSelectMenu
used and this would have made impossible for anyone else except me to debug your problem, as they would have focused on code you pasted and wouldn't be able to reproduce the error
How to use withinSelectMenu
? Any doc?
I tried:
cy.withinSelectMenu(
{persistent: true}, // this means you have a multiple select
() => {
cy.get('.q-item[role=option]').contains("Option 1").click();
});
Error:
/open /reopen
Into the docs:
It seems like you're not opening the select before trying to click stuff around into it's options menu
I did at the line before it:
cy.get('[data-test="multidropdown-setting-4"]').find('label').should('contain', "Auto Generated Multi-Selection box").should('be.visible').click();
And the test console does show it is open:
I was facing the same issue. Got it to work by going through the github repo based on suggestion by @IlCallo. Sample Code if anyone is facing similar issue.
cy.dataCy('select').click()
cy.withinSelectMenu({
persistent: true,
fn: () => {
cy.contains('Option One').click()
},
})
template:
test code:
Error: https://stackoverflow.com/questions/73233046/quasar2-vue3-cypress-multi-select-test-fails-with-strange-error
Software version
OS: Ubuntu 22.04 Node: v18.4.0 NPM: 8.15.0 Any other software related to your bug:
What did you get as the error?
What were you expecting?
What steps did you take, to get the error?