Skip to content

Is there a way to run shell commands on the web container, from the playwright one? #22

@deviantintegral

Description

@deviantintegral

Hi @julienloizelet , hope all is well with you.

I wonder if it is time to look at moving either this repo or https://github.com/deviantintegral/ddev-playwright to under the ddev namespace.

In a related topic, I'd like to transfer https://github.com/deviantintegral/playwright-drupal to either the Lullabot or ddev namespaces, and add some colleagues of mine to help maintain it.

I took a look again at the code here (I haven't run it yet), and the one thing I'm not sure is possible is running shell commands on the web container to run test setup steps.

We do a few things in playwright-drupal that run commands on the web container:

  1. We can run arbitrary drush commands against a specific test site. In tests, we use this to conditionally enable modules and other such things, but just for specific test cases.
  2. We also use that to install a base copy of the site with sqlite for tests: https://github.com/deviantintegral/playwright-drupal/blob/main/src/setup/global-setup.ts
  3. We also use this to get the right session cookie data so we can run tests in parallel: https://github.com/deviantintegral/playwright-drupal/blob/main/src/testcase/test.ts#L40

Have you encountered a need for anything like this? The only way I can think of to do this with a separate container is to bind the docker socket in to the playwright container, and I'm not sure that would always work in all environments.

cc @rfay .

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