purple-afternoon-2408
07/29/2022, 10:09 AMnutritious-analyst-96582
07/29/2022, 10:09 AMgray-kilobyte-89541
07/29/2022, 11:36 AMadorable-stone-42197
07/29/2022, 1:33 PMable-monkey-72947
07/29/2022, 2:25 PMcy.get('body').then(body => body[0].dataset['no-js'] = '???')
That seems like it should work but I'm getting a setting getter-only
error.able-monkey-72947
07/29/2022, 2:29 PMable-monkey-72947
07/29/2022, 2:39 PMgray-kilobyte-89541
07/29/2022, 2:41 PMgray-kilobyte-89541
07/29/2022, 2:42 PMgray-kilobyte-89541
07/29/2022, 2:43 PMable-monkey-72947
07/29/2022, 2:43 PMable-monkey-72947
07/29/2022, 2:43 PMmammoth-australia-81192
07/29/2022, 3:40 PM# create a new vite/react-ts project
> pnpm create vite
# name the project, choose react for framework and react-ts for variant
> cd <project> && pnpm install
> pnpm add -D cypress
> pnpm exec cypress open
# follow the automated setup steps for component testing setup from Cypress, choosing react/vite
# choose to create a new test file automatically
# change it to have a .tsx extension
# import the default created <App /> from src and add it to cy.mount()
# run the component test
I've also tried the above with npm
just to be safe and got the same result.
I feel like I'm just missing something silly and could really use a hand. I can also put up a small repo as an issue if that's better / helps!
Versions:
react@18.2.0
vite@3.0.0
typescript@4.6.4
cypress@10.3.1nutritious-honey-65632
07/29/2022, 8:39 PMadorable-stone-42197
07/31/2022, 10:43 AMeager-chef-77344
07/31/2022, 10:58 AMwonderful-match-15836
07/31/2022, 4:32 PMwonderful-match-15836
07/31/2022, 4:33 PMacceptable-hamburger-48790
07/31/2022, 5:23 PMeager-chef-77344
08/01/2022, 5:55 AMmelodic-dawn-73228
08/01/2022, 8:00 AMmelodic-dawn-73228
08/01/2022, 8:02 AMlittle-horse-39027
08/01/2022, 8:31 AMgray-kilobyte-89541
08/01/2022, 12:02 PMadorable-stone-42197
08/01/2022, 1:01 PMlate-planet-4481
08/01/2022, 2:46 PMcy.wait()
to wait for one of each thing. Example:
cy.intercept('updateCalendar').as('uc')
cy.intercept('saveOrder').as('so')
cy.get('[data-test-id="shinyRedButton"]').click()
cy.wait(['uc','so'])
If you expect duplicates, just put duplicates in the array.
cy.wait(['uc','uc','uc','so'])
https://docs.cypress.io/api/commands/wait#Aliasesgray-kilobyte-89541
08/01/2022, 3:25 PMable-monkey-72947
08/01/2022, 3:41 PMtabpanels
is labelledby
correctly.
cy.wrap(panel).invoke('attr', 'aria-labelledby').then(label => {
const expectedLabel = cy.get('@tabs').eq(index).invoke('attr', 'id')
cy.wrap(label).should('eq', expectedLabel)
})
I can see in the cypress test runner console that const expectedLabel = ...
gives me what I expect - Yielded: web-component-tabs-web-component-tab-one
.
However, on the next line, the text fails like this
component-tab-one to equal { Object (userInvocationStack, specWindow, ...) }
Do I need to put a .then(label => ...
in there somewhere on the line calling .invoke('attr', 'id')
?acceptable-hamburger-48790
08/01/2022, 4:01 PMsalmon-computer-88142
08/01/2022, 4:07 PM