diff --git a/testing/specs/archive.browse.panel.spec.js b/testing/specs/archive.browse.panel.spec.js index 9dd74b7b..003848a9 100644 --- a/testing/specs/archive.browse.panel.spec.js +++ b/testing/specs/archive.browse.panel.spec.js @@ -12,7 +12,6 @@ const DeleteContentDialog = require('../page_objects/delete.content.dialog'); const ArchiveBrowsePanel = require('../page_objects/archive/archive.browse.panel'); const ArchiveItemStatisticsPanel = require('../page_objects/archive/archive.item.statistics.panel'); const ConfirmValueDialog = require('../page_objects/confirm.content.delete.dialog'); -const ArchiveRestoreDialog = require('../page_objects/archive/archive.restore.dialog'); const ArchiveDeleteDialog = require('../page_objects/archive/archive.delete.dialog'); const ArchiveContentWidgetItemView = require('../page_objects/archive/archive.widget.item.view'); @@ -45,7 +44,7 @@ describe('archive.browse.panel.spec: tests for archive browse panel and selectio await contentBrowsePanel.rightClickOnItemByDisplayName(FOLDER2.displayName); await contentBrowsePanel.clickOnMenuItem(appConst.GRID_CONTEXT_MENU.ARCHIVE); await deleteContentDialog.waitForDialogOpened(); - await studioUtils.saveScreenshot("folder_to_archive2"); + await studioUtils.saveScreenshot('folder_to_archive2'); await deleteContentDialog.clickOnArchiveButton(); await confirmValueDialog.waitForDialogOpened(); await confirmValueDialog.typeNumberOrName(2); @@ -55,7 +54,7 @@ describe('archive.browse.panel.spec: tests for archive browse panel and selectio await studioUtils.openArchivePanel(); // 3. Click on the checkbox: await archiveBrowsePanel.clickCheckboxAndSelectRowByDisplayName(FOLDER1.displayName); - await studioUtils.saveScreenshot("archive_selection_controller1"); + await studioUtils.saveScreenshot('archive_selection_controller1'); await archiveBrowsePanel.clickOnSelectionToggler(); // 4. Verify that just one item are displayed in the filtered grid: let displayNames = await archiveBrowsePanel.getDisplayNamesInGrid(); @@ -97,8 +96,8 @@ describe('archive.browse.panel.spec: tests for archive browse panel and selectio let path = await archiveItemStatisticsPanel.getPath(); assert.equal(path, `/${FOLDER1.displayName}`, "Expected path should be displayed in Item Statistics panel"); let status = await archiveItemStatisticsPanel.getStatus(); - assert.isTrue(status.includes("Archived"), "Archived status should be displayed in Item Statistics panel"); - assert.isTrue(status.includes("by Super User"), "'by Super User' should be displayed in Item Statistics panel"); + assert.isTrue(status.includes('Archived'), "Archived status should be displayed in Item Statistics panel"); + assert.isTrue(status.includes('by Super User'), "'by Super User' should be displayed in Item Statistics panel"); // 3. Verify that workflow icon is not displayed: await contentWidgetItemView.waitForWorkflowStateNotDisplayed(); // 4. Verify the name in the content widget: @@ -152,7 +151,9 @@ describe('archive.browse.panel.spec: tests for archive browse panel and selectio await archiveBrowsePanel.waitForSelectionTogglerNotVisible(); }); - beforeEach(() => studioUtils.navigateToContentStudioApp()); + beforeEach(async () => { + return await studioUtils.navigateToContentStudioCloseProjectSelectionDialog(); + }); afterEach(() => studioUtils.doCloseAllWindowTabsAndSwitchToHome()); before(() => { return console.log('specification is starting: ' + this.title); diff --git a/testing/specs/archive.content.spec.js b/testing/specs/archive.content.spec.js index 3458a322..e6e49efd 100644 --- a/testing/specs/archive.content.spec.js +++ b/testing/specs/archive.content.spec.js @@ -19,8 +19,8 @@ describe('archive.content.spec: tests for archiving content', function () { let FOLDER1; let FOLDER2; - const ARCHIVE_DELETE_TITLE = "Delete from Archive"; - const ARCHIVE_RESTORE_TITLE = "Restore from Archive"; + const ARCHIVE_DELETE_TITLE = 'Delete from Archive'; + const ARCHIVE_RESTORE_TITLE = 'Restore from Archive'; it(`Precondition: new folder should be added`, async () => { @@ -65,20 +65,20 @@ describe('archive.content.spec: tests for archiving content', function () { await studioUtils.findContentAndClickCheckBox(FOLDER2.displayName); // 2. Click on 'Archive...' menu item in the Context menu await contentBrowsePanel.rightClickOnItemByDisplayName(FOLDER2.displayName); - await studioUtils.saveScreenshot("context-menu-archive"); + await studioUtils.saveScreenshot('context-menu-archive'); await contentBrowsePanel.clickOnMenuItem(appConst.GRID_CONTEXT_MENU.ARCHIVE); await deleteContentDialog.waitForDialogOpened(); - await studioUtils.saveScreenshot("folder_to_archive2"); + await studioUtils.saveScreenshot('folder_to_archive2'); // 3. Click on 'Archive' button in the modal dialog: await deleteContentDialog.clickOnArchiveButton(); // 4. Verify that the content is not displayed in Content Browse Panel: await contentBrowsePanel.waitForContentNotDisplayed(FOLDER2.displayName); let message = await contentBrowsePanel.waitForNotificationMessage(); let expectedMessage = appConst.itemIsArchived(FOLDER2.displayName); - assert.equal(message, expectedMessage, "Expected notification message should appear"); + assert.equal(message, expectedMessage, 'Expected notification message should appear'); // 5. Navigate to 'Archive Browse Panel' and check the archived content: await studioUtils.openArchivePanel(); - await studioUtils.saveScreenshot("folder_in_archive2"); + await studioUtils.saveScreenshot('folder_in_archive2'); await archiveBrowsePanel.waitForContentDisplayed(FOLDER2.displayName); }); @@ -91,23 +91,23 @@ describe('archive.content.spec: tests for archiving content', function () { await studioUtils.openArchivePanel(); // 2. Do 'rightClick' on the folder and Click on 'Restore...' menu item in the Context menu await archiveBrowsePanel.rightClickOnItemByDisplayName(FOLDER2.displayName); - await studioUtils.saveScreenshot("context-menu-restore"); + await studioUtils.saveScreenshot('context-menu-restore'); await archiveBrowsePanel.clickOnMenuItem(appConst.GRID_CONTEXT_MENU.RESTORE); await archiveRestoreDialog.waitForOpened(); let actualTitle = await archiveRestoreDialog.getTitleInHeader(); assert.equal(actualTitle, ARCHIVE_RESTORE_TITLE, "Expected title should be displayed in the dialog"); - await studioUtils.saveScreenshot("folder_to_restore1"); + await studioUtils.saveScreenshot('folder_to_restore1'); // 3. Click on 'Restore' button in the modal dialog: await archiveRestoreDialog.clickOnRestoreButton(); // 4. Verify that the content is not displayed in Archive Browse Panel: let message = await contentBrowsePanel.waitForNotificationMessage(); - await studioUtils.saveScreenshot("folder_to_restore_notification"); + await studioUtils.saveScreenshot('folder_to_restore_notification'); let expectedMessage = appConst.itemIsRestored(FOLDER2.displayName); assert.equal(message, expectedMessage, "Expected notification message should appear"); await archiveBrowsePanel.waitForContentNotDisplayed(FOLDER2.displayName); // 5. Verify the content is present in Content Browse Panel await studioUtils.switchToContentMode(); - await studioUtils.saveScreenshot("folder_is_restored"); + await studioUtils.saveScreenshot('folder_is_restored'); await studioUtils.findContentAndClickCheckBox(FOLDER2.displayName); }); @@ -120,14 +120,14 @@ describe('archive.content.spec: tests for archiving content', function () { await archiveBrowsePanel.clickCheckboxAndSelectRowByDisplayName(FOLDER1.displayName); // 2. Do 'rightClick' on the folder and Click on 'Restore...' menu item in the Context menu await archiveBrowsePanel.rightClickOnItemByDisplayName(FOLDER1.displayName); - await studioUtils.saveScreenshot("context-menu-delete"); + await studioUtils.saveScreenshot('context-menu-delete'); await archiveBrowsePanel.clickOnMenuItem(appConst.GRID_CONTEXT_MENU.DELETE); await archiveDeleteDialog.waitForOpened(); - await studioUtils.saveScreenshot("delete_archive_dialog"); + await studioUtils.saveScreenshot('delete_archive_dialog'); // 3. 'Delete' button and expected title should be displayed in the dialog: await archiveDeleteDialog.waitForDeleteButtonDisplayed(); let title = await archiveDeleteDialog.getTitleInHeader(); - assert.equal(title, ARCHIVE_DELETE_TITLE, "Expected title should be present in the dialog"); + assert.equal(title, ARCHIVE_DELETE_TITLE, 'Expected title should be present in the dialog'); let actualItems = await archiveDeleteDialog.getItemsToDeleteDisplayName(); assert.equal(actualItems[0], FOLDER1.displayName, "Expected item to delete should be displayed"); }); @@ -157,7 +157,9 @@ describe('archive.content.spec: tests for archiving content', function () { assert.equal(message, expectedMessage, 'Expected notification message should appear'); }); - beforeEach(() => studioUtils.navigateToContentStudioApp()); + beforeEach(async () => { + return await studioUtils.navigateToContentStudioCloseProjectSelectionDialog(); + }); afterEach(() => studioUtils.doCloseAllWindowTabsAndSwitchToHome()); before(() => { return console.log('specification is starting: ' + this.title); diff --git a/testing/specs/archive.muiltiselect.restore.spec.js b/testing/specs/archive.muiltiselect.restore.spec.js index 28e007eb..d90e9942 100644 --- a/testing/specs/archive.muiltiselect.restore.spec.js +++ b/testing/specs/archive.muiltiselect.restore.spec.js @@ -61,54 +61,52 @@ describe('archive.muiltiselect.restore.spec: tests for restore several items', f await archiveBrowsePanel.waitForContentDisplayed(FOLDER2.displayName); }); - //Verifies issue https://github.com/enonic/app-contentstudio-plus/issues/311 - //Confirm restore dialog - the modal dialog should be closed after click on Cancel button or Esc #311 + // Verifies issue https://github.com/enonic/app-contentstudio-plus/issues/311 + // Confirm restore dialog - the modal dialog should be closed after click on Cancel button or Esc #311 it(`GIVEN 2 folders are selected in Archive AND Confirm Value dialog has been opened WHEN 'Cancel' button has been pressed THEN modal dialog should be closed`, async () => { - let contentBrowsePanel = new ContentBrowsePanel(); let archiveRestoreDialog = new ArchiveRestoreDialog(); let archiveBrowsePanel = new ArchiveBrowsePanel(); let confirmValueDialog = new ConfirmValueDialog(); - //1. Navigate to 'Archive Browse Panel': + // 1. Navigate to 'Archive Browse Panel': await studioUtils.openArchivePanel(); - //2. Select two folders + // 2. Select two folders await archiveBrowsePanel.clickOnCheckboxAndSelectRowByName(FOLDER1.displayName); await archiveBrowsePanel.clickOnCheckboxAndSelectRowByName(FOLDER2.displayName); - //3. Click on Restore... button in the browse toolbar + // 3. Click on Restore... button in the browse toolbar await archiveBrowsePanel.clickOnRestoreButton(); await archiveRestoreDialog.waitForOpened(); - //4. Click on Restore in the modal dialog: + // 4. Click on Restore in the modal dialog: await archiveRestoreDialog.clickOnRestoreButton(); await confirmValueDialog.waitForDialogOpened(); - //5. Click on Cancel button in the modal dialog: + // 5. Click on Cancel button in the modal dialog: await confirmValueDialog.clickOnCancelButton(); - //6. Verify that both dialogs are closed: + // 6. Verify that both dialogs are closed: await confirmValueDialog.waitForDialogClosed(); await archiveRestoreDialog.waitForClosed(); }); - //Verifies issue https://github.com/enonic/app-contentstudio-plus/issues/311 - //Confirm restore dialog - the modal dialog should be closed after click on Cancel button or Esc #311 + // Verifies issue https://github.com/enonic/app-contentstudio-plus/issues/311 + // Confirm restore dialog - the modal dialog should be closed after click on Cancel button or Esc #311 it(`GIVEN 2 folders are selected in Archive AND Confirm Value dialog has been opened WHEN 'Esc' key has been pressed THEN modal dialog should be closed`, async () => { - let contentBrowsePanel = new ContentBrowsePanel(); let archiveRestoreDialog = new ArchiveRestoreDialog(); let archiveBrowsePanel = new ArchiveBrowsePanel(); let confirmValueDialog = new ConfirmValueDialog(); - //1. Navigate to 'Archive Browse Panel': + // 1. Navigate to 'Archive Browse Panel': await studioUtils.openArchivePanel(); - //2. Select two folders + // 2. Select two folders await archiveBrowsePanel.clickOnCheckboxAndSelectRowByName(FOLDER1.displayName); await archiveBrowsePanel.clickOnCheckboxAndSelectRowByName(FOLDER2.displayName); - //3. Click on Restore... button in the browse toolbar + // 3. Click on Restore... button in the browse toolbar await archiveBrowsePanel.clickOnRestoreButton(); await archiveRestoreDialog.waitForOpened(); - //4. Click on Restore in the modal dialog: + // 4. Click on Restore in the modal dialog: await archiveRestoreDialog.clickOnRestoreButton(); await confirmValueDialog.waitForDialogOpened(); - //5. Press the ESC key + // 5. Press the ESC key await confirmValueDialog.pressEscKey(); - //6. Verify that both dialogs are closed: + // 6. Verify that both dialogs are closed: await confirmValueDialog.waitForDialogClosed(); await archiveRestoreDialog.waitForClosed(); }); @@ -175,8 +173,9 @@ describe('archive.muiltiselect.restore.spec: tests for restore several items', f //await archiveBrowsePanel.waitForSelectionTogglerNotVisible(); }); - - beforeEach(() => studioUtils.navigateToContentStudioApp()); + beforeEach(async () => { + return await studioUtils.navigateToContentStudioCloseProjectSelectionDialog(); + }); afterEach(() => studioUtils.doCloseAllWindowTabsAndSwitchToHome()); before(() => { return console.log('specification is starting: ' + this.title); diff --git a/testing/specs/archive.restore.content.dependant.items.js b/testing/specs/archive.restore.content.dependant.items.js index 503e2caa..1a02e44f 100644 --- a/testing/specs/archive.restore.content.dependant.items.js +++ b/testing/specs/archive.restore.content.dependant.items.js @@ -13,7 +13,7 @@ const ConfirmValueDialog = require('../page_objects/confirm.content.delete.dialo const ArchiveRestoreDialog = require('../page_objects/archive/archive.restore.dialog'); const ArchiveDeleteDialog = require('../page_objects/archive/archive.delete.dialog'); -describe('archive.restore.content.dependant.spec: tests for archive/restore folder with children', function () { +describe('archive.restore.content.dependant.items.spec: tests for archive/restore folder with children', function () { this.timeout(appConst.SUITE_TIMEOUT); webDriverHelper.setupBrowser(); @@ -84,7 +84,9 @@ describe('archive.restore.content.dependant.spec: tests for archive/restore fold await studioUtils.findContentAndClickCheckBox(FOLDER_DISPLAY_NAME); }); - beforeEach(() => studioUtils.navigateToContentStudioApp()); + beforeEach(async () => { + return await studioUtils.navigateToContentStudioCloseProjectSelectionDialog(); + }); afterEach(() => studioUtils.doCloseAllWindowTabsAndSwitchToHome()); before(() => { return console.log('specification is starting: ' + this.title);