Skip to content

Fixes sub-task #308: folder clearing paths - #316

Open
hanna-meda wants to merge 1 commit into
developfrom
feature/187-folder-clearing-paths
Open

Fixes sub-task #308: folder clearing paths#316
hanna-meda wants to merge 1 commit into
developfrom
feature/187-folder-clearing-paths

Conversation

@hanna-meda

Copy link
Copy Markdown
Contributor

Description

Fixes #308
Adds directory existence/emptiness checks and two new Self-host Google Fonts scenarios to verify cache folders cleanup when toggling Self-host GF with RUCSS on/off.

Type of change

Detailed scenario

What was tested

Ran npm run test:test for the newly added scenarios under self-host-google-fonts.feature:

  • Scenario: Should clear cache and used CSS when toggling Self-host GF with RUCSS on
  • Scenario: Should clear cache/used CSS/fonts CSS with RUCSS off/on while toggling Self-host GF

Test results screenshot:
screencapture-file-Users-hannameda-wp-rocket-e2e-test-results-cucumber-report-html-2025-12-08-14_30_14

How to test

Add @test to the two new scenarios in src/features/self-host-google-fonts.feature, then run npm run test:test.
Or run the whole feature with npm run test:selfhostgooglefonts (no tags needed).

Technical description

Documentation

E2E coverage was updated with two new self-host GF scenarios and added folder existence/emptiness checks

New dependencies

N/A

Risks

List possible performance & security issues or risks, and explain how they have been mitigated.

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Unticked items justification

N/A

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@hanna-meda hanna-meda linked an issue Dec 8, 2025 that may be closed by this pull request
@jeawhanlee

jeawhanlee commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

@hanna-meda Firstly I must appreciate your work and your effort on this PR, A lot of ciritical thinking and logic put into this. However I think we are making e2e do too much with this PR, I personally like to keep logics that tries to create, read, update files/directories out of e2e and in the helper plugin. I think we should consider this approach moving forward.

The idea is e2e will talk with the helper plugin and it would do the heavy lifting of checking directories and file modifications if necessary, I believe this would be easy and straight forward on the PHP side rather on e2e. WDYT?

If this is ok by you, you could create an issue on the helper repo and we'll take it from there while you modify this PR, but I think this will happen in another CD sprint.

@hanna-meda

Copy link
Copy Markdown
Contributor Author

Thank you @jeawhanlee for the valuable feedback, much appreciated. I've opened this helper ticket to address it: wp-media/wp-rocket-e2e-test-helper#7. I'll block this PR and revisit once the helper has the needed functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smoke: folder clearing paths

2 participants