| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- context('Access to page', () => {
- const ssPrefix = 'access-to-page-';
- beforeEach(() => {
- // login
- cy.fixture("user-admin.json").then(user => {
- cy.login(user.username, user.password);
- });
- // collapse sidebar
- cy.collapseSidebar(true);
- });
- it('/Sandbox is successfully loaded', () => {
- cy.visit('/Sandbox', { });
- cy.screenshot(`${ssPrefix}-sandbox`);
- });
- it('/Sandbox with anchor hash is successfully loaded', () => {
- cy.visit('/Sandbox#Headers');
- // hide fab
- cy.getByTestid('grw-fab-container').invoke('attr', 'style', 'display: none');
- cy.screenshot(`${ssPrefix}-sandbox-headers`);
- });
- it('/Sandbox/Math is successfully loaded', () => {
- cy.visit('/Sandbox/Math');
- cy.screenshot(`${ssPrefix}-sandbox-math`);
- });
- it('/Sandbox with edit is successfully loaded', () => {
- cy.visit('/Sandbox#edit');
- cy.screenshot(`${ssPrefix}-sandbox-edit-page`);
- })
- it('/user/admin is successfully loaded', () => {
- cy.visit('/user/admin', { });
- cy.screenshot(`${ssPrefix}-user-admin`);
- });
- });
- context('Access to /me page', () => {
- const ssPrefix = 'access-to-me-page-';
- beforeEach(() => {
- // login
- cy.fixture("user-admin.json").then(user => {
- cy.login(user.username, user.password);
- });
- // collapse sidebar
- cy.collapseSidebar(true);
- });
- it('/me is successfully loaded', () => {
- cy.visit('/me', { });
- cy.screenshot(`${ssPrefix}-me`);
- });
- it('Draft page is successfully shown', () => {
- cy.visit('/me/drafts');
- cy.screenshot(`${ssPrefix}-draft-page`);
- });
- });
- context('Access to special pages', () => {
- const ssPrefix = 'access-to-special-pages-';
- beforeEach(() => {
- // login
- cy.fixture("user-admin.json").then(user => {
- cy.login(user.username, user.password);
- });
- // collapse sidebar
- cy.collapseSidebar(true);
- });
- it('/trash is successfully loaded', () => {
- cy.visit('/trash', { });
- cy.getByTestid('trash-page-list').should('be.visible');
- cy.screenshot(`${ssPrefix}-trash`);
- });
- it('/tags is successfully loaded', () => {
- cy.visit('/tags');
- // open sidebar
- cy.collapseSidebar(false);
- // select tags
- cy.getByTestid('grw-sidebar-nav-primary-tags').click();
- cy.getByTestid('grw-sidebar-content-tags').should('be.visible');
- cy.getByTestid('grw-tags-list').should('be.visible');
- cy.getByTestid('grw-tags-list').contains('You have no tag, You can set tags on pages');
- cy.getByTestid('tags-page').should('be.visible');
- cy.screenshot(`${ssPrefix}-tags`);
- });
- });
- context('Access to Template Editing Mode', () => {
- const ssPrefix = 'access-to-modal-';
- beforeEach(() => {
- // login
- cy.fixture("user-admin.json").then(user => {
- cy.login(user.username, user.password);
- });
- // collapse sidebar
- cy.collapseSidebar(true);
- });
- it('Access to Template Editor mode for only child pages successfully', () => {
- cy.visit('/Sandbox/Bootstrap4', { });
- cy.get('#grw-subnav-container').within(() => {
- cy.getByTestid('open-page-item-control-btn').click();
- cy.getByTestid('open-page-template-modal-btn').click();
- });
- cy.getByTestid('page-template-modal').should('be.visible')
- cy.screenshot(`${ssPrefix}-open-page-template-bootstrap4`);
- cy.getByTestid('template-button-children').click();
- cy.url().should('include', '/_template#edit');
- cy.screenshot();
- });
- it('Access to Template Editor mode including decendants successfully', () => {
- cy.visit('/Sandbox/Bootstrap4', { });
- cy.get('#grw-subnav-container').within(() => {
- cy.getByTestid('open-page-item-control-btn').click();
- cy.getByTestid('open-page-template-modal-btn').click();
- });
- cy.getByTestid('page-template-modal').should('be.visible')
- // cy.screenshot(`${ssPrefix}-open-page-template-bootstrap4`);
- cy.getByTestid('template-button-decendants').click();
- cy.url().should('include', '/__template#edit');
- cy.screenshot();
- });
- });
|