1

私は Playwright run-workersを使用して chromium で並列実行し、BDD スクリプトのサンプルを実行したところ、Playwright が異なるブラウザー インスタンスで同じシナリオを複数回実行していることがわかりました。

例: 2 つの単純な BDD シナリオを作成し、以下のコマンドを使用して並列実行を実行したところ、2 つの chromium ブラウザーがインスタンス化されました。しかし、残念ながら、各シナリオが 2 回実行されるのではなく、Chromium の各インスタンスで 3 回実行されました。

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

以下は、使用される構成ファイルです。

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'
}

誰かがこれについて私を助けてくれますか

4

1 に答える 1