akshayp7/playwright-typescript-playwright-test

how to use dynamic token in api testing.

shanthkumar043 opened this issue · 3 comments

how to use dynamic token in api testing.

You can refer below article for using tokens in Playwright. I feel currently they only support static tokens.
By the way you can use Post Request to get the token and store it in a variable in User it in tests, I haven't implemented it though

https://playwright.dev/docs/test-api-testing

You can try the below code as well, its implemented in puppeteer with tweaking it might work for playwright

https://stackoverflow.com/questions/70595609/code-way-for-creating-a-authorization-code-jwt-token

Thanks Akshay ...