Locators & selectors in UI tests
Në shqip: Lokatorët në testet e ndërfaqes
ShpjegimiSQ
Testet duhet të gjejnë elementet në faqe. Lokatorët më të qëndrueshëm janë ata që sheh përdoruesi (roli, teksti, label-i) ose data-testid; XPath dhe klasat CSS prishen sa herë ndryshon dizajni.
EnglishEN
Tests must find elements on the page. The most stable locators are what the user sees (role, text, label) or data-testid; XPath and CSS classes break whenever the design changes.
Si ta mendosh
Si t'i japësh dikujt adresën me emrin e rrugës, jo me „pas pemës së tretë“.
Lexoje në anglisht
Like giving someone an address by street name, not “after the third tree”.
Shembull kodihtml
<button data-testid="ruaj-butoni">Ruaj</button>