Skip to content

Test: make generated client use the PW requests #1453

Open
dominikvagner wants to merge 3 commits into
content-services:mainfrom
dominikvagner:ts-client-playwright-network-logs
Open

Test: make generated client use the PW requests #1453
dominikvagner wants to merge 3 commits into
content-services:mainfrom
dominikvagner:ts-client-playwright-network-logs

Conversation

@dominikvagner
Copy link
Copy Markdown
Member

Summary

This changes the way how the generated typescript client, we use for
testing, sends the requests. Previously we used the default or undici
for this, but that meant we couldn't see those requests in the PW
traces, making it hard to debug.
We can utilize the built-in Playwright request fixture and API context
to do this, by providing a custom "FetchAPI" to the generated client.
Also makes the client dynamically pick-up fresh credentials per request
by default.

And makes a few smaller tweaks in the first 2 commits:

This fixes an issue with a wrong describe used in auth.setup.ts,
changes the project name of API tests to something appropriate and
quiets unnecessary logs.

This fixes incorrect docs and makes the interval longer as 10 ms was way
too spammy.

Testing steps

All tests pass and the network logs in Playwright traces display the requests made by the client.

This fixes an issue with a wrong describe used in `auth.setup.ts`,
changes the project name of API tests to something appropriate and
quiets unnecessary logs.
This fixes incorrect docs and makes the interval longer as 10 ms was way
too spammy.
This changes the way how the generated typescript client, we use for
testing, sends the requests. Previously we used the default or undici
for this, but that meant we couldn't see those requests in the PW
traces, making it hard to debug.
We can utilize the built-in Playwright request fixture and API context
to do this, by providing a custom "FetchAPI" to the generated client.
Also makes the client dynamically pick-up fresh credentials per request
by default.
@dominikvagner
Copy link
Copy Markdown
Member Author

/retest

1 similar comment
@dominikvagner
Copy link
Copy Markdown
Member Author

/retest

Copy link
Copy Markdown
Contributor

@katarinazaprazna katarinazaprazna left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! This is super helpful. Nice work 🙌

@rverdile
Copy link
Copy Markdown
Contributor

@dominikvagner did you wanna merge this? :)

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