vitalets / playwright-magic-steps

Auto-transform JavaScript comments into Playwright steps
MIT License
29 stars 2 forks source link

Variables in test steps #2

Closed ajsteenkamp closed 3 weeks ago

ajsteenkamp commented 1 month ago

I include variables in my test.step to make it even more intuitive and easy to follow but how would you something like the below using magic steps?

await test.step(`Enter search term '${searchTerm}' in to search bar`, async () => {
vitalets commented 3 weeks ago

Yes, you can use variables in step text like in regular template literals, e.g.:

const searchTerm = 'foo';
// step: Enter search term '${searchTerm}' in to search bar

Report:

Updated README.