summaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-12-11 12:29:46 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-10-19 11:54:09 +0200
commitd10c4c3f6dc619676672655d274c4dc8c87e3138 (patch)
tree2e75e224f7175ab5d0abb1c5b66b3aaf768cca5c /cypress
parenta572a547f97e8643863958fba12410ac1a60db54 (diff)
downloadnextcloud-server-d10c4c3f6dc619676672655d274c4dc8c87e3138.tar.gz
nextcloud-server-d10c4c3f6dc619676672655d274c4dc8c87e3138.zip
Add additional no-background and custom colour test
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/theming/admin-settings.cy.ts90
1 files changed, 70 insertions, 20 deletions
diff --git a/cypress/e2e/theming/admin-settings.cy.ts b/cypress/e2e/theming/admin-settings.cy.ts
index 5a0a81432b5..750fa5c230e 100644
--- a/cypress/e2e/theming/admin-settings.cy.ts
+++ b/cypress/e2e/theming/admin-settings.cy.ts
@@ -30,7 +30,7 @@ const admin = new User('admin', 'admin')
const defaultPrimary = '#0082c9'
const defaultBackground = 'kamil-porembinski-clouds.jpg'
-describe('Admin theming settings', function() {
+describe('Admin theming settings visibility check', function() {
before(function() {
// Just in case previous test failed
cy.resetAdminTheming()
@@ -50,8 +50,9 @@ describe('Admin theming settings', function() {
})
})
-describe('Change the primary colour and reset it', function() {
+describe('Change the primary color and reset it', function() {
let selectedColor = ''
+
before(function() {
// Just in case previous test failed
cy.resetAdminTheming()
@@ -63,7 +64,7 @@ describe('Change the primary colour and reset it', function() {
cy.get('[data-admin-theming-settings]').scrollIntoView().should('be.visible')
})
- it('Change the primary colour', function() {
+ it('Change the primary color', function() {
cy.intercept('*/apps/theming/ajax/updateStylesheet').as('setColor')
pickRandomColor('[data-admin-theming-setting-primary-color-picker]')
@@ -73,18 +74,18 @@ describe('Change the primary colour and reset it', function() {
cy.waitUntil(() => validateBodyThemingCss(selectedColor, defaultBackground))
})
- it('Screenshot the login page', function() {
+ it('Screenshot the login page and validate login page', function() {
cy.logout()
cy.visit('/')
+
+ cy.waitUntil(() => validateBodyThemingCss(selectedColor, defaultBackground))
cy.screenshot()
})
- it('Undo theming settings', function() {
+ it('Undo theming settings and validate login page again', function() {
cy.resetAdminTheming()
- })
-
- it('Screenshot the login page', function() {
cy.visit('/')
+
cy.waitUntil(validateBodyThemingCss)
cy.screenshot()
})
@@ -116,18 +117,67 @@ describe('Remove the default background and restore it', function() {
}))
})
- it('Screenshot the login page', function() {
+ it('Screenshot the login page and validate login page', function() {
cy.logout()
cy.visit('/')
+
+ cy.waitUntil(() => validateBodyThemingCss(defaultPrimary, ''))
cy.screenshot()
})
- it('Undo theming settings', function() {
+ it('Undo theming settings and validate login page again', function() {
+ cy.resetAdminTheming()
+ cy.visit('/')
+
+ cy.waitUntil(validateBodyThemingCss)
+ cy.screenshot()
+ })
+})
+
+describe('Remove the default background with a custom primary color', function() {
+ let selectedColor = ''
+
+ before(function() {
+ // Just in case previous test failed
cy.resetAdminTheming()
+ cy.login(admin)
})
- it('Screenshot the login page', function() {
+ it('See the admin theming section', function() {
+ cy.visit('/settings/admin/theming')
+ cy.get('[data-admin-theming-settings]').scrollIntoView().should('be.visible')
+ })
+
+ it('Change the primary color', function() {
+ cy.intercept('*/apps/theming/ajax/updateStylesheet').as('setColor')
+
+ pickRandomColor('[data-admin-theming-setting-primary-color-picker]')
+ .then(color => selectedColor = color)
+
+ cy.wait('@setColor')
+ cy.waitUntil(() => validateBodyThemingCss(selectedColor, defaultBackground))
+ })
+
+ it('Remove the default background', function() {
+ cy.intercept('*/apps/theming/ajax/updateStylesheet').as('removeBackground')
+
+ cy.get('[data-admin-theming-setting-file-remove]').click()
+
+ cy.wait('@removeBackground')
+ })
+
+ it('Screenshot the login page and validate login page', function() {
+ cy.logout()
+ cy.visit('/')
+
+ cy.waitUntil(() => validateBodyThemingCss(selectedColor, ''))
+ cy.screenshot()
+ })
+
+ it('Undo theming settings and validate login page again', function() {
+ cy.resetAdminTheming()
cy.visit('/')
+
cy.waitUntil(validateBodyThemingCss)
cy.screenshot()
})
@@ -154,7 +204,7 @@ describe('Remove the default background with a bright color', function() {
cy.wait('@removeBackground')
})
- it('Change the primary colour', function() {
+ it('Change the primary color', function() {
cy.intercept('*/apps/theming/ajax/updateStylesheet').as('setColor')
// Pick one of the bright color preset
@@ -229,7 +279,7 @@ describe('Change the login fields then reset them', function() {
.scrollIntoView().should('be.visible')
})
- it('Check login screen changes', function() {
+ it('Validate login screen changes', function() {
cy.logout()
cy.visit('/')
@@ -243,7 +293,7 @@ describe('Change the login fields then reset them', function() {
cy.resetAdminTheming()
})
- it('Check login screen changes', function() {
+ it('Validate login screen changes again', function() {
cy.visit('/')
cy.get('[data-login-form-headline]').should('not.contain.text', name)
@@ -265,7 +315,7 @@ describe('Disable user theming and enable it back', function() {
cy.get('[data-admin-theming-settings]').scrollIntoView().should('be.visible')
})
- it('Disable user theming', function() {
+ it('Disable user background theming', function() {
cy.intercept('*/apps/theming/ajax/updateStylesheet').as('disableUserTheming')
cy.get('[data-admin-theming-setting-disable-user-theming]')
@@ -283,13 +333,13 @@ describe('Disable user theming and enable it back', function() {
})
})
- it('See the user disabled background settings', function() {
+ it('User cannot not change background settings', function() {
cy.visit('/settings/user/theming')
cy.get('[data-user-theming-background-disabled]').scrollIntoView().should('be.visible')
})
})
-describe('User default option matches admin theming', function() {
+describe('The user default background settings reflect the admin theming settings', function() {
let selectedColor = ''
before(function() {
@@ -307,7 +357,7 @@ describe('User default option matches admin theming', function() {
cy.get('[data-admin-theming-settings]').scrollIntoView().should('be.visible')
})
- it('Change the primary colour', function() {
+ it('Change the primary color', function() {
cy.intercept('*/apps/theming/ajax/updateStylesheet').as('setColor')
pickRandomColor('[data-admin-theming-setting-primary-color-picker]')
@@ -333,7 +383,7 @@ describe('User default option matches admin theming', function() {
}))
})
- it('Logout and check changes', function() {
+ it('Login page should match admin theming settings', function() {
cy.logout()
cy.visit('/')
@@ -351,7 +401,7 @@ describe('User default option matches admin theming', function() {
cy.get('[data-user-theming-background-settings]').scrollIntoView().should('be.visible')
})
- it('See the default background option selected', function() {
+ it('Default user background settings should match admin theming settings', function() {
cy.get('[data-user-theming-background-default]').should('be.visible')
cy.get('[data-user-theming-background-default]').should('have.class', 'background--active')