diff --git a/README.md b/README.md index 9cca6da..7f72670 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ After the command, the 'Joomla Installer' screen remains open in the session. :warning: The `/installation` folder is not deleted after the installation. This allows multiple runs of the command `installJoomla`. -For production sites the `/installation` folder needs to be deleted after installation. +For production sites the `/installation` folder needs to be deleted after installation. See also [installJoomlaMultilingualSite](#installjoomlamultilingualsite). @@ -230,7 +230,9 @@ cy.installJoomla(config) ##### Arguments - **`config`** *(object)*: Configuration object containing sitename, name, username, password, email, - db_type, db_host, db_user, db_password, db_name and db_prefix. + db_type, db_host, db_port, db_user, db_password, db_name and db_prefix. + +:point_right: The use of `db_port` for a non-standard database port currently (August 2024) only works for MariaDB and MySQL. ##### Example @@ -243,6 +245,7 @@ const config = { email: "sampleuser@example.com", db_type: "MySQLi", db_host: "localhost", + db_port: "3316" db_user: "joomla", db_password: "joomla-db-user-password", db_name: "sample_joomla", @@ -273,9 +276,11 @@ cy.installJoomlaMultilingualSite(config, languages) ##### Arguments - **`config`** *(object)*: Configuration object containing sitename, name, username, password, email, - db_type, db_host, db_user, db_password, db_name and db_prefix. + db_type, db_host, db_port, db_user, db_password, db_name and db_prefix. - **`languages`** *(string[], optional, default: ["French"])*: Array of additional languages to be installed. +:point_right: The use of `db_port` for a non-standard database port currently (August 2024) only works for MariaDB and MySQL. + ##### Example ```javascript @@ -287,6 +292,7 @@ const config = { email: "sampleuser@example.com", db_type: "MySQLi", db_host: "localhost", + db_port: "3316", db_user: "joomla", db_password: "joomla-db-user-password", db_name: "sample_joomla", diff --git a/src/joomla.js b/src/joomla.js index 028942a..5791d13 100644 --- a/src/joomla.js +++ b/src/joomla.js @@ -25,8 +25,13 @@ const joomlaCommands = () => { cy.get('#step2').click() // Fill database configuration + let connection = config.db_host + if (config.db_port && config.db_port.trim() !== "") { + // host:port currently (August 2024) only work for MariaDB and MySQL + connection += `:${config.db_port.trim()}`; + } cy.get('#jform_db_type').select(config.db_type) - cy.get('#jform_db_host').clear().type(config.db_host) + cy.get('#jform_db_host').clear().type(connection) cy.get('#jform_db_user').type(config.db_user) if (config.db_password) {