Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Running E2E tests locally throws an error (404 when POST batch settings) #8287

Closed
kmanijak opened this issue Jan 25, 2023 · 1 comment
Closed

Comments

@kmanijak
Copy link
Contributor

Steps to reproduce

Prerequisites - optional

You may want to setup fresh testing environment:

  1. Remove all the Docker containers
  2. wp-env destroy to confirm everything's gone
  3. wp-env start to start a fresh environment

Steps

  1. Run tests by npm run test:e2e

Expected:
tests are running and passing

Actual:
there's a 404 error thrown:
POST http://localhost:8889/wp-json/wc/v3/settings/general/batch
image

Notes:

  • the same issue has been spotted on two separate branches.
    • In one of the cases .wp-env.override.json file was necessary for the issue to occur.
    • In other case (branch add/convert-classic-template) no changes to .wp-env.json, nor .wp-env.override.json was created in order for the issue to occur.

cc: @gigitux, @Aljullu

@kmanijak kmanijak added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. category: tests and removed priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. labels Jan 25, 2023
@kmanijak
Copy link
Contributor Author

I managed to run the tests and overcome the issue, but with a weird manual step as per Stack Overflow comment:

Go to admin, settings, permalinks, choose "Post Name"
Click "Save Changes"

After this step, http://localhost:8889/wp-json/* endpoints wouldn't return 404 anymore and the tests are running normally.

The weirdest thing, though, was that "Post Name" was already chosen in the admin. So I didn't change the setting and just clicked "Save Changes" and that helped.

Leaving the comment for anyone that may encounter that in the future and closing the issue.

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

No branches or pull requests

1 participant