Skip to content

Make joomla-cypress Joomla-release-independent#22

Merged
laoneo merged 1 commit intojoomla-projects:mainfrom
muhme:joomla-release-independent
Jun 21, 2024
Merged

Make joomla-cypress Joomla-release-independent#22
laoneo merged 1 commit intojoomla-projects:mainfrom
muhme:joomla-release-independent

Conversation

@muhme
Copy link
Contributor

@muhme muhme commented Jun 18, 2024

Summary of Changes

Actual Joomla dev-4.4 branch is using joomla-cypress 0.0.16 and the branches 5.1, 5.2 and 6.0 are using joomla-cypress 1.0.3. This PR is intended to make joomla-cypress Joomla-release-independent.

There were no much changes needed. Only disableStatistics() was reimplemented to work on Joomla 4.

Once this (and other open) PR is merged and the new NPM package is created, we will migrate all Joomla development branches to the new version and then only have one joomla-cypress version for Joomla System Tests.

❗ If the version of the NPM package joomla-cypress for Joomla 4 is updated, the overwritten custom commands doFrontendLogin, doFrontendLogout, doAdministratorLogin and doAdministratorLogout in the file tests/System/support/commands.js must be deleted in to avoid endless cycles from doubled sessions.

Testing Instructions

Tested was in installing joomla-cypress local and changing package.json to use the local version:

"joomla-cypress": "file:joomla-cypress"
  1. Joomla System Tests
    • Branches 4.4-dev, 5.1-dev, 5.2-dev and 6.0-dev
    • Especially Joomla 4.4.6-dev System Tests was successfully
    • Using some functions like installJoomla, doAdministratorLogin, disableStatistics ...
  2. quote_joomla module installation
    • Joomla 4.4.4 and Joomla 5.0.0 (as from docker images joomla:4 and joomla:5)
    • Using some functions like installJoomlaMultilingualSite, installExtensionFromFolder, publishModule ...

Code changes between joomla-cypress 0.0.16 and 1.0.3 are compared. There are a lot of small changes for improvement or enhancements in functionality.

❗ Since we don't have a test suite for Joomla-Cypress at the moment, there is no 100% guarantee that everything will work in Joomla 4 (and I assume that not everything will work for Joomla 4 in 0.0.16 either, as bugs have been found in the past).

Reimplemented in using 'System - Joomla! Statistics' plugins detail view.
Runable on actual Joomla 4.4-dev ... 6.0-dev.
Executable multiple times.
@laoneo
Copy link
Contributor

laoneo commented Jun 19, 2024

Not against this pr, but can we not just change the state flag in the database?

@LadySolveig
Copy link
Member

There was a change in the installation especially for Joomla 5.1 here #11
It was just a quick fix so that we could merge a PR in the joomla-cms for version 5.1. I haven't looked at this PR now but that's the real reason for the new package in 5.1

@laoneo
Copy link
Contributor

laoneo commented Jun 19, 2024

Thanks for the explanation, we will see what @muhme says. Doing the change in the database would be faster.

@LadySolveig
Copy link
Member

LadySolveig commented Jun 19, 2024

Since I am working on the release-testing project, and tests are to be carried out on remote websites, changing the DB itself is not a solution for me. But for the joomla-cypress package this is of course completely independent.

I just wanted to make it available to you as a suggestion.

Wrong context.

@muhme
Copy link
Contributor Author

muhme commented Jun 19, 2024

Not against this pr, but can we not just change the state flag in the database?

Be faster with just change the state flag in the database would affect the joomla-cms repository, specifically in tests/System/integration/install/Installation.cy.js. It doesn't appear to be related to this joomla-cypress PR.

@LadySolveig
Copy link
Member

Sorry for that, was the wrong context.

@laoneo
Copy link
Contributor

laoneo commented Jun 19, 2024

Why would it affect the joomla-cms repository?

@muhme
Copy link
Contributor Author

muhme commented Jun 19, 2024

Why would it affect the joomla-cms repository?

If understand right, disable statistics during Joomla System Tests installation is faster with a database commend. Therefore line cy.disableStatistics(); in file joomla-cms:tests/System/integration/install/Installation.cy.js needs to be replaced with a database command.

(Database commands is number 6 in architecture picture with interactions – System Tests has Cypress custom Database Commands to interact with the database. In this PR we are in joomla-cypress as Cypress helper without database access – if i understand you correctly.)

@laoneo
Copy link
Contributor

laoneo commented Jun 19, 2024

Inside the disableStatistics function, can you not just do

cy.task('queryDB', "update #__extensions set enabled=0 WHERE name = 'plg_system_stats'");

@muhme
Copy link
Contributor Author

muhme commented Jun 19, 2024

No sorry, Joomla System Tests' Cypress tasks are not available in joomla-cypress, they are running in node and not in Browser, in the architecture picture see Tasks on the right left with number 4 – Cypress Tasks are used to execute code within the Cypress Node.js context. These tasks are triggered by the Cypress Test Runner, which runs in the browser, and are typically used for operations like interacting with the file system.

The tasks are triggered by Joomla System Tests and not by joomla-cypress, this is shown in picture, as the arrow is going to Cypress Test Runner and not to joomla-cypress.

@laoneo laoneo merged commit 9441acf into joomla-projects:main Jun 21, 2024
@laoneo
Copy link
Contributor

laoneo commented Jun 21, 2024

I'm merging it for now, so we can tag soon a release.

@laoneo
Copy link
Contributor

laoneo commented Jun 21, 2024

Thanks!

@muhme
Copy link
Contributor Author

muhme commented Jun 21, 2024

I'm merging it for now, so we can tag soon a release.

Great and after that I will test joomla-cms and manual-examples and create PRs. If I can help please let me know.

@muhme muhme deleted the joomla-release-independent branch July 12, 2024 10:48
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.

3 participants