mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 12:18:02 +03:00
chore(tests): clean up browser tests by splitting out federation UI tests
This commit is contained in:
parent
8fa2546bef
commit
56d52c283c
11 changed files with 86 additions and 46 deletions
|
@ -4,6 +4,7 @@ const { lighthouse, prepareAudit } = require('@cypress-audit/lighthouse');
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
projectId: 'wwi3xe',
|
projectId: 'wwi3xe',
|
||||||
e2e: {
|
e2e: {
|
||||||
|
supportFile: 'cypress/support/e2e.js',
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
on('before:browser:launch', (browser = {}, launchOptions) => {
|
on('before:browser:launch', (browser = {}, launchOptions) => {
|
||||||
prepareAudit(launchOptions);
|
prepareAudit(launchOptions);
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
// describe('Lighthouse Metrics', () => {
|
||||||
|
// beforeEach(() => {
|
||||||
|
// cy.visit('http://localhost:8080');
|
||||||
|
// });
|
||||||
|
|
||||||
|
// it('Capture Metrics', () => {
|
||||||
|
// cy.lighthouse({
|
||||||
|
// accessibility: 97,
|
||||||
|
// 'best-practices': 90,
|
||||||
|
// seo: 90,
|
||||||
|
// performance: 0, // Once the performance issues are fixed revert this 90,
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
import fetchData from '../../support/fetchData.js';
|
||||||
|
|
||||||
|
// Alternatively you can use CommonJS syntax:
|
||||||
|
// require('./commands')
|
||||||
|
|
||||||
|
console.log('------------- support/e2e.js');
|
||||||
|
// Put Owncast in a state where it's ready to be tested.
|
||||||
|
|
||||||
|
// Set server URL
|
||||||
|
fetchData('http://localhost:8080/api/admin/config/serverurl', {
|
||||||
|
method: 'POST',
|
||||||
|
data: { value: 'https://testing.biz' },
|
||||||
|
});
|
||||||
|
|
||||||
|
// Enable Fediverse features.
|
||||||
|
fetchData('http://localhost:8080/api/admin/config/federation/enable', {
|
||||||
|
method: 'POST',
|
||||||
|
data: { value: true },
|
||||||
|
});
|
|
@ -1,14 +0,0 @@
|
||||||
// describe('Lighthouse Metrics', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// cy.visit('http://localhost:8080');
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('Capture Metrics', () => {
|
|
||||||
// cy.lighthouse({
|
|
||||||
// accessibility: 97,
|
|
||||||
// 'best-practices': 90,
|
|
||||||
// seo: 90,
|
|
||||||
// performance: 0, // Once the performance issues are fixed revert this 90,
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -6,13 +6,6 @@ describe(`Basic tests`, () => {
|
||||||
cy.visit('http://localhost:8080/');
|
cy.visit('http://localhost:8080/');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Offline banner
|
|
||||||
it('Has correct offline banner values', () => {
|
|
||||||
cy.contains(
|
|
||||||
'This stream is offline. You can be notified the next time New Owncast Server goes live or follow streamer@testing.biz on the Fediverse.'
|
|
||||||
).should('exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Verify the tags show up
|
// Verify the tags show up
|
||||||
it('Has correct tags visible', () => {
|
it('Has correct tags visible', () => {
|
||||||
cy.contains('#owncast').should('exist');
|
cy.contains('#owncast').should('exist');
|
||||||
|
@ -31,10 +24,6 @@ describe(`Basic tests`, () => {
|
||||||
// cy.get('.ant-modal-close').click();
|
// cy.get('.ant-modal-close').click();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
it('Can change to Followers tab', () => {
|
|
||||||
cy.contains('Followers').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Verify content header values
|
// Verify content header values
|
||||||
it('Has correct content header values', () => {
|
it('Has correct content header values', () => {
|
||||||
cy.get('.header-title').should('have.text', 'New Owncast Server');
|
cy.get('.header-title').should('have.text', 'New Owncast Server');
|
|
@ -15,7 +15,6 @@ const identifiers = [
|
||||||
'#offline-banner', // The entire offline banner component
|
'#offline-banner', // The entire offline banner component
|
||||||
'#custom-page-content', // The entire custom page content component
|
'#custom-page-content', // The entire custom page content component
|
||||||
'#notify-button', // The notify button
|
'#notify-button', // The notify button
|
||||||
'#follow-button', // The follow button
|
|
||||||
];
|
];
|
||||||
|
|
||||||
filterTests(['desktop'], () => {
|
filterTests(['desktop'], () => {
|
||||||
|
@ -31,13 +30,6 @@ filterTests(['desktop'], () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Followers
|
|
||||||
const followersCollection = '#followers-collection';
|
|
||||||
it(`Has identifier: ${followersCollection}`, () => {
|
|
||||||
cy.contains('Followers').click();
|
|
||||||
cy.get(followersCollection).should('be.visible');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Modal
|
// Modal
|
||||||
const modalContainer = '#modal-container';
|
const modalContainer = '#modal-container';
|
||||||
it(`Has identifier ${modalContainer}`, () => {
|
it(`Has identifier ${modalContainer}`, () => {
|
|
@ -1,5 +1,5 @@
|
||||||
import { setup } from '../../support/setup.js';
|
import { setup } from '../../support/setup.js';
|
||||||
import filterTests from '../../support/filterTests';
|
import filterTests from '../../support/filterTests.js';
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
// TODO: Fire API call to enable federation and set domain, and stream username.
|
||||||
|
|
||||||
|
import fetchData from '../../support/fetchData.js';
|
||||||
|
|
||||||
|
describe('Fediverse tests', () => {
|
||||||
|
// Enable Fediverse features.
|
||||||
|
before(() => {
|
||||||
|
fetchData('http://localhost:8080/api/admin/config/serverurl', {
|
||||||
|
method: 'POST',
|
||||||
|
data: { value: 'https://testing.biz' },
|
||||||
|
});
|
||||||
|
fetchData('http://localhost:8080/api/admin/config/federation/enable', {
|
||||||
|
method: 'POST',
|
||||||
|
data: { value: true },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Can visit the page', () => {
|
||||||
|
cy.visit('http://localhost:8080/');
|
||||||
|
cy.reload(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Offline banner
|
||||||
|
it('Has correct offline banner values', () => {
|
||||||
|
cy.contains(
|
||||||
|
'This stream is offline. You can be notified the next time New Owncast Server goes live or follow streamer@testing.biz on the Fediverse.'
|
||||||
|
).should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Followers
|
||||||
|
const followersCollection = '#followers-collection';
|
||||||
|
it(`Has identifier: ${followersCollection}`, () => {
|
||||||
|
cy.contains('Followers').click();
|
||||||
|
cy.get(followersCollection).should('be.visible');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`Has identifier: #follow-button`, () => {
|
||||||
|
cy.get('#follow-button').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Can change to Followers tab', () => {
|
||||||
|
cy.contains('Followers').click();
|
||||||
|
});
|
||||||
|
});
|
|
@ -20,16 +20,10 @@ import fetchData from './fetchData.js';
|
||||||
// Alternatively you can use CommonJS syntax:
|
// Alternatively you can use CommonJS syntax:
|
||||||
// require('./commands')
|
// require('./commands')
|
||||||
|
|
||||||
// Put Owncast in a state where it's ready to be tested.
|
before(() => {
|
||||||
|
// Set server URL
|
||||||
// Set server URL
|
fetchData('http://localhost:8080/api/admin/config/serverurl', {
|
||||||
fetchData('http://localhost:8080/api/admin/config/serverurl', {
|
method: 'POST',
|
||||||
method: 'POST',
|
data: { value: 'https://testing.biz' },
|
||||||
data: { value: 'https://testing.biz' },
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// Enable Fediverse features.
|
|
||||||
fetchData('http://localhost:8080/api/admin/config/federation/enable', {
|
|
||||||
method: 'POST',
|
|
||||||
data: { value: true },
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue