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

Опубликовано: 10 Апрель 2023
на канале: 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...


На этой странице сайта вы можете посмотреть видео онлайн Confirm All HTML data- Attributes At Once By Using The dataset Property длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь gleb bahmutov 10 Апрель 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 931 раз и оно понравилось 31 зрителям. Приятного просмотра!