Good
data-testid='checkout-submit' gibi davranışı anlatan sözleşme kullan.QA PRACTICE•TEST ID
Lesson 8 / 20 · Beginner
Design selectors intentionally for automation.
8 min
Not completed
data-testid, data-test ve data-cy açık bir automation contract’tır. Ekip testIdAttribute ayarını standardize etmeli; geliştirici, ürün ve QA birlikte anlamlı isimler seçmelidir.
Prerequisites: Role and accessible name
Live demo
Try the locator against the live demo.
data-testid='checkout-submit' gibi davranışı anlatan sözleşme kullan.data-testid='button-17' gibi render sırasını taşıyan ad kullanma.Görsel metin ve stil değişirken automation contract korunabilir.
Her şeyi test id ile seçmek erişilebilir semantiklerin eksik kalmasını gizleyebilir.
page.locator("[data-testid='checkout-submit']")driver.findElement(By.cssSelector("[data-testid='checkout-submit']"))cy.get("[data-testid='checkout-submit']")