it('features', () => {
home.featuresMainTitle("What you'll learn")
cy.get('.grid').children().each(($el, index, $list) =>{
const currentText = $el.find('h3').text()
const nextText = $el.next().find('h3').text()
expect(currentText).to.not.equal(nextText)
})
I'm extracting a grid element from the DOM and verifying that the text of each child within the grid is different from the others.
The code functions as expected, but I feel there may be a more elegant solution to achieve the same result without using additional JavaScript variables (currentText and nextText). Perhaps there is a feature in Cypress that could streamline these lines of code and make it cleaner at first glance.