01_online_live.cy.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { setup } from '../../support/setup.js';
  2. import fetchData from '../../support/fetchData.js';
  3. import filterTests from '../../support/filterTests';
  4. setup();
  5. describe(`Live tests`, () => {
  6. it('Can visit the page', () => {
  7. cy.visit('http://localhost:8080');
  8. });
  9. it('Should have a play button', () => {
  10. cy.get('.vjs-big-play-button').should('be.visible');
  11. });
  12. it('User menu should be visible', () => {
  13. cy.get('#user-menu').should('be.visible');
  14. });
  15. });
  16. filterTests(['desktop'], () => {
  17. describe(`Live desktop tests`, () => {
  18. it('Click on user menu', () => {
  19. cy.get('#user-menu').click();
  20. });
  21. it('Can toggle chat off', () => {
  22. cy.contains('Hide Chat').click();
  23. });
  24. it('Chat should not be visible', () => {
  25. cy.get('#chat-container').should('not.exist');
  26. });
  27. it('Click on user menu', () => {
  28. cy.get('#user-menu').click();
  29. });
  30. it('Can toggle chat on', () => {
  31. cy.contains('Show Chat').click();
  32. });
  33. it('Click on user menu', () => {
  34. cy.get('#user-menu').click();
  35. });
  36. it('Show change name modal', () => {
  37. cy.contains('Change name').click();
  38. });
  39. it('Should change name', () => {
  40. cy.get('#name-change-field').focus();
  41. cy.get('#name-change-field').type('{selectall}');
  42. cy.get('#name-change-field').type('my-new-name');
  43. cy.get('#name-change-submit').click();
  44. cy.wait(1500);
  45. });
  46. it('Should change to custom websocket host', () => {
  47. fetchData('http://localhost:8080/api/admin/config/sockethostoverride', {
  48. method: 'POST',
  49. data: { value: 'ws://localhost:8080' },
  50. });
  51. cy.wait(1500);
  52. });
  53. it('Refresh page with new socket host', () => {
  54. cy.visit('http://localhost:8080');
  55. });
  56. });
  57. });