purple-ice-75399
03/22/2023, 4:54 PMjs
cy.get('[class*="spanWithText"]')
.contains(option) // option could be 501-1000
.closest('label')
I attempted the examples here: https://glebbahmutov.com/cypress-examples/recipes/non-breaking-space.html#non-breaking-space, besides manually entering the zero-width code since not all choices will have zero-width spaces in our other cases, and would just like to enter what the human sees and without manipulating a large amount of HTML.
Our developer used this: https://discord.com/channels/755913899261296641/961325024114008064/1086073596499214367 but the error message doesn't help when it goes wrong, so I was hoping to find something more Cypress-y to handle this, especially since I need to chain commands after finding the correct option.
Does anyone know how I could go about this?
Thanks!