1

I am working with Playwright run-workers for parallel execution in chromium and sample BDD script when executed, i found Playwright is executing same scenario multiple times in different browser instances.

Ex: I created TWO simple BDD scenarios and performed parallel execution using below command, it instantiated two chromium browser But unfortunately it executed each scenario 3 times in each instance of chromium instead of executing for two times.

npx codeceptjs run-workers 2

**Command line execution details:**

\projectwork\codeceptjs>npx codeceptjs run-workers 2
CodeceptJS v2.5.0
Running tests in 2 workers...

[2] Brand - US/EN --
[1] Brand - US/EN --
[1]   √ Scenario ONE @tag1 in 30315ms
[1] Brand - US/EN --
[2]   √ Scenario TWO @tag2 in 48655ms
[2] Brand - US/EN --
[1]   √ Scenario ONE @tag1 in 21992ms
[2]   √ Scenario ONE @tag1 in 25305ms
[1]   √ Scenario TWO @tag2 in 39238ms
[2]   √ Scenario TWO @tag2 in 32938ms

  FAIL  | 6 passed, -4 failed   // 125.4s



*Below is the feature file used:*

Feature: Brand - US/EN
  As a QA, I expect that Brabd brand en/us locale is working fine.

  @tag1
  Scenario: Scenario ONE
    Given the "Brand" brand "homepage" of "us/en" locale has been built
    And i click on "signup.popup.crossbutton" if present
    When i see the structure of the "homepage"
    And I verify that country selector image is present in the footer
    And I verify that brand logo is appearing in the footer
    And I verify that copyright icon is appearing in the footer

  @tag2
  Scenario: Scenario TWO
    Given the "Brand" brand "homepage" of "us/en" locale has been built
    And i click on "signup.popup.crossbutton" if present
    When i see the structure of the "homepage"
    And i click on the site map link of global footer
    Then it should take me to site map page

below is the config file used:

const { setWindowSize } = require('@codeceptjs/configure');

setWindowSize(1366, 960)

exports.config = {
  output: './output',
  helpers: {
    Playwright: {
      url: '',
      show: true,
      waitForAction: 2000,
      windowSize: '1366x960',
      chromium: {
        args: ['--no-sandbox', '--window-size=1366,960', '--start-maximize'],
        defaultViewport: null
      }

    },
    ChaiWrapper: {
      require: "codeceptjs-chai"
    }
  },
  include: {
    I: './steps_file.js'
  },
  mocha: {},
  bootstrap: null,
  teardown: null,
  hooks: [],
  gherkin: {
    features: './features/*.feature',
    steps: ['./step_definitions/steps.js']
  },
  plugins: {
    screenshotOnFail: {
      enabled: false
    },
    autoDelay: {
      enabled: true
    },
    allure: {
      enabled: true
    }
  },
  // tests: './*_test.js',
  // multiple: {
  //   basic: {
  //     browsers: ['chrome']
  //   }
  // },
  // name: 'codeceptjsdemo'
}

can someone help me on this

1 Answers1

0

Moon support parallel Playwright tests execution out of the box. Documentation: https://aerokube.com/moon/latest/#_using_playwright

vania-pooh
  • 2,588
  • 3
  • 20
  • 39