Automattic / Automattic/wp-calypso

Playwright: theme-activate spec has clash

Open
#54,854 1 comment 0 reactions 0 assignees View on GitHub
[Pri] Normal Task
Dominant language
TypeScript
Stars
12.6k
Forks
2k
Avg merge
1d 17h
Merged PRs (30d)
552

Description

### Details

The spec `wp-theme__details-preview-activate.js` in the Playwright suite has an isolation problem.

If there are two parallel instances Playwright e2e tests running at the same time:

- execution A logs in and begins the test steps.
- execution B logs in and begins the test steps, just a few seconds after execution A.
- the test account has Twenty Twenty-One active, wants to activate Twenty-Twenty.

Execution A would get there first; it searches for and activates Twenty Twenty-One.
Execution B does not know this, as it is looking at the Themes gallery perhaps half a second after execution A. It clicks into Twenty Twenty-One expecting to find an 'Activate' button but instead it finds a `Customize theme` button.

This causes the step to register as a failure.

### Checklist

Possible ideas
- [x] discontinue activate portion of the test?
- [ ] create a new site for each instance of this test?

### Related

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the Playwright spec wp-theme__details-preview-activate.js and run the relevant test with parallel instances. Check how concurrent executions share the test account and confirm the chosen change prevents one execution from seeing a theme already activated by another; done means the spec no longer fails from the Activate/Customize theme clash.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, playwright
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.