Skip to content

Commit

Permalink
incorrect fail line
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Oct 8, 2024
1 parent e22502e commit 420db4f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 29 deletions.
4 changes: 1 addition & 3 deletions features/homepage.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Feature: Playwright Home Page

Scenario: Check title
Given I am on Playwright home page
When I click link "Get started"
Then I see in title "Installation"
Given step

13 changes: 2 additions & 11 deletions features/steps/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import { expect } from "@playwright/test";
import { Given, When, Then } from "./fixtures";

Given("I am on Playwright home page", async ({ page }) => {
await page.goto("https://playwright.dev");
});

When("I click link {string}", async ({ page }, name: string) => {
await page.getByRole("link", { name }).click();
});

Then("I see in title {string}", async ({ page }, text: string) => {
await expect(page).toHaveTitle(new RegExp(text));
Given("step", async ({}) => {
throw new Error("Fail in bdd test");
});
5 changes: 5 additions & 0 deletions non-bdd/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test("non bdd test", async ({}) => {
throw new Error("Fail in non bdd test");
});
22 changes: 7 additions & 15 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, devices } from "@playwright/test";
import { defineConfig } from "@playwright/test";
import { defineBddConfig, cucumberReporter } from "playwright-bdd";

const testDir = defineBddConfig({
Expand All @@ -7,22 +7,14 @@ const testDir = defineBddConfig({
});

export default defineConfig({
testDir,
reporter: [
cucumberReporter("html", {
outputFile: "cucumber-report/index.html",
externalAttachments: true,
attachmentsBaseURL: "http://127.0.0.1:8080/data",
}),
],
use: {
screenshot: "on",
trace: "on",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
name: "bdd-project",
testDir,
},
{
name: "non-bdd-project",
testDir: "non-bdd",
},
],
});

0 comments on commit 420db4f

Please sign in to comment.