Confirm All HTML data- Attributes At Once By Using The dataset Property

Publicado el: 10 abril 2023
en el canal de: gleb bahmutov
931
31

If you have multiple "data-..." attributes on your HTML element, you can grab them all using the "dataset" property. This property has all camel-cased string values. If you want to confirm the entire set, you first convert it into a plain object and then use "deep.equal" assertion
cy.get('article#electric-cars')
.should('have.prop', 'dataset')
.then(JSON.stringify)
.then(JSON.parse)
.should('deep.include', {
columns: '3',
indexNumber: '12314',
})
This recipe is at http://glebbahmutov.com/cypress-examp...


En esta página del sitio puede ver el video en línea Confirm All HTML data- Attributes At Once By Using The dataset Property de Duración hora minuto segunda en buena calidad , que subió el usuario gleb bahmutov 10 abril 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 931 veces y le gustó 31 a los espectadores. Disfruta viendo!