Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cpcss tests, updated background to do fresh activation #175

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

Mai-Saad
Copy link
Contributor

@Mai-Saad Mai-Saad commented Nov 25, 2024

Description

  • updated background to have fresh install
  • updated selector for cpcss
  • added CPCSS Tto scripts to run tests in isolation

Fixes #166
Explain how this code impacts users.

Type of change

  • New feature (non-breaking change which adds functionality).
  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as before).
  • Sub-task of #(issue number)
  • Release

Detailed scenario

Explain how to reproduce the issue (for bugs) or how to trigger the new code. You can refer to the GitHub issue or grooming if it is still applicable.
fixes #166

Technical description

As per grooming + added test isolation / fresh install

Documentation

As gromming

New dependencies

No

Risks

None

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.

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.)

@Mai-Saad
Copy link
Contributor Author

cpcss report
Screenshot from 2024-11-25 13-54-41

smoke test report on PR
Screenshot from 2024-11-25 13-50-27

@Mai-Saad
Copy link
Contributor Author

Mai-Saad commented Nov 25, 2024

Remain, for this scenario, we shall log in with admin 2, currently, we use the same user to login => we can open GH for that

  Scenario: Shouldnot display the CPCSS banner to admin 2 if it was dismissed by admin 1
    Given I have an unexpired account
    And turn on 'CPCSS'
    Then I must see the banner 'We highly recommend the updated Remove Unused CSS for a better CSS optimization. Load CSS Asynchronously is always available as a back-up.'
    When click on 'Turn on Remove Unused CSS'
    Then I must see the banner 'The Remove Unused CSS service is processing your pages'
    When I connect as 'admin2'
    And I go '/wp-admin/options-general.php?page=wprocket#file_optimization'
    Then I must not see the banner 'We highly recommend the updated Remove Unused CSS for a better CSS optimization. Load CSS Asynchronously is always available as a back-up.'

@Mai-Saad Mai-Saad requested a review from a team November 25, 2024 14:04
Copy link
Contributor

@hanna-meda hanna-meda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Mai-Saad, for this PR.
All looks good and running npm run test:cpcss all tests pass.
Screenshot 2024-11-26 at 16 09 06

@hanna-meda hanna-meda merged commit f1157ad into develop Nov 26, 2024
2 checks passed
@hanna-meda hanna-meda deleted the fix/tests_related_to_cpcss branch November 26, 2024 14:11
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.

Fix tests related to the CPCSS notice
3 participants