Here is a nifty trick: get from the document a form elements object and set multiple input values at once.
cy.document()
.its('forms.personal-info.elements')
.then(function (elements) {
elements['first-name'].value = 'Joe'
elements['last-name'].value = 'Smith'
elements.city.value = 'Boston'
})
For more, see the "Form recipes" at https://glebbahmutov.com/cypress-exam...
Watch video Set Multiple Input Fields Inside A Form At Once online, duration hours minute second in high quality that is uploaded to the channel gleb bahmutov 15 June 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 3,543 times and liked it 28 visitors.