|
@@ -1,28 +1,17 @@
|
|
|
-context('Open PageCreateModal', () => {
|
|
|
|
|
|
|
+context('Modal for page operation', () => {
|
|
|
|
|
|
|
|
- const ssPrefix = 'open-page-create-modal-';
|
|
|
|
|
|
|
+ const ssPrefix = 'modal-for-page-operation-';
|
|
|
|
|
|
|
|
- let connectSid: string | undefined;
|
|
|
|
|
-
|
|
|
|
|
- before(() => {
|
|
|
|
|
|
|
+ beforeEach(() => {
|
|
|
// login
|
|
// login
|
|
|
cy.fixture("user-admin.json").then(user => {
|
|
cy.fixture("user-admin.json").then(user => {
|
|
|
cy.login(user.username, user.password);
|
|
cy.login(user.username, user.password);
|
|
|
});
|
|
});
|
|
|
- cy.getCookie('connect.sid').then(cookie => {
|
|
|
|
|
- connectSid = cookie?.value;
|
|
|
|
|
- });
|
|
|
|
|
- // collapse sidebar
|
|
|
|
|
- cy.collapseSidebar(true);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- beforeEach(() => {
|
|
|
|
|
- if (connectSid != null) {
|
|
|
|
|
- cy.setCookie('connect.sid', connectSid);
|
|
|
|
|
- }
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it("PageCreateModal is shown successfully", () => {
|
|
it("PageCreateModal is shown successfully", () => {
|
|
|
|
|
+ cy.visit('/me');
|
|
|
|
|
+
|
|
|
cy.getByTestid('newPageBtn').click();
|
|
cy.getByTestid('newPageBtn').click();
|
|
|
|
|
|
|
|
cy.getByTestid('page-create-modal').should('be.visible').screenshot(`${ssPrefix}-open`);
|
|
cy.getByTestid('page-create-modal').should('be.visible').screenshot(`${ssPrefix}-open`);
|
|
@@ -34,4 +23,37 @@ context('Open PageCreateModal', () => {
|
|
|
cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
|
|
cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ it('PageDeleteModal is shown successfully', () => {
|
|
|
|
|
+ cy.visit('/Sandbox/Bootstrap4');
|
|
|
|
|
+
|
|
|
|
|
+ cy.get('#grw-subnav-container').within(() => {
|
|
|
|
|
+ cy.getByTestid('open-page-item-control-btn').click();
|
|
|
|
|
+ cy.getByTestid('open-page-delete-modal-btn').click();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ cy.getByTestid('page-delete-modal').should('be.visible').screenshot(`${ssPrefix}-delete-bootstrap4`);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ it('PageDuplicateModal is shown successfully', () => {
|
|
|
|
|
+ cy.visit('/Sandbox/Bootstrap4', { });
|
|
|
|
|
+
|
|
|
|
|
+ cy.get('#grw-subnav-container').within(() => {
|
|
|
|
|
+ cy.getByTestid('open-page-item-control-btn').click();
|
|
|
|
|
+ cy.getByTestid('open-page-duplicate-modal-btn').click();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ cy.getByTestid('page-duplicate-modal').should('be.visible').screenshot(`${ssPrefix}-duplicate-bootstrap4`);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ it('PageMoveRenameModal is shown successfully', () => {
|
|
|
|
|
+ cy.visit('/Sandbox/Bootstrap4', { });
|
|
|
|
|
+
|
|
|
|
|
+ cy.get('#grw-subnav-container').within(() => {
|
|
|
|
|
+ cy.getByTestid('open-page-item-control-btn').click();
|
|
|
|
|
+ cy.getByTestid('open-page-move-rename-modal-btn').click();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ cy.getByTestid('page-rename-modal').should('be.visible').screenshot(`${ssPrefix}-rename-bootstrap4`);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
});
|
|
});
|