Skip to content

Running e2e tests on Windows without Docker #10459

@mnelson4

Description

@mnelson4

Describe the bug
I am unable to run Gutenberg's end-to-end tests (using Jest and Puppeteer) successfully in a Windows-based dev environment called Laragon (similar to XAMPP). I have node and npm installed fine.
On https://wordpress.org/gutenberg/handbook/reference/testing-overview/#end-to-end-testing, I set the environment variables WP_BASE_URl, WP_ADMIN and WP_PASSWORD to those of a site hosted locally. Then when I run npm run test-e2e it runs for a bit, but then gives me the following error:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gutenberg@3.9.0 pretest-e2e: concurrently "./bin/reset-e2e-tests.sh" "npm run build" npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gutenberg@3.9.0 pretest-e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I believe it's because pretest-e2e runs concurrently \"./bin/reset-e2e-tests.sh\" \"npm run build\", where ./bin/reset-e2e-tests.sh is a bash file specifically designed for the Docker setup (see https://github.com/WordPress/gutenberg/blob/master/package.json#L183). It reports that Docker isn't setup and fails. It's right, but it should still work because I have a different setup.
If I change that script to instead just be npm run build the tests run ok.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a WordPress local site using something besides Docker, like XAMPP or vagrant.
  2. Set the environment variables WP_BASE_URl, WP_ADMIN and WP_PASSWORD in your command prompt, then run npm run test-e2e from within the gutenberg's base folder.

Expected behavior
I would expect it to work to run the tests, without need any code modifications.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 7
  • Browser n/a
  • Version n/a

Additional context

  • Please add the version of Gutenberg you are using in the description.
  • To report a security issue, please visit the WordPress HackerOne program: https://hackerone.com/wordpress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions