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]: Playwright Extension Test Explorer cannot find setup.ts files #30838

Closed
Alice3105 opened this issue May 15, 2024 · 3 comments
Closed

[Bug]: Playwright Extension Test Explorer cannot find setup.ts files #30838

Alice3105 opened this issue May 15, 2024 · 3 comments

Comments

@Alice3105
Copy link

Alice3105 commented May 15, 2024

Version

@playwright/test": "^1.45.0-alpha-2024-05-15
Playwright Test for VSCode v1.1.1 by Microsoft

Steps to reproduce

Previously, on Playwright version 1.36.1 I was able to see the projects I set up via setup.ts files on Test Explorer. However, after updating to 1.44.0 I cannot see that anymore.

I created 3 setup.ts files as projects that are located at the same directory as the playwright-settings.env and playwright.config.ts.

The folder structure of e2e:
image

Projects are setup as below in the playwright.onfig.ts

export default defineConfig({
  testDir: '.',
  testIgnore: [''],

  timeout: 10 * 60 * 1000, // Global timeout test cases = 10 mins

  forbidOnly: !!process.env.CI,
  retries: 2,
  workers: process.env.CI ? 5 : 3,
  fullyParallel: false, // One worker runs on each .spec.ts file

  reporter: [
    ['junit', { outputFile: 'test-results/results.xml' }],
    ['html', { outputFolder: 'playwright-test-results' }]
  ],

  use: {
    // Using `await page.goto('/')` in code will go to the baseURL stated below
    baseURL: `${process.env.TARGET}${process.env.LANGUAGE}`,

    // Collect tracing (images) after failing the first time
    trace: 'on-first-retry'
  },

  projects: [
    {
      name: 'setup-authentication',
      testMatch: /.*\authentication.setup\.ts/
    },
    {
      name: 'teardown',
      testMatch: /.*\global.teardown.setup\.ts/,
      use: { storageState: './user.json' }
    },
    {
      name: 'setup-estimate',
      testMatch: /.*\estimate.setup\.ts/,
      dependencies: ['setup-authentication'],
      use: { storageState: './user.json' }
    },
    {
      name: 'chromium',
      use: {
        ...devices['Desktop Chrome'],
        storageState: './user.json',
        launchOptions: {
          args: ['--auth-server-allowlist=""']
        },
        viewport: { width: 1920, height: 1080 }
      },
      dependencies: ['setup-estimate'],
      teardown: 'teardown'
    }
  ]
});

Now click on Testing -> Test Explorer

Expected behavior

I expect to see all the project names of setup.ts files (in the test-suites folder) appear here.

Actual behavior

Only the testes of the spec.ts appear.

Additional context

I used this playwright extension on vscode
Playwright Test for VSCode v1.1.1
image

Everything run smoothly with CLI though.

When Test Explorer recognize the setup, I can run the test with the green triangle. However, that option is no longer available after updating the playwright library to 1.44.0

image

Environment

System:
    OS: Windows 11 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
    Memory: 7.25 GB / 31.68 GB
  Binaries:
    Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.89.1
@gvaatstra
Copy link

Please see this response on disappeared projects:
#30843 (comment)

@yury-s
Copy link
Member

yury-s commented May 16, 2024

Folding into #30803

@yury-s yury-s closed this as completed May 16, 2024
@yury-s yury-s reopened this May 16, 2024
@yury-s yury-s added the v1.44 label May 16, 2024
@mxschmitt mxschmitt removed the v1.44 label May 23, 2024
@pavelfeldman
Copy link
Member

I believe all the associated issue have been fixed, please refer to #30882 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants