dimanche 5 juillet 2020

Cypress - Assert only one element with a text exists

I have a table and I want to ensure that values are not repeated within a column using Cypress. Currently, I am doing

cy.get("#myTable")
  .find(".table")
  .contains("unique_value")
  .should("exist")

This piece of code does check if a value in a column exists but it doesn't ensure that its the only entry with this value in the table. How do I check for uniqueness through Cypress?

Aucun commentaire:

Enregistrer un commentaire