[Cypress] Remove Joomla command line client tool dependency #44656
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Refactoring of the Cypress test for SEF to replace the dependency on the Joomla command line client tool with Cypress custom commands.
With the
SefPlugin.cy.js
Cypress test, the Joomla command line client tool was added to the Joomla System Tests for the first time. This is an additional complexity and dependency. Especially if the test environment is containerised and Cypress container has no PHP installed. And PHP version needs to be 8.1 and additional modules likephp-simplexml
are needed. And with the Docker access rights,configuration.php
must be opened for writing (chmod 644
). And then there is the locally running Cypress GUI to be configured...Therefore switched from using the Joomla command line client tool to using the existing
config_setParameter
Cypress custom command. The original creator of 44253 could not know as it is not documented (will be solved with another PR #44660, together with the description for configuring the now required enablemod_rewrite
andAllowOverride All
).Since sometimes the first SEF test failed when the entire Joomla System Tests was performed after refactoring, the following was implemented:
writeRelativeFile
Cypress task are wrapped in a Promise to ensure that they are only resolved when everything is doneconfig_setParameter
Cypress custom command to return a Cypress chainableSefPlugin.cy.js
The Cypress best practice of using
beforeEach
is used to ensure that the tests can be run independently (this is still needed for other places in the Joomla system tests - another PR).As a small side effect the SEF test spec with 9 tests runs faster, e.g. 3 instead of 18 seconds before.
Testing Instructions
And once the overall test suite:
Three times the single test spec on:
And once the overall test suite:
Actual result BEFORE applying this Pull Request
Joomla System Tests require Joomla command line client
Expected result AFTER applying this Pull Request
Joomla System Tests doesn't require Joomla command line client
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Related PR for adopting Joomla System Tests GitHub will follow