microsoft / microsoft/playwright-java
[Feature] Add custom description to assertThat and/or Locator naming
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 1.6k
- Fork
- 298
- Merge medio
- 3g 2h
- PR unite (30g)
- 14
Descrizione
With assertJ, we can add a custom name for given asserted object, for example:
Assertions.assertThat(mansion.guests()).as("Living Guests").isEqualTo(7);
Will result in:
[Living Guests] expected:<[7]> but was<[6]>
Selenide comes with element-aliasing as well as the .because() call (that does the similar thing, but not on asserted element, but the assertion itself):
$("div >> span").as("Living Guests").shouldHaveSize(7).because("The guest count should be valid")
The playwright-java assertions would be more readable if we'd be able to do similar thing with PlaywrightAssertions.assertThat or even the Locator/Page/ApiResponse itself, e.g.:
// on assertion:
PlaywrightAssertions.assertThat(questCount).hasText("7").because("The guest count should be valid");
// on asserted object:
PlaywrightAssertions.assertThat(questCount).as("Living Guests").hasText("7");
// on Locator
Locator guestCount = page.locator("div >> span").as("Living Guests");
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo l'API PlaywrightAssertions e i tipi Locator, Page e ApiResponse a cui fa riferimento l'issue. Confronta gli esempi richiesti di denominazione a livello di asserzione e a livello di oggetto, quindi definisci un approccio supportato e coerente i cui messaggi di errore includano la descrizione o il nome personalizzato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, playwright
- Ambito
- testing-qa
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100