2020-07-03 17:25:23 +00:00
|
|
|
/// <reference types="Cypress" />
|
|
|
|
/* globals cy, expect */
|
|
|
|
|
|
|
|
context('Create Channel Browser Testing', () => {
|
|
|
|
before(() => {
|
2020-07-08 13:41:05 +00:00
|
|
|
cy.clearLocalStorageSnapshot();
|
2020-07-03 17:25:23 +00:00
|
|
|
cy.clearLocalStorage({ domain: null });
|
|
|
|
cy.clearCookies({ domain: null });
|
|
|
|
});
|
2020-07-08 13:41:05 +00:00
|
|
|
beforeEach(() => cy.restoreLocalStorage());
|
|
|
|
afterEach(() => cy.saveLocalStorage());
|
2020-07-03 17:25:23 +00:00
|
|
|
it('should visit user login screen', () => cy.userLogin());
|
2020-07-16 13:50:16 +00:00
|
|
|
it('should login', () => cy.login());
|
|
|
|
describe('Channel Creation process #1', () => {
|
|
|
|
let channelName = 'Test Channel ',
|
2021-01-18 22:16:25 +00:00
|
|
|
description = 'Test Description ',
|
|
|
|
subtitle = 'Test Subtitle ';
|
2020-09-17 11:08:44 +00:00
|
|
|
it('should visit the channel creation screen', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.visit('/admin-circles-create');
|
2020-09-17 11:08:44 +00:00
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles-create');
|
2020-09-17 11:08:44 +00:00
|
|
|
});
|
|
|
|
});
|
2020-07-16 13:50:16 +00:00
|
|
|
it('should enter correct channel data', () => {
|
|
|
|
cy.randomNum().then(num => {
|
|
|
|
channelName += num;
|
|
|
|
description += num;
|
2021-01-18 22:16:25 +00:00
|
|
|
subtitle += num;
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.get('#admin-circles-create input[name="name"]').clear().type(channelName);
|
|
|
|
cy.get('#admin-circles-create input[name="name"]').should('have.value', channelName);
|
|
|
|
cy.get('#admin-circles-create input[name="subtitle"]').clear().type(subtitle);
|
|
|
|
cy.get('#admin-circles-create input[name="subtitle"]').should('have.value', subtitle);
|
|
|
|
cy.get('#admin-circles-create [name="description"] [contenteditable="true"]').clear().type(description);
|
|
|
|
cy.get('#admin-circles-create [name="description"] [contenteditable="true"]').should('have.value', description);
|
2020-07-16 13:50:16 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
it('should click on create channel button', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.get('#admin-circles-create input[type="submit"]').click();
|
2020-07-16 13:50:16 +00:00
|
|
|
});
|
|
|
|
it('should land on channels list screen', () => {
|
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles');
|
2020-07-16 13:50:16 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
it('should land newly created channel on channels list screen', () => {
|
|
|
|
cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist");
|
|
|
|
cy.fixture('admin.json').then(admin => {
|
|
|
|
cy.contains('solid-display-value[name="username"]', admin.username).should("exist");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
describe('Channel Creation process #2', () => {
|
|
|
|
let channelName = 'Test Channel ',
|
2021-01-18 22:16:25 +00:00
|
|
|
description = 'Test Description ',
|
|
|
|
subtitle = 'Test Subtitle ';
|
2020-09-17 11:08:44 +00:00
|
|
|
it('should visit the channel creation screen', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.visit('/admin-circles-create');
|
2020-09-17 11:08:44 +00:00
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles-create');
|
2020-09-17 11:08:44 +00:00
|
|
|
});
|
|
|
|
});
|
2020-07-16 13:50:16 +00:00
|
|
|
it('should enter correct channel data', () => {
|
|
|
|
cy.randomNum().then(num => {
|
|
|
|
channelName += num;
|
|
|
|
description += num;
|
2021-01-18 22:16:25 +00:00
|
|
|
subtitle += num;
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.get('#admin-circles-create input[name="name"]').clear().type(channelName);
|
|
|
|
cy.get('#admin-circles-create input[name="name"]').should('have.value', channelName);
|
|
|
|
cy.get('#admin-circles-create input[name="subtitle"]').clear().type(subtitle);
|
|
|
|
cy.get('#admin-circles-create input[name="subtitle"]').should('have.value', subtitle);
|
|
|
|
cy.get('#admin-circles-create [name="description"] [contenteditable="true"]').clear().type(description);
|
|
|
|
cy.get('#admin-circles-create [name="description"] [contenteditable="true"]').should('have.value', description);
|
2020-07-16 13:50:16 +00:00
|
|
|
});
|
2020-07-03 17:25:23 +00:00
|
|
|
});
|
|
|
|
it('should click on create channel button', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.get('#admin-circles-create input[type="submit"]').click();
|
2020-07-03 17:25:23 +00:00
|
|
|
});
|
2020-07-16 13:50:16 +00:00
|
|
|
it('should land on channels list screen', () => {
|
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles');
|
2020-07-16 13:50:16 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
it('should land newly created channel on channels list screen', () => {
|
|
|
|
cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist");
|
|
|
|
cy.fixture('admin.json').then(admin => {
|
|
|
|
cy.contains('solid-display-value[name="username"]', admin.username).should("exist");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
describe('Channel Creation process #3', () => {
|
|
|
|
let channelName = 'Test Channel ',
|
2021-01-18 22:16:25 +00:00
|
|
|
description = 'Test Description ',
|
|
|
|
subtitle = 'Test Subtitle ';
|
2020-09-17 11:08:44 +00:00
|
|
|
it('should visit the channel creation screen', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.visit('/admin-circles-create');
|
2020-09-17 11:08:44 +00:00
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles-create');
|
2020-09-17 11:08:44 +00:00
|
|
|
});
|
|
|
|
});
|
2020-07-03 17:25:23 +00:00
|
|
|
it('should enter correct channel data', () => {
|
2020-07-16 13:50:16 +00:00
|
|
|
cy.randomNum().then(num => {
|
|
|
|
channelName += num;
|
|
|
|
description += num;
|
2021-01-18 22:16:25 +00:00
|
|
|
subtitle += num;
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.get('#admin-circles-create input[name="name"]').clear().type(channelName);
|
|
|
|
cy.get('#admin-circles-create input[name="name"]').should('have.value', channelName);
|
|
|
|
cy.get('#admin-circles-create input[name="subtitle"]').clear().type(subtitle);
|
|
|
|
cy.get('#admin-circles-create input[name="subtitle"]').should('have.value', subtitle);
|
|
|
|
cy.get('#admin-circles-create [name="description"] [contenteditable="true"]').clear().type(description);
|
|
|
|
cy.get('#admin-circles-create [name="description"] [contenteditable="true"]').should('have.value', description);
|
2020-07-16 13:50:16 +00:00
|
|
|
});
|
2020-07-03 17:25:23 +00:00
|
|
|
});
|
|
|
|
it('should click on create channel button', () => {
|
2021-01-22 13:21:25 +00:00
|
|
|
cy.get('#admin-circles-create input[type="submit"]').click();
|
2020-07-03 17:25:23 +00:00
|
|
|
});
|
|
|
|
it('should land on channels list screen', () => {
|
|
|
|
cy.location().should((loc) => {
|
2021-01-22 13:21:25 +00:00
|
|
|
expect(loc.pathname).to.eq('/admin-circles');
|
2020-07-03 17:25:23 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
it('should land newly created channel on channels list screen', () => {
|
|
|
|
cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist");
|
|
|
|
cy.fixture('admin.json').then(admin => {
|
|
|
|
cy.contains('solid-display-value[name="username"]', admin.username).should("exist");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|