#70 CRUD basic bet#75
Conversation
mdebowska
commented
Apr 11, 2026
- test (CRUD basic bet)
- api (pages&components)
- schema (adding admin friend)
| }); | ||
| await test.step("delete bet", async () => { | ||
| await mainPage.betSearch.searchInput.click(); | ||
| await mainPage.betSearch.searchInput.fill("Subject of bet"); |
There was a problem hiding this comment.
This might be only my habit, but don't we validate correct content of the text inputs -> I had one case of fill not throwing any error, but the input still being empty (maybe the component in the application was created in a wrong way but in this case error was clear ;P)
There was a problem hiding this comment.
I can make fillAndCheck() method but in most cases it's not necessary. The next line of test would not pass if the input won't be filled so test checks what it should. We get a pw-report where we can easily see what the problem was but of course - reading main reason from log of failed test will be faster instead of opening ui pw-report and check it manualy. Summarising, its up to you which way do you choose - create special method or use pw internal method fill(). And I'm not fan of repeatig fill() and expect(locator).toHaveText(value) every time (DRY).
But if you better feel with fillAndCheck() I can apply it for all TextInputs in this or the next PR ;)
|
|
||
| async verifyBetListIsEmpty(): Promise<void> { | ||
| const betCards = await this.baseLocator.locator(".bet-card").all(); | ||
| expect(betCards.length).toBe(0); |
There was a problem hiding this comment.
This is just a question, where do we put the line of all expect should be located in tests and not deeper in the code? This function is clear for me and I'm all for it, but how much can we "hide" inside the helpers?
There was a problem hiding this comment.
+1 - IMHO we should place asserts in tests not in components