mbolotov / intellij-playwright

1 stars 0 forks source link

"Test directory" generates weird path #8

Closed ammut closed 2 years ago

ammut commented 2 years ago

I setup my run configuration like this:

Screenshot from 2022-07-05 09-50-15

when I hit run, it generates the following command:

/usr/bin/node /home/samuelv/Projects/myproject/node_modules/@playwright/test/cli.js test --config=tests/playwright.config.ts --reporter /tmp/intellij-playwright-reporter260356059687260141.js ../../tests

which doesn't work. When I run the tests manually I just run npx playwright test --config=tests/playwright.config.ts, no directory necessary.

When I want to run a single file, I run npx playwright test --config=tests/playwright.config.ts <path relative to playwright.config.ts>, i.e. given the following directory:

node_modules/
tests/
  setup/
  usecases/
    login-and-logout.ts
  playwright.config.ts

I would run npx playwright test --config tests/playwright.config.ts usecases/login-and-logout.ts.

When I hit the "Run this test" button in the gutter, it generates a command like:

/usr/bin/node /home/samuelv/Projects/code_expert/node_modules/@playwright/test/cli.js test --reporter /tmp/intellij-playwright-reporter260356059687260141.js login-and-logout.ts -g ^login-and-logout.ts.Log in and log out$

which doesn't work for multiple reasons:

  1. it passes login-and-logout.ts when it should pass usecases/login-and-logout.ts
  2. it passes -g "^login-and-logout.ts.Log in and log out$, when it should either omit the ^ or prepend the whole path, i.e. usecases/login-and-logout.
mbolotov commented 2 years ago

Fixed in 1.1.2