Skip to content

Unknown engine "react" error using react selectors #2696

@dj-neza

Description

@dj-neza

What are you trying to achieve?

Hi! I'm trying to test a React application with Codecept and Playwright using the React locators mentioned here. An example of using them in my tests:
I.click({ react: 'MyComponent', props: { name: 'Test name' } });

What do you get instead?

An error occurs in the test in the above line with the message Unknown engine "react" while parsing selector react=MyComponent.

Provide test source code if related

Scenario('Test scenario', ({ I }) => {
  I.click({ react: 'MyComponent', props: { name: 'Test name' } });
});

Details

  • CodeceptJS version: 3.0.2
  • NodeJS Version: 14.7.0
  • Operating System: MacOS
  • Playwright: 1.6.2
  • Configuration file:
const { setHeadlessWhen } = require('@codeceptjs/configure');

setHeadlessWhen(process.env.HEADLESS);

exports.config = {
  tests: 'tests/*.test.js',
  output: 'tests/output',
  helpers: {
    Playwright: {
      url: 'Test url',
      show: true,
      browser: 'chromium',
      waitForNavigation: "networkidle",
    },
  },
  include: {
    I: './steps_file.js'
  },
  bootstrap: null,
  mocha: {},
  name: 'test-app',
  plugins: {
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions