I have my JSON file with the following text[there are around 100 values I have just put 4 here]
{
label: ['a', 'b', 'c', 'd'],
}
I have my dropdown in my website which has these values but in a different order.
How can I compare that the text from the JSON and dropdown values are equal?
Also, I have a text "ALL" which is displayed in the dropdown by default and is not included in the JSON file. It's like this: enter image description here
In the dropdown, the rest of the values are in the JSON file.
I have done the below but it is not working.
cy.fixture('label.json')
.then(function (category) {
this.cat = category
})
})
cy.get('#labels').each(($ele, i) => {
expect($ele).to.have.text(this.category.label[i])
})
})
Any help will be highly appreciated Thank you


