Hello everyone, I am looking into the option of running multiple Playwright tests on different URLs with one command. For example, I do npx playwright test and then tests run on URL1, URL2, URL3.. I know that we can use projects for this purpose, but is there a way to do this dynamically? Let's say if I want to reed the URLs from a file? Thanks!
This thread is trying to answer question "How can I run multiple Playwright tests on different URLs with one command, reading the URLs from a file and creating projects dynamically?"
I am trying to do something like that: projects = testData.forEach((baseURL) => { console.log(baseURL); projects.push({ name: 'chromium', use: { ...devices['Desktop Chrome'], baseURL, }, }); });
but it doesn't seem to work on the test side. I also have issue with the global setup not recognizing the base url. How do you pass the baseUrl to the test?
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 [email protected].