|
| 1 | +/** |
| 2 | + * @copyright Copyright (c) 2021 Louis Chemineau <[email protected]> |
| 3 | + * |
| 4 | + * @author Louis Chemineau <[email protected]> |
| 5 | + * |
| 6 | + * @license GNU AGPL version 3 or any later version |
| 7 | + * |
| 8 | + * This program is free software: you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU Affero General Public License as |
| 10 | + * published by the Free Software Foundation, either version 3 of the |
| 11 | + * License, or (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU Affero General Public License for more details. |
| 17 | + * |
| 18 | + * You should have received a copy of the GNU Affero General Public License |
| 19 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | + * |
| 21 | + */ |
| 22 | + |
| 23 | +/// <reference types="Cypress" /> |
| 24 | + |
| 25 | +import { randHash } from '../utils' |
| 26 | +const randUser = randHash() |
| 27 | + |
| 28 | +describe('Check that user\'s settings survive a reload', () => { |
| 29 | + before(() => { |
| 30 | + cy.nextcloudCreateUser(randUser, 'password') |
| 31 | + cy.login(randUser, 'password') |
| 32 | + cy.visit('/settings/user/activity') |
| 33 | + cy.wait(1000) |
| 34 | + }) |
| 35 | + |
| 36 | + after(() => { |
| 37 | + cy.logout() |
| 38 | + }) |
| 39 | + |
| 40 | + it('Form survive a reload', () => { |
| 41 | + cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked') |
| 42 | + |
| 43 | + cy.reload() |
| 44 | + |
| 45 | + cy.get("#app-content input[type='checkbox']").uncheck({force: true}).should('not.be.checked') |
| 46 | + |
| 47 | + cy.get("#file_changed_notification").check({force: true}) |
| 48 | + cy.contains("A calendar was modified").click() |
| 49 | + cy.contains("Other activities").parentsUntil('table').contains("Push").click() |
| 50 | + cy.contains("Comments for files").click() |
| 51 | + cy.contains("Your password or email was modified").click() |
| 52 | + |
| 53 | + cy.reload() |
| 54 | + |
| 55 | + cy.get("#file_favorite_changed_email").should('not.be.checked') |
| 56 | + cy.get("#file_favorite_changed_notification").should('not.be.checked') |
| 57 | + cy.get("#file_changed_email").should('not.be.checked') |
| 58 | + cy.get("#file_changed_notification").should('be.checked') |
| 59 | + cy.get("#favorite_email").should('not.be.checked') |
| 60 | + cy.get("#favorite_notification").should('not.be.checked') |
| 61 | + cy.get("#shared_email").should('not.be.checked') |
| 62 | + cy.get("#shared_notification").should('not.be.checked') |
| 63 | + cy.get("#remote_share_email").should('not.be.checked') |
| 64 | + cy.get("#remote_share_notification").should('not.be.checked') |
| 65 | + cy.get("#public_links_email").should('not.be.checked') |
| 66 | + cy.get("#public_links_notification").should('not.be.checked') |
| 67 | + cy.get("#calendar_email").should('be.checked') |
| 68 | + cy.get("#calendar_notification").should('be.checked') |
| 69 | + cy.get("#calendar_event_email").should('not.be.checked') |
| 70 | + cy.get("#calendar_event_notification").should('not.be.checked') |
| 71 | + cy.get("#calendar_todo_email").should('not.be.checked') |
| 72 | + cy.get("#calendar_todo_notification").should('not.be.checked') |
| 73 | + cy.get("#contacts_email").should('not.be.checked') |
| 74 | + cy.get("#contacts_notification").should('not.be.checked') |
| 75 | + cy.get("#group_settings_email").should('not.be.checked') |
| 76 | + cy.get("#group_settings_notification").should('be.checked') |
| 77 | + cy.get("#personal_settings_email").should('not.be.checked') |
| 78 | + cy.get("#personal_settings_notification").should('not.be.checked') |
| 79 | + cy.get("#security_email").should('not.be.checked') |
| 80 | + cy.get("#security_notification").should('be.checked') |
| 81 | + cy.get("#comments_email").should('be.checked') |
| 82 | + cy.get("#comments_notification").should('be.checked') |
| 83 | + cy.get("#systemtags_email").should('not.be.checked') |
| 84 | + cy.get("#systemtags_notification").should('be.checked') |
| 85 | + }) |
| 86 | + |
| 87 | + it('Notification frequency survive a reload', () => { |
| 88 | + cy.get(".notification-frequency__select").select("Weekly") |
| 89 | + |
| 90 | + cy.wait(200) |
| 91 | + cy.reload() |
| 92 | + |
| 93 | + cy.get('.notification-frequency__select').find(':selected').contains('Weekly') |
| 94 | + cy.get(".notification-frequency__select").select("Hourly") |
| 95 | + |
| 96 | + cy.wait(200) |
| 97 | + cy.reload() |
| 98 | + |
| 99 | + cy.get('.notification-frequency__select').find(':selected').contains('Hourly') |
| 100 | + }) |
| 101 | + |
| 102 | + it('Activity summary survive a reload', () => { |
| 103 | + let input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section.summary-form').children('input') |
| 104 | + |
| 105 | + input.check({force: true}) |
| 106 | + |
| 107 | + cy.reload() |
| 108 | + input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section.summary-form').children('input') |
| 109 | + |
| 110 | + input.should('be.checked') |
| 111 | + |
| 112 | + input.uncheck({force: true}) |
| 113 | + |
| 114 | + cy.reload() |
| 115 | + input = cy.get("#app-content").contains("Send daily activity summary in the morning").parentsUntil('.settings-section.summary-form').children('input') |
| 116 | + |
| 117 | + input.should('not.be.checked') |
| 118 | + }) |
| 119 | +}) |
0 commit comments