Rayrun
← Back to Discord Forum

Looking for ways to run same set of TCs with different data.

lucky_rabbit_44106posted in #help-playwright
Open in Discord
lucky_rabbit_44106

Basically need to run same set of TCs on two different URLs with same minor differences in behaviour. have test.describe block inside data.forEach is a no go for me. Looking for inputs like to execute in different steps per URL and then merging the generated HTML report.

This thread is trying to answer question "How can the same set of test cases be run on two different URLs with minor differences in behavior?"

4 replies

you can create different configs pointing to different .env files and then use the configs when running PW depending on the URL you want to use

lucky_rabbit_44106

Can you quote an example for the same. Was thinking of running the scripts twice with different .env files as well but didn't proceed as it would create two set of Playwright reports / would need to look at a way to merge the reports

lets say I have qa and staging environments. I have 2 config files for the 2 of them i.e. qa.config.ts and staging.config.ts. I also have 2 .env files i.e qa.env and staging.env. qa.config.ts is linked to qa.env and the staging.config.ts is linked to staging.env. Then when I run the test, I am passing the --config parameter.

@lucky_rabbit_44106 please review this is how we achieved it https://m.youtube.com/watch?v=GQStVI5qbLI

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.