Skip to content

[BUG] UI mode shows only test file with global setup when I use projects dependencies instead of all my tests #21952

Closed

Description

System info

  • Playwright Version: [v1.32.0]
  • Operating System: [macOS 13.2.1]
  • Browser: [All]

Source code

  • I provided exact source code that allows reproducing the issue locally.

Config file

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
 testDir: "./tests",
 testMatch: "*.spec.ts", 
 use: {
   baseURL: "https://www.saucedemo.com",
 },
 projects: [
 {
   name: "setup",
   testMatch: "global.setup.spec.ts",
 },
 {
   name: "chromium",
   use: devices["Desktop Chrome"],
   dependencies: ["setup"],
 },
 {
   name: "firefox",
   use: devices["Desktop Firefox"],
   dependencies: ["setup"],
 },
 {
  name: "webkit",
  use: devices["Desktop Safari"],
  dependencies: ["setup"],
 },
 ],
});

Test file (self-contained)

// global.setup.spec.ts
import { test as setup, expect } from "@playwright/test";

setup("should do some setup", async ({ page }) => {
   await page.goto("");
   await expect(page).toHaveURL("https://www.saucedemo.com");
});
});

Steps

  1. Create some test files e.g. login-page.spec.ts and inventory-page.spc.ts and put them into tests directory

obraz

  1. Copy the config file from this issue
  2. Run th tests using: npx playwright test --ui command

Actual
I see only the global.setup.spec.ts file and I can run it

obraz

Expected
There are all of my tests which can I run and play with them because I set the testMatch global property as testMatch: "*.spec.ts", in my config file

obraz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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