Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ERR_UNSUPPORTED_ESM_URL_SCHEME for undefined steps #71

Closed
yavulan opened this issue Nov 13, 2023 · 3 comments
Closed

Bug: ERR_UNSUPPORTED_ESM_URL_SCHEME for undefined steps #71

yavulan opened this issue Nov 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@yavulan
Copy link

yavulan commented Nov 13, 2023

Given

playwright.config.ts

import { defineConfig } from '@playwright/test';
import { defineBddConfig } from 'playwright-bdd';

const testDir = defineBddConfig({
    paths: ['sample.feature'],
    require: ['*.ts'],
});

export default defineConfig({
    testDir,
    reporter: 'html',
});

sample.feature

Feature: Home Page

    Scenario: Check title
        Given I am on home page
        Then I see in title "Playwright"

steps.ts

import { expect } from '@playwright/test';
import { createBdd } from 'playwright-bdd';

const { Given, When, Then } = createBdd();

Then('I see in title {string}', async ({ page }, keyword) => {
    await expect(page).toHaveTitle(new RegExp(keyword));
});

When

npx bddgen

Then

ERR_UNSUPPORTED_ESM_URL_SCHEME related to loadSnippetBuilder

Expected behavior

When I do have an undefined step, like Given I am on home page in this example, there shouldn't be an error. Or, at least, the error should contain human-readable message.

Environment

platform: win32
node: v18.16.0
playwright-bdd: v5.4.0
@playwright/test: v1.39.0
@cucumber/cucumber: v10.0.1
Playwright config file: playwright.config.ts

@yavulan yavulan added the bug Something isn't working label Nov 13, 2023
@vitalets
Copy link
Owner

Reproduced this bug, investigating.

@vitalets
Copy link
Owner

vitalets commented Nov 14, 2023

Fixed in dev, will be included in the nearest release.

Reference issues:

Thanks for bringing this up!

@vitalets
Copy link
Owner

Landed in 5.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants