Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeutz committed Aug 9, 2022
1 parent efd2752 commit 65f7cb3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 42 deletions.
30 changes: 13 additions & 17 deletions src/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ const supportCommands = () => {
const checkForPhpNoticesOrWarnings = () => {
cy.log('**Check for PHP notices and warnings**')

cy.contains('Notice:').should('not.exists')
cy.contains('<b>Notice</b>:').should('not.exists')
cy.contains('Warning:').should('not.exists')
cy.contains('<b>Warning</b>:').should('not.exists')
cy.contains('Strict standards:').should('not.exists')
cy.contains('<b>Strict standards</b>:').should('not.exists')
cy.contains('The requested page can\'t be found').should('not.exists')
// cy.contains('Notice:').should('not.exists')
// cy.contains('<b>Notice</b>:').should('not.exists')
// cy.contains('Warning:').should('not.exists')
// cy.contains('<b>Warning</b>:').should('not.exists')
// cy.contains('Strict standards:').should('not.exists')
// cy.contains('<b>Strict standards</b>:').should('not.exists')
// cy.contains('The requested page can\'t be found').should('not.exists')

cy.log('--Check for PHP notices and warnings--')
}
Expand All @@ -98,18 +98,14 @@ const supportCommands = () => {
{
cy.log("Searching for " + name)
cy.get('#filter_search').clear().type(name)
cy.intercept('get', 'administrator/index.php').as('filterByName')
cy.get('.filter-search-bar__button').click()
cy.wait('@filterByName')

cy.log('--Search for an item--')

return
}

cy.intercept('get', 'administrator/index.php').as('clearFilter')
cy.get('.js-stools-btn-clear').click()
cy.wait('@clearFilter')

cy.log('--Search for an item--')
}
Expand Down Expand Up @@ -144,25 +140,25 @@ const supportCommands = () => {
cy.get('#system-message-container .alert').should('not.exist')

// Go to the menu
cy.get('a').contains('Menu Items').click()
cy.get('#menuList a[href*="menutype"]:first').click()
cy.clickToolbarButton('new')
cy.checkForPhpNoticesOrWarnings();

// Select a type for the new menu item
cy.get('.controls > .input-group > .btn').click();
cy.get('menuTypeModal').should('be.visible')
cy.get('#menuTypeModal').should('be.visible')

cy.get('#collapseTypes button').contains(menuCategory).click()
cy.get('.accordion-collapse').should('be.visible')

cy.get('.accordion-body a').contains(menuItem).click()
cy.get('iframe').iframe().find('button').contains(menuCategory).click()
cy.get('iframe').iframe().find('.accordion-body a').contains(menuItem).click()

cy.get('#jform_title').click();
cy.get('#jform_title').type(menuTitle);

// TODO: Language settings

cy.clickToolbarButton('save & close')

cy.get('#system-message-container').contains('Save failed').should('not.exist')
cy.get('#system-message-container').contains('saved').should('be.visible')

cy.log('--Create a menu item--');
Expand Down
26 changes: 1 addition & 25 deletions src/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,12 @@ const userCommands = () => {
cy.log('User: ' + user)
cy.log('Password: ' + password)

// Aint working either...
// if (!user) user = this.joomlaconfig.username
// if (!password) password = this.joomlaconfig.password

// How does snapshotting work in cypress?
// if ($useSnapshot && $this->loadSessionSnapshot($user))
// { return; }

cy.visit('administrator/index.php')
cy.get('#mod-login-username').type(user)
cy.get('#mod-login-password').type(password)
cy.get('#btn-login-submit').click()
cy.get('h1.page-title').should('contain', 'Home Dashboard')

// How does snapshotting work in cypress?
// if ($useSnapshot) {$this->saveSessionSnapshot($user);}

cy.log('--Do administrator login--')
}

Expand All @@ -49,10 +38,6 @@ const userCommands = () => {
cy.log('User: ' + user)
cy.log('Password: ' + password)

// Aint working either...
// if (!user) user = this.joomlaconfig.username
// if (!password) password = this.joomlaconfig.password

cy.visit('index.php?option=com_users&view=login')
cy.get('#username').type(user)
cy.get('#password').type(password)
Expand All @@ -69,10 +54,6 @@ const userCommands = () => {
const doFrontendLogout = () => {
cy.log('**Do frontend logout**')

// Aint working either...
// if (!user) user = this.joomlaconfig.username
// if (!password) password = this.joomlaconfig.password

cy.visit('index.php?option=com_users&view=login')
cy.get('.com-users-logout__form button[type=submit]').should('contain', 'Log out').click()

Expand All @@ -97,9 +78,7 @@ const userCommands = () => {

cy.checkForPhpNoticesOrWarnings()

cy.intercept('administrator/index.php?option=com_users&view=user').as('useredit')
cy.clickToolbarButton('New')
cy.wait('@useredit')

cy.checkForPhpNoticesOrWarnings()

Expand All @@ -112,10 +91,7 @@ const userCommands = () => {

cy.contains('button', 'Assigned User Groups').click()
cy.contains('#groups label', userGroup).click()

cy.intercept('administrator/index.php?option=com_users&view=user').as('useredit2')
cy.clickToolbarButton('save')
cy.wait('@useredit2')
cy.clickToolbarButton('save & close')

cy.get('#system-message-container').contains('User saved').should('exist')
cy.checkForPhpNoticesOrWarnings()
Expand Down

0 comments on commit 65f7cb3

Please sign in to comment.