79072755

Date: 2024-10-10 04:50:20
Score: 0.5
Natty:
Report link

Since you look for Title as first value, why not use it in the query?

Use combination contains() and regex /^Title$/ to make exact match.

const values = ['Title', 'Value1', 'Value2', 'Value3']
cy.contains('button rows span', /^Title$/)
  .parents('button')
  .find('span')
  .each(($span,i) => {
    cy.wrap($span).invoke('text').should('eq', values[i])
  })
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Bryan Burton