Skip to content

#70 CRUD basic bet#75

Draft
mdebowska wants to merge 2 commits into
developmentfrom
#70
Draft

#70 CRUD basic bet#75
mdebowska wants to merge 2 commits into
developmentfrom
#70

Conversation

@mdebowska
Copy link
Copy Markdown
Collaborator

  • test (CRUD basic bet)
  • api (pages&components)
  • schema (adding admin friend)

@mdebowska mdebowska requested review from Dyliard and radek2s April 11, 2026 22:19
});
await test.step("delete bet", async () => {
await mainPage.betSearch.searchInput.click();
await mainPage.betSearch.searchInput.fill("Subject of bet");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - IMHO we should place asserts in tests not in components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants