Skip to content

Update example to have the project being tested in a non-root package. #32

@MatrixFrog

Description

@MatrixFrog

I've been working off of the example in examples/rules_js which is very helpful, but I'm running into a little bit of trouble when the project I'm testing is not at the root level. I made this branch which hopefully clarifies what I mean: https://github.com/MatrixFrog/rules_playwright/commits/separate-package/

Since the playwright config file is now at myproject/playwright.config.ts instead of just playwright.config.ts, I changed the command to run the test server to start with .. instead of . (according to https://playwright.dev/docs/api/class-testconfig#test-config-web-server the cwd defaults to where the config file is). But of course if it was a deeper package (my_product_area/my_team/my_project/my_subproject) then we'd need more ..s. Maybe it's better to use chdir = package_name() but I couldn't quite get that working either.

And more importantly, the PLAYWRIGHT_BROWSERS_PATH doesn't seem to be working as expected. I'm probably missing something that should be obvious here.

If it's possible to update the example to show how to deal with this I think it would be quite helpful. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions