From dcd5ff5e08af9172eed43e0bd00e0fcde3f40599 Mon Sep 17 00:00:00 2001 From: muhme Date: Wed, 19 Jun 2024 10:46:17 +0200 Subject: [PATCH 1/5] Update README - Enhanced usage samples with manual-examples - Removed the manually created TOC and provided a hint to use GitHub's auto-generated TOC. - Named support for development branches - Used upercase first letter in headlines - Sorted the categories below custom commands and the functions below categries This README will be extended in one more PR with functional descriptions. --- README.md | 140 ++++++++++++++++++++++-------------------------------- 1 file changed, 56 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 5a38033..27a31c7 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,23 @@ # Joomla Cypress This is a support package that helps in writing end-to-end tests for the [Joomla CMS](https://joomla.org) and its extensions with the frontend testing tool [Cypress](/https://www.cypress.io/). +Joomla versions 4 and 5, as well as all active Joomla development branches, are supported. + +## Cypress Custom Commands for Joomla + The Cypress API is extended with [custom commands](https://docs.cypress.io/api/cypress-api/custom-commands). +The Cypress custom commands for Joomla are grouped into the following categories: +* Common +* Extensions +* Joomla +* Support +* User -Joomla versions 4 and 5 are supported. +All custom commands are list following, if you like to see the overall list you can use READMEs top right TOC button. -## Usage -You can see the usage by sample: -* [joomla-cms](https://github.com/joomla/joomla-cms/tree/5.0-dev/tests/System) – e.g. cy.doAdministratorLogin() or cy.clickToolbarButton() -* [quote_joomla](https://github.com/muhme/quote_joomla/test) – Joomla plus module installation - -## Overview of custom Cypress commands for Joomla testing available in this package v1.0.3 - - -- [commonCommands](#commoncommands) - - [iframe](#iframe) -- [extensionCommands](#extensioncommands) - - [installExtensionFromFolder](#installextensionfromfolder) - - [installExtensionFromUrl](#installextensionfromurl) - - [installExtensionFromFileUpload](#installextensionfromfileupload) - - [uninstallExtension](#uninstallextension) - - [installLanguage](#installlanguage) - - [enablePlugin](#enableplugin) - - [setModulePosition](#setmoduleposition) - - [publishModule](#publishmodule) - - [displayModuleOnAllPages](#displaymoduleonallpages) -- [joomlaCommands](#joomlacommands) - - [installJoomla](#installjoomla) - - [cancelTour](#canceltour) - - [disableStatistics](#disablestatistics) - - [setErrorReportingToDevelopment](#seterrorreportingtodevelopment) - - [installJoomlaMultilingualSite](#installjoomlamultilingualsite) -- [supportCommands](#supportcommands) - - [clickToolbarButton](#clicktoolbarbutton) - - [checkForPhpNoticesOrWarnings](#checkforphpnoticesorwarnings) - - [checkForSystemMessage](#checkforsystemmessage) - - [searchForItem](#searchforitem) - - [setFilter](#setfilter) - - [checkAllResults](#checkallresults) - - [createMenuItem](#createmenuitem) - - [createCategory](#createcategory) - - [selectOptionInFancySelect](#selectoptioninfancyselect) - - [toggleSwitch](#toggleswitch) -- [userCommands](#usercommands) - - [doAdministratorLogin](#doadministratorlogin) - - [doAdministratorLogout](#doadministratorlogout) - - [doFrontendLogin](#dofrontendlogin) - - [doFrontendLogout](#dofrontendlogout) - - [createUser](#createuser) - - - -## commonCommands - -### iframe +### Common Commands + +#### iframe **Command** @@ -77,9 +41,9 @@ const isIframeLoaded = $iframe => {...}; Represents the iframe element being processed. \ Used to manage the iframe's loading state and retrieve its content once loaded. -## extensionCommands +### Extensions Commands -### installExtensionFromFolder +#### installExtensionFromFolder **Command** @@ -105,7 +69,7 @@ const installExtensionFromFolder = (path, type = 'Extension') => {...}; --- -### installExtensionFromUrl +#### installExtensionFromUrl **Command** @@ -130,7 +94,7 @@ const installExtensionFromUrl = (url, type = 'Extension') => {...}; --- -### installExtensionFromFileUpload +#### installExtensionFromFileUpload **Command** @@ -152,7 +116,7 @@ const installExtensionFromFileUpload = (file, type = 'Extension') => {...}; --- -### uninstallExtension +#### uninstallExtension **Command** @@ -171,7 +135,7 @@ const uninstallExtension = (extensionName) => {...}; --- -### installLanguage +#### installLanguage **Command** @@ -190,7 +154,7 @@ const installLanguage = (languageName) => {...}; --- -### enablePlugin +#### enablePlugin **Command** @@ -209,7 +173,7 @@ const enablePlugin = (pluginName) => {...}; --- -### setModulePosition +#### setModulePosition **Command** @@ -230,7 +194,7 @@ const setModulePosition = (module, position = 'position-7') => {...}; --- -### publishModule +#### publishModule **Command** @@ -249,7 +213,7 @@ const publishModule = (module) => {...}; --- -### displayModuleOnAllPages +#### displayModuleOnAllPages **Command** @@ -268,9 +232,9 @@ const displayModuleOnAllPages = (module) => {...}; --- -## joomlaCommands +### Joomla Commands -### installJoomla +#### installJoomla **Command** @@ -294,7 +258,7 @@ const installJoomla = (config) => {...}; --- -### cancelTour +#### cancelTour **Command** @@ -318,7 +282,7 @@ None used. --- -### disableStatistics +#### disableStatistics **Command** @@ -342,7 +306,7 @@ None used. --- -### setErrorReportingToDevelopment +#### setErrorReportingToDevelopment **Command** @@ -366,7 +330,7 @@ None used. --- -### installJoomlaMultilingualSite +#### installJoomlaMultilingualSite **Command** @@ -391,9 +355,9 @@ Configuration object containing sitename, name, username, password, email, db_ty - `languages`: \ Array of languages to be installed (default is an empty array). -## supportCommands +### Support Commands -### clickToolbarButton +#### clickToolbarButton **Command** @@ -420,7 +384,7 @@ const clickToolbarButton = (button, subselector = null) => {...}; --- -### checkForPhpNoticesOrWarnings +#### checkForPhpNoticesOrWarnings **Command** @@ -444,7 +408,7 @@ None used. --- -### checkForSystemMessage +#### checkForSystemMessage **Command** @@ -469,7 +433,7 @@ const checkForSystemMessage = (contain) => {...}; --- -### searchForItem +#### searchForItem **Command** @@ -494,7 +458,7 @@ const searchForItem = (name = null) => {...}; --- -### setFilter +#### setFilter **Command** @@ -521,7 +485,7 @@ const setFilter = (name, value) => {...}; --- -### checkAllResults +#### checkAllResults **Command** @@ -545,7 +509,7 @@ None used. --- -### createMenuItem +#### createMenuItem **Command** @@ -578,7 +542,7 @@ const createMenuItem = (menuTitle, menuCategory, menuItem, menu = 'Main Menu', l --- -### createCategory +#### createCategory **Command** @@ -605,7 +569,7 @@ const createCategory = (title, extension = 'com_content') => {...}; --- -### selectOptionInFancySelect +#### selectOptionInFancySelect **Command** @@ -632,7 +596,7 @@ const selectOptionInFancySelect = (selectId, option) => {...}; --- -### toggleSwitch +#### toggleSwitch **Command** @@ -659,9 +623,9 @@ const toggleSwitch = (fieldName, valueName) => {...}; --- -## userCommands +### User Commands -### doAdministratorLogin +#### doAdministratorLogin **Command** @@ -680,7 +644,6 @@ variables. const doAdministratorLogin = (user, password, useSnapshot = true) => {...}; ``` - **Variables** - `user`: \ @@ -692,7 +655,7 @@ Boolean flag to determine if the session should be cached across specs (default --- -### doAdministratorLogout +#### doAdministratorLogout **Command** @@ -716,7 +679,7 @@ None used. --- -### doFrontendLogin +#### doFrontendLogin **Command** @@ -745,7 +708,7 @@ Boolean flag to determine if the session should be cached across specs (default --- -### doFrontendLogout +#### doFrontendLogout **Command** @@ -769,7 +732,7 @@ None used. --- -### createUser +#### createUser **Command** @@ -801,3 +764,12 @@ Email address for the new user. User group to assign the new user (default is 'Super Users'). --- + +## Usage Samples +You can see the usage by sample: +* [joomla-cms](https://github.com/joomla/joomla-cms/tree/5.0-dev/tests/System) – The Joomla System Tests, using e.g. + `cy.installJoomla`, `cy.doFrontendLogin()` or `cy.clickToolbarButton` +* [manual-examples](https://github.com/joomla/manual-examples) - Testing the Joomla module tutorial sample + from the development manual, using e.g. `cy.doAdministratorLogin`, `cy.setModulePosition`, `cy.installExtensionFromFileUpload` or +* [quote_joomla](https://github.com/muhme/quote_joomla/test) – Installation of a Joomla module, using e.g. + `cy.installJoomlaMultilingualSite`, `cy.installExtensionFromFolder` or `cy.publishModule` From 727d98dfc84dd810051e9b72e97254463ae08e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20L=C3=BCbbe?= Date: Wed, 19 Jun 2024 10:58:04 +0200 Subject: [PATCH 2/5] small copy&paste fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27a31c7..aa49872 100644 --- a/README.md +++ b/README.md @@ -770,6 +770,6 @@ You can see the usage by sample: * [joomla-cms](https://github.com/joomla/joomla-cms/tree/5.0-dev/tests/System) – The Joomla System Tests, using e.g. `cy.installJoomla`, `cy.doFrontendLogin()` or `cy.clickToolbarButton` * [manual-examples](https://github.com/joomla/manual-examples) - Testing the Joomla module tutorial sample - from the development manual, using e.g. `cy.doAdministratorLogin`, `cy.setModulePosition`, `cy.installExtensionFromFileUpload` or + from the development manual, using e.g. `cy.doAdministratorLogin`, `cy.setModulePosition` or `cy.installExtensionFromFileUpload` * [quote_joomla](https://github.com/muhme/quote_joomla/test) – Installation of a Joomla module, using e.g. `cy.installJoomlaMultilingualSite`, `cy.installExtensionFromFolder` or `cy.publishModule` From 660ba4e40accc0d3dd8e309bef4c9941250529fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20L=C3=BCbbe?= Date: Wed, 19 Jun 2024 11:17:34 +0200 Subject: [PATCH 3/5] Corret URLs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa49872..65cc93e 100644 --- a/README.md +++ b/README.md @@ -767,9 +767,9 @@ User group to assign the new user (default is 'Super Users'). ## Usage Samples You can see the usage by sample: -* [joomla-cms](https://github.com/joomla/joomla-cms/tree/5.0-dev/tests/System) – The Joomla System Tests, using e.g. +* [joomla-cms](https://github.com/joomla/joomla-cms//blob/HEAD/tests/System) see `tests/System` – The Joomla System Tests, using e.g. `cy.installJoomla`, `cy.doFrontendLogin()` or `cy.clickToolbarButton` * [manual-examples](https://github.com/joomla/manual-examples) - Testing the Joomla module tutorial sample from the development manual, using e.g. `cy.doAdministratorLogin`, `cy.setModulePosition` or `cy.installExtensionFromFileUpload` -* [quote_joomla](https://github.com/muhme/quote_joomla/test) – Installation of a Joomla module, using e.g. +* [quote_joomla](https://github.com/muhme/quote_joomla/tree/main/test) – Installation of a Joomla module, using e.g. `cy.installJoomlaMultilingualSite`, `cy.installExtensionFromFolder` or `cy.publishModule` From 5627f27742b88e0ec75951b6e573b338f49b5591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20L=C3=BCbbe?= Date: Wed, 19 Jun 2024 11:25:46 +0200 Subject: [PATCH 4/5] Use eye-catcher --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65cc93e..e0790d9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The Cypress custom commands for Joomla are grouped into the following categories * Support * User -All custom commands are list following, if you like to see the overall list you can use READMEs top right TOC button. +:point_right: If you would like to see the complete list of custom commands, you can use the TOC button at the top right of the README. ### Common Commands From 76e492d12bf6e9836e1b894bee972ec708c7cbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20L=C3=BCbbe?= Date: Wed, 19 Jun 2024 13:19:36 +0200 Subject: [PATCH 5/5] Removed naming Joomla versions --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index e0790d9..9852dd4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Joomla Cypress This is a support package that helps in writing end-to-end tests for the [Joomla CMS](https://joomla.org) and its extensions with the frontend testing tool [Cypress](/https://www.cypress.io/). - -Joomla versions 4 and 5, as well as all active Joomla development branches, are supported. +All active Joomla development [branches](https://github.com/joomla/joomla-cms/branches) are supported. ## Cypress Custom Commands for Joomla