settings.cy.ts 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. // Open the sidebar if it is not already open
  17. cy.get('[aria-label="Open sidebar"]').then(() => {
  18. cy.get('button[id="sidebar-toggle-button"]').click();
  19. });
  20. // Click on the profile link
  21. cy.get('button').contains(adminUser.name).click();
  22. // Click on the settings link
  23. cy.get('button').contains('Settings').click();
  24. });
  25. context('General', () => {
  26. it('user can open the General modal and hit save', () => {
  27. cy.get('button').contains('General').click();
  28. cy.get('button').contains('Save').click();
  29. });
  30. });
  31. context('Connections', () => {
  32. it('user can open the Connections modal and hit save', () => {
  33. cy.get('button').contains('Connections').click();
  34. cy.get('button').contains('Save').click();
  35. });
  36. });
  37. context('Models', () => {
  38. it('user can open the Models modal', () => {
  39. cy.get('button').contains('Models').click();
  40. });
  41. });
  42. context('Interface', () => {
  43. it('user can open the Interface modal and hit save', () => {
  44. cy.get('button').contains('Interface').click();
  45. cy.get('button').contains('Save').click();
  46. });
  47. });
  48. context('Audio', () => {
  49. it('user can open the Audio modal and hit save', () => {
  50. cy.get('button').contains('Audio').click();
  51. cy.get('button').contains('Save').click();
  52. });
  53. });
  54. context('Images', () => {
  55. it('user can open the Images modal and hit save', () => {
  56. cy.get('button').contains('Images').click();
  57. // Currently fails because the backend requires a valid URL
  58. // cy.get('button').contains('Save').click();
  59. });
  60. });
  61. context('Chats', () => {
  62. it('user can open the Chats modal', () => {
  63. cy.get('button').contains('Chats').click();
  64. });
  65. });
  66. context('Account', () => {
  67. it('user can open the Account modal and hit save', () => {
  68. cy.get('button').contains('Account').click();
  69. cy.get('button').contains('Save').click();
  70. });
  71. });
  72. context('About', () => {
  73. it('user can open the About modal', () => {
  74. cy.get('button').contains('About').click();
  75. });
  76. });
  77. });