Skip to content

Test with data and "only" run only latest data #1445

@Vorobeyko

Description

@Vorobeyko

What are you trying to achieve?

Run test with different data and "only"

What do you get instead?

The test was performed only with the latest data

Defect in this part in regexp

    //codeceptjs/ui.js
    context.Scenario.only = function (title, opts, fn, data) {
      const reString = `^${escapeRe(`${suites[0].title}: ${title}`.replace(/( \| {.+})?$/g, ''))}`;
      mocha.grep(new RegExp(reString));
      return addScenario(title, opts, fn, data);
    };

Provide console output if related. Use --verbose mode for more details.

Pages/API/Private/Pages/Create --
  ✔ Test name | Название страницы на русском cd5211ad-8f61-4131-94a2-71762d96ded1 in 271ms

  OK  | 1 passed   // 907ms

Provide test source code if related

Data([
  `Automation name ${uuid4()}`, 
  `Название страницы на русском ${uuid4()}`
]).only.Scenario('Test name', async (I, pagesFactory, current) => {
  let spec = await I.havePageSpec({name: current})

  let pages = await pagesFactory.createPages([spec])
  I.seeValue('name', pages[0].page, { name: current })
})

Details

  • CodeceptJS version: 2.0.3
  • NodeJS Version: 10.15.0
  • Operating System: Ubuntu 18.04
  • Protractor || WebDriverIO || Nightmare version (if related)
  • Configuration file:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions