Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@
"bugs": {
"url": "https://github.com/joomla-projects/joomla-cypress/issues"
},
"homepage": "https://github.com/joomla-projects/joomla-cypress#readme"
"homepage": "https://github.com/joomla-projects/joomla-cypress#readme",
"main": "src",
"files": [
"src"
]
}
6 changes: 6 additions & 0 deletions src/extensions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const extensionsCommands = () => {
}

module.exports = {
extensionsCommands
}
15 changes: 15 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const registerCommands = () => {
const { joomlaCommands } = require('joomla-cypress/src/joomla')
const { extensionsCommands } = require('joomla-cypress/src/extensions')
const { supportCommands } = require('joomla-cypress/src/support')
const { userCommands } = require('joomla-cypress/src/user')

joomlaCommands()
extensionsCommands()
supportCommands()
userCommands()
}

module.exports = {
registerCommands
}
48 changes: 48 additions & 0 deletions src/joomla.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const joomlaCommands = () => {
const installJoomla = (config) => {
cy.log(`**Install Joomla**`)
// Load installation page and check for language dropdown
cy.visit('installation/index.php')
cy.get('#jform_language').should('be.visible')

// Select en-GB as installation language
cy.get('#jform_language').select('English (United Kingdom)')
cy.get('#jform_language-lbl').should('contain', 'Select Language')

// Fill Sitename
cy.get('#jform_site_name').type(config.sitename)
cy.get('#step1').click()

// Fill Admin credentials
cy.get('#jform_admin_user').type(config.name)
cy.get('#jform_admin_username').type(config.username)
cy.get('#jform_admin_password').type(config.password)
cy.get('#jform_admin_email').type(config.email)
cy.get('#step2').click()

// Fill database configuration
cy.get('#jform_db_type').select(config.db_type)
cy.get('#jform_db_host').clear().type(config.db_host)
cy.get('#jform_db_user').type(config.db_user)
if (config.db_password)
cy.get('#jform_db_pass').type(config.db_password)
cy.get('#jform_db_name').clear().type(config.db_name)
cy.get('#jform_db_prefix').clear().type(config.db_prefix)
cy.intercept('index.php?task=installation.*').as('ajax_requests')
cy.get('#setupButton').click()
cy.wait('@ajax_requests')
cy.wait('@ajax_requests')
cy.wait('@ajax_requests')
cy.wait('@ajax_requests')
cy.wait('@ajax_requests')
cy.wait('@ajax_requests')
cy.wait('@ajax_requests')
cy.contains('Congratulations! Your Joomla site is ready.')
}

Cypress.Commands.add('installJoomla', installJoomla)
}

module.exports = {
joomlaCommands
}
6 changes: 6 additions & 0 deletions src/support.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const supportCommands = () => {
}

module.exports = {
supportCommands
}
6 changes: 6 additions & 0 deletions src/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const userCommands = () => {
}

module.exports = {
userCommands
}