playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Question] how to run same test on multiple browser one after another(Rotate browsers)

Open vishwajeetgodge13 opened this issue 3 years ago • 2 comments

hi guys, can you help me to find the way, to execute the same tests on multiple browser/rotate browser after complete execution of the test. i wanted to run all tests on all browser. i mean to say, once all tests successfully ran on chromium. then it should start executing on second browser(firefox) then third browser (webkit) like this way & I don't want to execute all tests at the same time on all browser. No need to change --project=chromium once it executed then --project=firefox so on & so forth

vishwajeetgodge13 avatar Aug 30 '22 07:08 vishwajeetgodge13

You may want to use Projects

// playwright.config.ts
import { type PlaywrightTestConfig, devices } from '@playwright/test';

const config: PlaywrightTestConfig = {
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
    },
  ],
};
export default config;

vincenzo-gasparo avatar Aug 30 '22 07:08 vincenzo-gasparo

Hi @vincenzo-gasparo I already added this things, i think you are not getting my point. i did: { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, { name: 'firefox', use: { ...devices['Desktop Firefox'] }, }, { name: 'webkit', use: { ...devices['Desktop Safari'] }, }, while executing test i mentioned --project=chromium & etc to execute test on Mention browser but i want execute test chromium, firefox, webkit, edge but not at the same time. if i execute without "--project=chromium " it executes on all browser at the same time. Instead of that i'm trying to run test 1st it should run on chromium, 2nd - firefox, 3rd - webkit, 4th- edge like this way & there way of execution should be one after another. once my test successfully executed on chromium, then it should start execution on firefox, after executed on firefox, then it should start execution on webkit. how can i do this?

vishwajeetgodge13 avatar Aug 30 '22 07:08 vishwajeetgodge13

I'm also interested in something similar. To give a bit of context. We are testing our systems e2e. Throughout the test, we interact with a number of different apps. One of those apps - a legacy one - has problems when it has multiple logins. So we cannot spawn a worker per browser, because of a specific test. It would be nice if there were a way to schedule one test to be run in one worker only independent of projects

dimitrisfasoulas avatar Feb 03 '23 08:02 dimitrisfasoulas

Why was this issue closed?

Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.

If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.

pavelfeldman avatar Nov 16 '23 04:11 pavelfeldman