settings.cy.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // eslint-disable-next-line @typescript-eslint/triple-slash-reference
  2. /// <reference path="../support/index.d.ts" />
  3. import { adminUser } from '../support/e2e';
  4. // These tests run through the various settings pages, ensuring that the user can interact with them as expected
  5. describe('Settings', () => {
  6. // Wait for 2 seconds after all tests to fix an issue with Cypress's video recording missing the last few frames
  7. after(() => {
  8. // eslint-disable-next-line cypress/no-unnecessary-waiting
  9. cy.wait(2000);
  10. });
  11. beforeEach(() => {
  12. // Login as the admin user
  13. cy.loginAdmin();
  14. // Visit the home page
  15. cy.visit('/');
  16. // Click on the user menu
  17. cy.get('button[aria-label="User Menu"]').click();
  18. // Click on the settings link
  19. cy.get('button').contains('Settings').click();
  20. });
  21. context('General', () => {
  22. it('user can open the General modal and hit save', () => {
  23. cy.get('button').contains('General').click();
  24. cy.get('button').contains('Save').click();
  25. });
  26. });
  27. context('Interface', () => {
  28. it('user can open the Interface modal and hit save', () => {
  29. cy.get('button').contains('Interface').click();
  30. cy.get('button').contains('Save').click();
  31. });
  32. });
  33. context('Audio', () => {
  34. it('user can open the Audio modal and hit save', () => {
  35. cy.get('button').contains('Audio').click();
  36. cy.get('button').contains('Save').click();
  37. });
  38. });
  39. context('Chats', () => {
  40. it('user can open the Chats modal', () => {
  41. cy.get('button').contains('Chats').click();
  42. });
  43. });
  44. context('Account', () => {
  45. it('user can open the Account modal and hit save', () => {
  46. cy.get('button').contains('Account').click();
  47. cy.get('button').contains('Save').click();
  48. });
  49. });
  50. context('About', () => {
  51. it('user can open the About modal', () => {
  52. cy.get('button').contains('About').click();
  53. });
  54. });
  55. });