Files
owncast/test/automated/browser/cypress/e2e/online/01_online_live.cy.js
Gabe Kangas 69f217f758 Refactor mobile chat into modal (#3038)
* feat(mobile): refactor mobile chat into modal

- Make page always scrollable
- Move mobile chat into a standalone modal

* fix(test): split out mobile browser test specs

* fix(mobile): force chat button to render on top of footer

* fix: some small updates from review

* fix: hide/show hide chat menu option based on width

* fix: chat button icon getting cut off

* chore(tests): add browser tests for mobile chat modal

* chore(tests): add story for ChatModal component

* fix(test): quiet shellcheck

* fix: remove unused import

* fix(tests): silence storybook linting warning

* fix(ui): reposition chat modal button icon with transform
2023-05-22 18:56:44 -07:00

73 lines
1.7 KiB
JavaScript

import { setup } from '../../support/setup.js';
import fetchData from '../../support/fetchData.js';
import filterTests from '../../support/filterTests';
setup();
describe(`Live tests`, () => {
it('Can visit the page', () => {
cy.visit('http://localhost:8080');
});
it('Should have a play button', () => {
cy.get('.vjs-big-play-button').should('be.visible');
});
it('User menu should be visible', () => {
cy.get('#user-menu').should('be.visible');
});
});
filterTests(['desktop'], () => {
describe(`Live desktop tests`, () => {
it('Click on user menu', () => {
cy.get('#user-menu').click();
});
it('Can toggle chat off', () => {
cy.contains('Hide Chat').click();
});
it('Chat should not be visible', () => {
cy.get('#chat-container').should('not.exist');
});
it('Click on user menu', () => {
cy.get('#user-menu').click();
});
it('Can toggle chat on', () => {
cy.contains('Show Chat').click();
});
it('Click on user menu', () => {
cy.get('#user-menu').click();
});
it('Show change name modal', () => {
cy.contains('Change name').click();
});
it('Should change name', () => {
cy.get('#name-change-field').focus();
cy.get('#name-change-field').type('{ctrl+a}');
cy.get('#name-change-field').type('my-new-name');
cy.get('#name-change-submit').click();
cy.get('.ant-modal-close-x').click();
cy.wait(1500);
// cy.contains('is now known as').should('be.visible');
});
it('Should change to custom websocket host', () => {
fetchData('http://localhost:8080/api/admin/config/sockethostoverride', {
method: 'POST',
data: { value: 'ws://localhost:8080' },
});
cy.wait(1500);
});
it('Refresh page with new socket host', () => {
cy.visit('http://localhost:8080');
});
});
});