Параллельное выполнение сценария не работает с BDD тестами (но работает без BDD) - PullRequest
0 голосов
/ 23 марта 2020

Я работаю с Playwright run-worker для параллельного выполнения в хром и сценарий BDD при выполнении, я обнаружил, что Playwright выполняет один и тот же сценарий несколько раз в разных экземплярах браузера.

Пример: Я создал ДВА простого BDD сценария ios и выполнил параллельное выполнение, используя приведенную ниже команду, он создал два браузера Chromium, но, к сожалению, он выполнял каждый сценарий 3 раза в каждом экземпляре Chromium вместо выполнения для два раза.

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

может кто-нибудь помочь мне в этом

...