From 5da4affae32c85a3595551d308f1f81c4191a390 Mon Sep 17 00:00:00 2001 From: stanislavchalapko Date: Thu, 19 Sep 2024 18:25:14 +0300 Subject: [PATCH] update version --- .github/workflows/playwright_pre_webkit.yml | 2 +- package-lock.json | 82 +- package.json | 2 +- tests/view-mode.spec.js | 1492 +++++++++---------- 4 files changed, 774 insertions(+), 804 deletions(-) diff --git a/.github/workflows/playwright_pre_webkit.yml b/.github/workflows/playwright_pre_webkit.yml index 1f7054a5..c10e6fa8 100644 --- a/.github/workflows/playwright_pre_webkit.yml +++ b/.github/workflows/playwright_pre_webkit.yml @@ -37,7 +37,7 @@ jobs: CLIENT_ID: ${{ secrets.CLIENT_ID }} CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} GMAIL_NAME: ${{ secrets.GMAIL_NAME }} - run: npx playwright test --project=webkit -gv 'PERF' + run: npx playwright test --project=webkit -gv 'PERF' ./tests/view-mode.spec.js - name: Upload Playwright Report uses: actions/upload-artifact@v3 diff --git a/package-lock.json b/package-lock.json index d59705de..0cfbb1fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "ts-node": "^10.9.2" }, "devDependencies": { - "@playwright/test": "1.38.1", + "@playwright/test": "1.31.2", "dotenv": "^16.3.1" } }, @@ -56,20 +56,23 @@ } }, "node_modules/@playwright/test": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", - "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "version": "1.31.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.31.2.tgz", + "integrity": "sha512-BYVutxDI4JeZKV1+ups6dt5WiqKhjBtIYowyZIJ3kBDmJgsuPKsqqKNIMFbUePLSCmp2cZu+BDL427RcNKTRYw==", "deprecated": "Please update to the latest version of Playwright to test up-to-date browsers.", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright": "1.38.1" + "@types/node": "*", + "playwright-core": "1.31.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=14" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, "node_modules/@tsconfig/node10": { @@ -96,7 +99,6 @@ "version": "20.11.30", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", - "peer": true, "dependencies": { "undici-types": "~5.26.4" } @@ -526,7 +528,6 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -865,36 +866,16 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/playwright": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", - "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright-core": "1.38.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, "node_modules/playwright-core": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", - "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "version": "1.31.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.2.tgz", + "integrity": "sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ==", "dev": true, - "license": "Apache-2.0", "bin": { - "playwright-core": "cli.js" + "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=14" } }, "node_modules/playwright-qase-reporter": { @@ -1115,8 +1096,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "peer": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/url-template": { "version": "2.0.8", @@ -1192,12 +1172,14 @@ } }, "@playwright/test": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", - "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "version": "1.31.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.31.2.tgz", + "integrity": "sha512-BYVutxDI4JeZKV1+ups6dt5WiqKhjBtIYowyZIJ3kBDmJgsuPKsqqKNIMFbUePLSCmp2cZu+BDL427RcNKTRYw==", "dev": true, "requires": { - "playwright": "1.38.1" + "@types/node": "*", + "fsevents": "2.3.2", + "playwright-core": "1.31.2" } }, "@tsconfig/node10": { @@ -1224,7 +1206,6 @@ "version": "20.11.30", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", - "peer": true, "requires": { "undici-types": "~5.26.4" } @@ -1745,20 +1726,10 @@ "parse5": "^7.0.0" } }, - "playwright": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", - "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", - "dev": true, - "requires": { - "fsevents": "2.3.2", - "playwright-core": "1.38.1" - } - }, "playwright-core": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", - "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "version": "1.31.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.2.tgz", + "integrity": "sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ==", "dev": true }, "playwright-qase-reporter": { @@ -1901,8 +1872,7 @@ "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "peer": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "url-template": { "version": "2.0.8", diff --git a/package.json b/package.json index 3a6029e5..663d94e8 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/penpot/penpotqa#readme", "devDependencies": { - "@playwright/test": "1.38.1", + "@playwright/test": "1.31.2", "dotenv": "^16.3.1" }, "dependencies": { diff --git a/tests/view-mode.spec.js b/tests/view-mode.spec.js index 0a0e0a3f..36cbb207 100644 --- a/tests/view-mode.spec.js +++ b/tests/view-mode.spec.js @@ -55,453 +55,453 @@ mainTest.describe(() => { await mainPage.backToDashboardFromFileEditor(); }); - mainTest(qase([685], 'CO-364 Click view mode (From right top click) - no boards created'), async ({browserName}) => { - const newPage = await viewModePage.clickViewModeButton(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'no-board-view-mode-page-image.png', - ); - }); - - mainTest(qase([688], 'CO-367 Click view mode (From shortcut G+V) - board is created'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-page-image.png', - ); - }); - - mainTest(qase([690], 'CO-369 Full screen on/off'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickFullScreenButton(); - await expect(viewModePage.fullScreenSection).toHaveScreenshot( - 'view-mode-full-screen-image.png', - ); - await viewModePage.clickOnESC(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-page-image.png', - ); - }); - - mainTest(qase([698], 'CO-377 Click arrows to navigate to other boards'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultBoardByCoordinates(500, 500, true); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'first-board-view-mode-page-image.png', - ); - await viewModePage.clickNextButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'second-board-view-mode-page-image.png', - ); - await viewModePage.clickPrevButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'first-board-view-mode-page-image.png', - ); - await viewModePage.clickNextButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'second-board-view-mode-page-image.png', - ); - await viewModePage.clickPrevButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'first-board-view-mode-page-image.png', - ); - }); - - mainTest(qase([700], 'CO-379 Click Back icon to reset view'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultBoardByCoordinates(500, 500, true); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultBoardByCoordinates(100, 100, true); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'first-board-view-mode-page-image.png', - ); - await viewModePage.clickNextButton(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'second-board-view-mode-page-image.png', - ); - await viewModePage.clickNextButton(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'third-board-view-mode-page-image.png', - ); - await viewModePage.clickResetButton(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'first-board-view-mode-page-image.png', - ); - }); - - mainTest(qase([699], 'CO-378 Click board dropdown to navigate to other boards'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultBoardByCoordinates(500, 500, true); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickSelectBoardDropdown(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'board-dropdown-view-mode-page-image.png', - ); - await viewModePage.selectSecondBoard(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'second-board-selected-view-mode-page-image.png', - ); - await viewModePage.selectFirstBoard(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'first-board-selected-view-mode-page-image.png', - ); - }); - - mainTest(qase([689], 'CO-368 Interactions dropdown'), async ({ page }) => { - const userAgent = await page.evaluate(() => navigator.userAgent); - const playwrightVersion = require('@playwright/test/package.json').version; - - console.log('Playwright version:', playwrightVersion); - console.log('User-Agent:', userAgent); - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.createDefaultBoardByCoordinates(500, 500, true); - await mainPage.waitForChangeIsSaved(); - await prototypePanelPage.clickPrototypeTab(); - await prototypePanelPage.dragAndDropPrototypeArrowConnector(300, 300); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickInteractionsDropdown(); - await expect(viewModePage.interactionsDropdownOptions).toHaveScreenshot( - 'show-on-click-interactions-options-default-image.png', - ); - await newPage.waitForTimeout(2000); - await viewModePage.selectShowInteractionsOptions(); - await viewModePage.clickOnBoardCounter(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'show-interactions-board-view-mode-page-image.png', - ); - await viewModePage.clickInteractionsDropdown(); - await expect(viewModePage.interactionsDropdownOptions).toHaveScreenshot( - 'interactions-show-options-image.png', - ); - await viewModePage.selectShowOnClickInteractionsOptions(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'show-on-click-interactions-board-view-mode-page-image.png', - ); - await viewModePage.clickOnBoardCounter(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'show-on-click-interactions-board-view-mode-page-image2.png', - ); - }); - - mainTest(qase([691], 'CO-370 Change scale'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.openScaleDropdown(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.scaleDropdownOptions).toHaveScreenshot( - 'scale-dropdown-view-mode-page-image.png', - ); - await viewModePage.clickDownscaleButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'downscale-board-view-mode-page-image.png', - ); - await viewModePage.clickResetScaleButton(); - await viewModePage.clickUpscaleButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'upscale-board-view-mode-page-image.png', - ); - await viewModePage.selectFitScaleOptions(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'fit-scale-board-view-mode-page-image.png', - ); - await viewModePage.selectFillScaleOptions(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'fill-scale-board-view-mode-page-image.png', - ); - await viewModePage.selectFullScreenScaleOptions(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.fullScreenSection).toHaveScreenshot( - 'full-screen-scale-board-view-mode-page-image.png', - ); - await viewModePage.clickResetScaleButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.fullScreenSection).toHaveScreenshot( - 'full-screen-default-scale-board-view-mode-page-image.png', - ); - }); - - mainTest(qase([713], 'CO-392 Zoom by pressing + and - keys'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickOnAdd(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-page-add-button-image.png', - ); - await viewModePage.clickOnSubtract(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-page-subtract-button-image.png', - ); - }); - - mainTest(qase([708], 'CO-387 Page dropdown'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - await mainPage.clickAddPageButton(); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.openPageDropdown(); - await expect(viewModePage.pageDropdownOptions).toHaveScreenshot( - 'page-list-image.png', - ); - await viewModePage.selectPageByName('Page 2'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-2page-image.png', - ); - await viewModePage.openPageDropdown(); - await expect(viewModePage.pageDropdownOptions).toHaveScreenshot( - 'page-list-image2.png', - ); - await viewModePage.selectPageByName('Page 1'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-1page-image.png', - ); - }); - - mainTest(qase([701], 'CO-380 Create comment'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(); - - const comment = 'Test Comment'; - const commentsPanelPage = new CommentsPanelPage(newPage); - await commentsPanelPage.enterCommentText('Test Comment'); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp(comment); - await expect(newPage).toHaveScreenshot('comment-opened-pop-up.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - await viewModePage.clickOnViewport(); - await commentsPanelPage.isCommentThreadIconDisplayed(); - await expect(newPage).toHaveScreenshot('comment-closed-pop-up.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - }); - - mainTest(qase([709], 'CO-388 Reply comment'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(); - - const replyComment = - 'Lorem Ipsum is simply dummy text of the printing and typesetting industry'; - const commentsPanelPage = new CommentsPanelPage(newPage); - await commentsPanelPage.enterCommentText('Test Comment'); - await commentsPanelPage.clickPostCommentButton(); - - await commentsPanelPage.enterReplyText(replyComment); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentReplyDisplayedInPopUp(replyComment); - await expect(newPage).toHaveScreenshot('comment-reply.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - }); - - mainTest(qase([710], 'CO-389 Edit comment'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(); - - const editedComment = 'Edited Test Comment'; - const commentsPanelPage = new CommentsPanelPage(newPage); - await commentsPanelPage.enterCommentText('Test Comment'); - await commentsPanelPage.clickPostCommentButton(); - - await commentsPanelPage.clickCommentOptionsButton(); - await commentsPanelPage.clickEditCommentOption(); - await commentsPanelPage.enterCommentText(editedComment, true); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp(editedComment); - await commentsPanelPage.reloadPage(); - await commentsPanelPage.clickCommentThreadIcon(); - await commentsPanelPage.isCommentDisplayedInPopUp(editedComment); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(newPage).toHaveScreenshot('comment-edited.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - }); - - mainTest(qase([711], 'CO-390 Delete thread'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(); - - const commentsPanelPage = new CommentsPanelPage(newPage); - await commentsPanelPage.enterCommentText('Test Comment'); - await commentsPanelPage.clickPostCommentButton(); - - await commentsPanelPage.clickCommentOptionsButton(); - await commentsPanelPage.clickDeleteCommentOption(); - await commentsPanelPage.clickDeleteThreadButton(); - await commentsPanelPage.isCommentThreadIconNotDisplayed(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(newPage).toHaveScreenshot('comment-removed.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - }); - - mainTest(qase([703], 'CO-382 Comments dropdown (Hide resolved comments)'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - const commentsPanelPage = new CommentsPanelPage(newPage); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(); - await commentsPanelPage.enterCommentText('Test Comment'); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp('Test Comment'); - await commentsPanelPage.clickResolveCommentCheckbox(); - await commentsPanelPage.clickResolvedCommentThreadIcon(); - await viewModePage.addComment(true); - await commentsPanelPage.enterCommentText('Test Comment 2'); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp('Test Comment 2'); - await viewModePage.clickCommentsButton(); - - await viewModePage.openCommentsDropdown(); - await viewModePage.selectHideResolvedCommentsOption(); - await commentsPanelPage.isCommentResolvedThreadIconNotDisplayed(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(newPage).toHaveScreenshot('resolved-comments-hidden.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - await viewModePage.openCommentsDropdown(); - await viewModePage.selectHideResolvedCommentsOption(); - await commentsPanelPage.isCommentResolvedThreadIconDisplayed(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(newPage).toHaveScreenshot('resolved-comments-show.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - }); - - mainTest(qase([704], 'CO-383 Comments dropdown (Show comments list)'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - const commentsPanelPage = new CommentsPanelPage(newPage); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(); - await commentsPanelPage.enterCommentText('Test Comment'); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp('Test Comment'); - await viewModePage.clickOnViewport(); - - await viewModePage.openCommentsDropdown(); - await viewModePage.selectShowCommentsListOption(); - await viewModePage.isCommentInListVisible(true); - await expect(viewModePage.commentsRightPanel).toHaveScreenshot('comments-list.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - await viewModePage.openCommentsDropdown(); - await viewModePage.selectShowCommentsListOption(); - await viewModePage.isCommentInListVisible(false); - await expect(newPage).toHaveScreenshot('comments-list-hidden.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - }); - - mainTest(qase([706], 'CO-385 Switch to Inspect view'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.openInspectTab(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-inspect-page-image.png'); - await viewModePage.openInteractionsTab(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-interactions-page-image.png'); - }); - - mainTest(qase([715], 'CO-394 Inspect functionality - Board elements dropdown in the top left'), async ({browserName}) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await designPanelPage.changeHeightAndWidthForLayer('200', '200'); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultRectangleByCoordinates(320, 320); - await layersPanelPage.dragAndDropComponentToBoard('Rectangle'); - await mainPage.waitForChangeIsSaved(); - - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - layersPanelPage = new LayersPanelPage(newPage); - const inspectPanelPage = new InspectPanelPage(newPage); - await viewModePage.openInspectTab(); - await layersPanelPage.clickLayerOnLayersTab('Rectangle'); - await inspectPanelPage.openCodeTab(); - await newPage.waitForTimeout(200); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-code-tab-image.png'); - }); - - mainTest(qase([717], 'CO-396 Inspect functionality- Export'), async ({browserName}) => { + // mainTest(qase([685], 'CO-364 Click view mode (From right top click) - no boards created'), async ({browserName}) => { + // const newPage = await viewModePage.clickViewModeButton(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'no-board-view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([688], 'CO-367 Click view mode (From shortcut G+V) - board is created'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([690], 'CO-369 Full screen on/off'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickFullScreenButton(); + // await expect(viewModePage.fullScreenSection).toHaveScreenshot( + // 'view-mode-full-screen-image.png', + // ); + // await viewModePage.clickOnESC(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([698], 'CO-377 Click arrows to navigate to other boards'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // await mainPage.createDefaultBoardByCoordinates(500, 500, true); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'first-board-view-mode-page-image.png', + // ); + // await viewModePage.clickNextButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'second-board-view-mode-page-image.png', + // ); + // await viewModePage.clickPrevButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'first-board-view-mode-page-image.png', + // ); + // await viewModePage.clickNextButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'second-board-view-mode-page-image.png', + // ); + // await viewModePage.clickPrevButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'first-board-view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([700], 'CO-379 Click Back icon to reset view'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // await mainPage.createDefaultBoardByCoordinates(500, 500, true); + // await mainPage.waitForChangeIsSaved(); + // await mainPage.createDefaultBoardByCoordinates(100, 100, true); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'first-board-view-mode-page-image.png', + // ); + // await viewModePage.clickNextButton(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'second-board-view-mode-page-image.png', + // ); + // await viewModePage.clickNextButton(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'third-board-view-mode-page-image.png', + // ); + // await viewModePage.clickResetButton(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'first-board-view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([699], 'CO-378 Click board dropdown to navigate to other boards'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // await mainPage.createDefaultBoardByCoordinates(500, 500, true); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickSelectBoardDropdown(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'board-dropdown-view-mode-page-image.png', + // ); + // await viewModePage.selectSecondBoard(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'second-board-selected-view-mode-page-image.png', + // ); + // await viewModePage.selectFirstBoard(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'first-board-selected-view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([689], 'CO-368 Interactions dropdown'), async ({ page }) => { + // const userAgent = await page.evaluate(() => navigator.userAgent); + // const playwrightVersion = require('@playwright/test/package.json').version; + // + // console.log('Playwright version:', playwrightVersion); + // console.log('User-Agent:', userAgent); + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.createDefaultBoardByCoordinates(500, 500, true); + // await mainPage.waitForChangeIsSaved(); + // await prototypePanelPage.clickPrototypeTab(); + // await prototypePanelPage.dragAndDropPrototypeArrowConnector(300, 300); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickInteractionsDropdown(); + // await expect(viewModePage.interactionsDropdownOptions).toHaveScreenshot( + // 'show-on-click-interactions-options-default-image.png', + // ); + // await newPage.waitForTimeout(2000); + // await viewModePage.selectShowInteractionsOptions(); + // await viewModePage.clickOnBoardCounter(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'show-interactions-board-view-mode-page-image.png', + // ); + // await viewModePage.clickInteractionsDropdown(); + // await expect(viewModePage.interactionsDropdownOptions).toHaveScreenshot( + // 'interactions-show-options-image.png', + // ); + // await viewModePage.selectShowOnClickInteractionsOptions(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'show-on-click-interactions-board-view-mode-page-image.png', + // ); + // await viewModePage.clickOnBoardCounter(); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'show-on-click-interactions-board-view-mode-page-image2.png', + // ); + // }); + // + // mainTest(qase([691], 'CO-370 Change scale'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.openScaleDropdown(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.scaleDropdownOptions).toHaveScreenshot( + // 'scale-dropdown-view-mode-page-image.png', + // ); + // await viewModePage.clickDownscaleButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'downscale-board-view-mode-page-image.png', + // ); + // await viewModePage.clickResetScaleButton(); + // await viewModePage.clickUpscaleButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'upscale-board-view-mode-page-image.png', + // ); + // await viewModePage.selectFitScaleOptions(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'fit-scale-board-view-mode-page-image.png', + // ); + // await viewModePage.selectFillScaleOptions(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'fill-scale-board-view-mode-page-image.png', + // ); + // await viewModePage.selectFullScreenScaleOptions(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.fullScreenSection).toHaveScreenshot( + // 'full-screen-scale-board-view-mode-page-image.png', + // ); + // await viewModePage.clickResetScaleButton(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.fullScreenSection).toHaveScreenshot( + // 'full-screen-default-scale-board-view-mode-page-image.png', + // ); + // }); + // + // mainTest(qase([713], 'CO-392 Zoom by pressing + and - keys'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickOnAdd(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-page-add-button-image.png', + // ); + // await viewModePage.clickOnSubtract(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-page-subtract-button-image.png', + // ); + // }); + // + // mainTest(qase([708], 'CO-387 Page dropdown'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // await mainPage.clickAddPageButton(); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.openPageDropdown(); + // await expect(viewModePage.pageDropdownOptions).toHaveScreenshot( + // 'page-list-image.png', + // ); + // await viewModePage.selectPageByName('Page 2'); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-2page-image.png', + // ); + // await viewModePage.openPageDropdown(); + // await expect(viewModePage.pageDropdownOptions).toHaveScreenshot( + // 'page-list-image2.png', + // ); + // await viewModePage.selectPageByName('Page 1'); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-1page-image.png', + // ); + // }); + // + // mainTest(qase([701], 'CO-380 Create comment'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickCommentsButton(); + // await viewModePage.addComment(); + // + // const comment = 'Test Comment'; + // const commentsPanelPage = new CommentsPanelPage(newPage); + // await commentsPanelPage.enterCommentText('Test Comment'); + // await commentsPanelPage.clickPostCommentButton(); + // await commentsPanelPage.isCommentDisplayedInPopUp(comment); + // await expect(newPage).toHaveScreenshot('comment-opened-pop-up.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // await viewModePage.clickOnViewport(); + // await commentsPanelPage.isCommentThreadIconDisplayed(); + // await expect(newPage).toHaveScreenshot('comment-closed-pop-up.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // }); + // + // mainTest(qase([709], 'CO-388 Reply comment'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickCommentsButton(); + // await viewModePage.addComment(); + // + // const replyComment = + // 'Lorem Ipsum is simply dummy text of the printing and typesetting industry'; + // const commentsPanelPage = new CommentsPanelPage(newPage); + // await commentsPanelPage.enterCommentText('Test Comment'); + // await commentsPanelPage.clickPostCommentButton(); + // + // await commentsPanelPage.enterReplyText(replyComment); + // await commentsPanelPage.clickPostCommentButton(); + // await commentsPanelPage.isCommentReplyDisplayedInPopUp(replyComment); + // await expect(newPage).toHaveScreenshot('comment-reply.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // }); + // + // mainTest(qase([710], 'CO-389 Edit comment'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickCommentsButton(); + // await viewModePage.addComment(); + // + // const editedComment = 'Edited Test Comment'; + // const commentsPanelPage = new CommentsPanelPage(newPage); + // await commentsPanelPage.enterCommentText('Test Comment'); + // await commentsPanelPage.clickPostCommentButton(); + // + // await commentsPanelPage.clickCommentOptionsButton(); + // await commentsPanelPage.clickEditCommentOption(); + // await commentsPanelPage.enterCommentText(editedComment, true); + // await commentsPanelPage.clickPostCommentButton(); + // await commentsPanelPage.isCommentDisplayedInPopUp(editedComment); + // await commentsPanelPage.reloadPage(); + // await commentsPanelPage.clickCommentThreadIcon(); + // await commentsPanelPage.isCommentDisplayedInPopUp(editedComment); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(newPage).toHaveScreenshot('comment-edited.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // }); + // + // mainTest(qase([711], 'CO-390 Delete thread'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.clickCommentsButton(); + // await viewModePage.addComment(); + // + // const commentsPanelPage = new CommentsPanelPage(newPage); + // await commentsPanelPage.enterCommentText('Test Comment'); + // await commentsPanelPage.clickPostCommentButton(); + // + // await commentsPanelPage.clickCommentOptionsButton(); + // await commentsPanelPage.clickDeleteCommentOption(); + // await commentsPanelPage.clickDeleteThreadButton(); + // await commentsPanelPage.isCommentThreadIconNotDisplayed(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(newPage).toHaveScreenshot('comment-removed.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // }); + // + // mainTest(qase([703], 'CO-382 Comments dropdown (Hide resolved comments)'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // const commentsPanelPage = new CommentsPanelPage(newPage); + // await viewModePage.clickCommentsButton(); + // await viewModePage.addComment(); + // await commentsPanelPage.enterCommentText('Test Comment'); + // await commentsPanelPage.clickPostCommentButton(); + // await commentsPanelPage.isCommentDisplayedInPopUp('Test Comment'); + // await commentsPanelPage.clickResolveCommentCheckbox(); + // await commentsPanelPage.clickResolvedCommentThreadIcon(); + // await viewModePage.addComment(true); + // await commentsPanelPage.enterCommentText('Test Comment 2'); + // await commentsPanelPage.clickPostCommentButton(); + // await commentsPanelPage.isCommentDisplayedInPopUp('Test Comment 2'); + // await viewModePage.clickCommentsButton(); + // + // await viewModePage.openCommentsDropdown(); + // await viewModePage.selectHideResolvedCommentsOption(); + // await commentsPanelPage.isCommentResolvedThreadIconNotDisplayed(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(newPage).toHaveScreenshot('resolved-comments-hidden.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // await viewModePage.openCommentsDropdown(); + // await viewModePage.selectHideResolvedCommentsOption(); + // await commentsPanelPage.isCommentResolvedThreadIconDisplayed(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(newPage).toHaveScreenshot('resolved-comments-show.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // }); + // + // mainTest(qase([704], 'CO-383 Comments dropdown (Show comments list)'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // const commentsPanelPage = new CommentsPanelPage(newPage); + // await viewModePage.clickCommentsButton(); + // await viewModePage.addComment(); + // await commentsPanelPage.enterCommentText('Test Comment'); + // await commentsPanelPage.clickPostCommentButton(); + // await commentsPanelPage.isCommentDisplayedInPopUp('Test Comment'); + // await viewModePage.clickOnViewport(); + // + // await viewModePage.openCommentsDropdown(); + // await viewModePage.selectShowCommentsListOption(); + // await viewModePage.isCommentInListVisible(true); + // await expect(viewModePage.commentsRightPanel).toHaveScreenshot('comments-list.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // await viewModePage.openCommentsDropdown(); + // await viewModePage.selectShowCommentsListOption(); + // await viewModePage.isCommentInListVisible(false); + // await expect(newPage).toHaveScreenshot('comments-list-hidden.png', { + // mask: [commentsPanelPage.commentsAuthorSection], + // }); + // }); + // + // mainTest(qase([706], 'CO-385 Switch to Inspect view'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await mainPage.waitForChangeIsSaved(); + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // await viewModePage.openInspectTab(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-inspect-page-image.png'); + // await viewModePage.openInteractionsTab(); + // browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-interactions-page-image.png'); + // }); + // + // mainTest(qase([715], 'CO-394 Inspect functionality - Board elements dropdown in the top left'), async ({browserName}) => { + // await mainPage.createDefaultBoardByCoordinates(300, 300); + // await designPanelPage.changeHeightAndWidthForLayer('200', '200'); + // await mainPage.waitForChangeIsSaved(); + // await mainPage.createDefaultRectangleByCoordinates(320, 320); + // await layersPanelPage.dragAndDropComponentToBoard('Rectangle'); + // await mainPage.waitForChangeIsSaved(); + // + // const newPage = await viewModePage.clickViewModeShortcut(); + // viewModePage = new ViewModePage(newPage); + // await viewModePage.waitForViewerSection(45000); + // layersPanelPage = new LayersPanelPage(newPage); + // const inspectPanelPage = new InspectPanelPage(newPage); + // await viewModePage.openInspectTab(); + // await layersPanelPage.clickLayerOnLayersTab('Rectangle'); + // await inspectPanelPage.openCodeTab(); + // await newPage.waitForTimeout(200); + // await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( + // 'view-mode-code-tab-image.png'); + // }); + + mainTest.only(qase([717], 'CO-396 Inspect functionality- Export'), async ({browserName}) => { await mainPage.createDefaultBoardByCoordinates(300, 300); await designPanelPage.changeHeightAndWidthForLayer('200', '200'); await mainPage.waitForChangeIsSaved(); @@ -523,303 +523,303 @@ mainTest.describe(() => { await designPanelPage.clickExportElementButton(newPage); }); - mainTest(qase([1785], 'CO-387 Switch between layers from left menu'), async ({ browserName }) => { - await mainPage.createDefaultBoardByCoordinates(200, 200); - await designPanelPage.changeHeightAndWidthForLayer('500', '700'); - await mainPage.waitForChangeIsSaved(); - await mainPage.uploadImage('images/mini_sample.jpg'); - await layersPanelPage.dragAndDropComponentToBoard('mini_sample'); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultRectangleByCoordinates(220, 220); - await layersPanelPage.dragAndDropComponentToBoard('Rectangle'); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultEllipseByCoordinates(330, 220, true); - await layersPanelPage.dragAndDropComponentToBoard('Ellipse'); - await mainPage.waitForChangeIsSaved(); - await mainPage.createDefaultTextLayerByCoordinates(220, 330, browserName); - await layersPanelPage.dragAndDropComponentToBoard('Hello World!'); - await mainPage.waitForChangeIsSaved(); - await mainPage.createSmallClosedPathByCoordinates(330, 330); - await layersPanelPage.dragAndDropComponentToBoard('Path'); - await mainPage.waitForChangeIsSaved(); - - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - layersPanelPage = new LayersPanelPage(newPage); - await viewModePage.openInspectTab(); - await layersPanelPage.clickLayerOnLayersTab('Rectangle'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-rectangle-selected-image.png'); - await layersPanelPage.clickLayerOnLayersTab('Ellipse'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-ellipse-selected-image.png'); - await layersPanelPage.clickLayerOnLayersTab('Hello World!'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-test-selected-image.png'); - await layersPanelPage.clickLayerOnLayersTab('Path'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-path-selected-image.png'); - await layersPanelPage.clickLayerOnLayersTab('mini_sample'); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-image-selected-image.png'); - }); - - mainTest(qase([1787], 'CO-389 Copy layout and paste'), async ({ browserName }) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await designPanelPage.changeHeightAndWidthForLayer('200', '200'); - await mainPage.waitForChangeIsSaved(); - - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - layersPanelPage = new LayersPanelPage(newPage); - await viewModePage.openInspectTab(); - await viewModePage.copyWidth(); - await expect(viewModePage.rightSidebar).toHaveScreenshot( - 'view-mode-copy-width-image.png'); - await viewModePage.checkBuffer('width: 200px;', newPage, browserName); - }); - - mainTest(qase([705], 'CO-384 Edit file'), async ({ page, browserName }) => { - if (browserName === 'webkit') { - - } else { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await designPanelPage.changeHeightAndWidthForLayer('200', '200'); - await mainPage.waitForChangeIsSaved(); - - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - layersPanelPage = new LayersPanelPage(newPage); - - await viewModePage.clickEditButton(); - await newPage.waitForTimeout(1000); - await viewModePage.isPageSwitched(newPage); - - await page.close(); - await viewModePage.clickEditButton(); - const oldPage = await viewModePage.clickEditButton(false); - mainPage = new MainPage(oldPage); - teamPage = new TeamPage(oldPage); - await mainPage.waitForViewportVisible(); - await expect(mainPage.viewport).toHaveScreenshot( - 'main-page-opened.png', - ); - } - }); -}); - -mainTest.describe(() => { - mainTest(qase([693], 'CO-372 Share prototype - get link (2 pages)'), async ({ page, browserName }) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - await mainPage.clickAddPageButton(); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickShareButton(); - browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; - await expect(viewModePage.shareLincDialog).toHaveScreenshot( - 'view-mode-share-window-image.png', - ); - await viewModePage.clickGetLincButton(); - await viewModePage.clickManagePermissionsButton(); - await expect(viewModePage.shareLincDialog).toHaveScreenshot( - 'view-mode-share-window-1page-selected-image.png', - ); - await viewModePage.selectAllPages(); - await expect(viewModePage.shareLincDialog).toHaveScreenshot( - 'view-mode-share-window-all-pages-selected-image.png', - ); - await viewModePage.clickGetLincButton(); - const shareLinc = await viewModePage.clickCopyLincButton(); - await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); - - await mainPage.clickPencilBoxButton(); - await profilePage.logout(); - await loginPage.isLoginPageOpened(); - await profilePage.gotoLinc(shareLinc); - const newViewModePage = new ViewModePage(page); - await newViewModePage.isViewerSectionVisible(); - await expect(newViewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-shared-image.png'); - await loginPage.goto(); - }); - - mainTest(qase([694], 'CO-373 Share prototype - destroy link'), async ({ page, browserName }) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickShareButton(); - await viewModePage.clickGetLincButton(); - const shareLinc = await viewModePage.clickCopyLincButton(); - await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); - - await viewModePage.clickDestroyLincButton(); - - await mainPage.clickPencilBoxButton(); - await profilePage.logout(); - await loginPage.isLoginPageOpened(); - await profilePage.gotoLinc(shareLinc); - viewModePage = new ViewModePage(page); - await viewModePage.isViewerSectionVisible(false); - await expect(mainPage.errorScreen).toHaveScreenshot( - 'shared-error-image.png'); - await loginPage.goto(); - }); - - mainTest(qase([696], 'CO-375 Share prototype - manage permissions ("Can comment")'), async ({ page, browserName }) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickShareButton(); - await viewModePage.clickManagePermissionsButton(); - await viewModePage.selectAllUsersCommentPermission(); - await viewModePage.clickGetLincButton(); - const shareLinc = await viewModePage.clickCopyLincButton(); - await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); - await expect(viewModePage.shareLincDialog).toHaveScreenshot( - 'view-mode-share-window-all-users-comment-image.png', - ); - await newPage.close(); - - await mainPage.clickPencilBoxButton(); - await profilePage.logout(); - await loginPage.isLoginPageOpened(); - await loginPage.enterEmail(process.env.SECOND_EMAIL); - await loginPage.enterPwd(process.env.LOGIN_PWD); - await loginPage.clickLoginButton(); - await dashboardPage.isDashboardOpenedAfterLogin(); - await profilePage.gotoLinc(shareLinc); - viewModePage = new ViewModePage(page); - await viewModePage.isViewerSectionVisible(); - await viewModePage.clickCommentsButton(); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-shared-comments-image.png'); - await viewModePage.gotoLinc(process.env.BASE_URL); - await mainPage.isHeaderDisplayed('Projects'); - await profilePage.logout(); - }); - - mainTest(qase([697], 'CO-376 Share prototype - manage permissions ("Can inspect code ")'), async ({ page, browserName }) => { - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(newPage); - await viewModePage.waitForViewerSection(45000); - await viewModePage.clickShareButton(); - await viewModePage.clickManagePermissionsButton(); - await viewModePage.selectAllUsersInspectPermission(); - await viewModePage.clickGetLincButton(); - const shareLinc = await viewModePage.clickCopyLincButton(); - await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); - await expect(viewModePage.shareLincDialog).toHaveScreenshot( - 'view-mode-share-window-all-users-inspect-image.png', - ); - await newPage.close(); - - await mainPage.clickPencilBoxButton(); - await profilePage.logout(); - await loginPage.isLoginPageOpened(); - await loginPage.enterEmail(process.env.SECOND_EMAIL); - await loginPage.enterPwd(process.env.LOGIN_PWD); - await loginPage.clickLoginButton(); - await dashboardPage.isDashboardOpenedAfterLogin(); - await profilePage.gotoLinc(shareLinc); - viewModePage = new ViewModePage(page); - const inspectPanelPage = new InspectPanelPage(page); - await viewModePage.isViewerSectionVisible(); - await viewModePage.openInspectTab(); - await inspectPanelPage.openCodeTab(); - await page.waitForTimeout(200); - await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( - 'view-mode-shared-code-image.png'); - await viewModePage.gotoLinc(process.env.BASE_URL); - await mainPage.isHeaderDisplayed('Projects'); - await profilePage.logout(); - }); - - mainTest(qase(702,'CO-381 Comments dropdown (All and Only your comments)'), async ({ page }, testInfo) => { - await testInfo.setTimeout(testInfo.timeout + 60000); - const firstAdmin = random().concat('autotest'); - const firstEmail = `${process.env.GMAIL_NAME}+${firstAdmin}@gmail.com`; - - await mainPage.createDefaultBoardByCoordinates(300, 300); - await mainPage.waitForChangeIsSaved(); - const newPage = await viewModePage.clickViewModeShortcut(); - let viewModePage2 = new ViewModePage(newPage); - await viewModePage2.clickCommentsButton(); - await viewModePage2.addComment(); - - const comment = 'Test Comment (main user)'; - let commentsPanelPage = new CommentsPanelPage(newPage); - await commentsPanelPage.enterCommentText(comment); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp(comment); - await newPage.close(); - await mainPage.backToDashboardFromFileEditor(); - - await teamPage.openInvitationsPageViaOptionsMenu(); - await teamPage.clickInviteMembersToTeamButton(); - await teamPage.isInviteMembersPopUpHeaderDisplayed( - 'Invite members to the team', - ); - await teamPage.enterEmailToInviteMembersPopUp(firstEmail); - await teamPage.selectInvitationRoleInPopUp('Admin'); - await teamPage.clickSendInvitationButton(); - await teamPage.isSuccessMessageDisplayed('Invitation sent successfully'); - const firstInvite = await waitMessage(page, firstEmail, 40); - - await profilePage.logout(); - await loginPage.isLoginPageOpened(); - await page.goto(firstInvite.inviteUrl); - await registerPage.isRegisterPageOpened(); - await registerPage.enterEmail(firstEmail); - await registerPage.enterPassword(process.env.LOGIN_PWD); - await registerPage.clickOnCreateAccountBtn(); - await registerPage.enterFullName(firstAdmin); - await registerPage.clickOnAcceptTermsCheckbox(); - await registerPage.clickOnCreateAccountSecondBtn(); - await dashboardPage.fillOnboardingQuestions(); - await teamPage.isTeamSelected(teamName); - - await dashboardPage.openFile(); - await mainPage.isMainPageLoaded(); - const secondPage = await viewModePage.clickViewModeShortcut(); - viewModePage = new ViewModePage(secondPage); - await viewModePage.clickCommentsButton(); - await viewModePage.addComment(true); - const comment2 = 'Test Comment (main user)'; - commentsPanelPage = new CommentsPanelPage(secondPage); - await commentsPanelPage.enterCommentText(comment2); - await commentsPanelPage.clickPostCommentButton(); - await commentsPanelPage.isCommentDisplayedInPopUp(comment2); - await expect(secondPage).toHaveScreenshot('all-users-comments.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - await viewModePage.openCommentsDropdown(); - await viewModePage.selectShowYourCommentsOption(); - await expect(secondPage).toHaveScreenshot('only-your-comments.png', { - mask: [commentsPanelPage.commentsAuthorSection], - }); - await secondPage.close(); - - await mainPage.backToDashboardFromFileEditor(); - await profilePage.logout(); - }); - - mainTest.afterEach(async () => { - await loginPage.isLoginPageOpened(); - await loginPage.enterEmail(process.env.LOGIN_EMAIL); - await loginPage.enterPwd(process.env.LOGIN_PWD); - await loginPage.clickLoginButton(); - await dashboardPage.isDashboardOpenedAfterLogin(); - }); +// mainTest(qase([1785], 'CO-387 Switch between layers from left menu'), async ({ browserName }) => { +// await mainPage.createDefaultBoardByCoordinates(200, 200); +// await designPanelPage.changeHeightAndWidthForLayer('500', '700'); +// await mainPage.waitForChangeIsSaved(); +// await mainPage.uploadImage('images/mini_sample.jpg'); +// await layersPanelPage.dragAndDropComponentToBoard('mini_sample'); +// await mainPage.waitForChangeIsSaved(); +// await mainPage.createDefaultRectangleByCoordinates(220, 220); +// await layersPanelPage.dragAndDropComponentToBoard('Rectangle'); +// await mainPage.waitForChangeIsSaved(); +// await mainPage.createDefaultEllipseByCoordinates(330, 220, true); +// await layersPanelPage.dragAndDropComponentToBoard('Ellipse'); +// await mainPage.waitForChangeIsSaved(); +// await mainPage.createDefaultTextLayerByCoordinates(220, 330, browserName); +// await layersPanelPage.dragAndDropComponentToBoard('Hello World!'); +// await mainPage.waitForChangeIsSaved(); +// await mainPage.createSmallClosedPathByCoordinates(330, 330); +// await layersPanelPage.dragAndDropComponentToBoard('Path'); +// await mainPage.waitForChangeIsSaved(); +// +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// layersPanelPage = new LayersPanelPage(newPage); +// await viewModePage.openInspectTab(); +// await layersPanelPage.clickLayerOnLayersTab('Rectangle'); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-rectangle-selected-image.png'); +// await layersPanelPage.clickLayerOnLayersTab('Ellipse'); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-ellipse-selected-image.png'); +// await layersPanelPage.clickLayerOnLayersTab('Hello World!'); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-test-selected-image.png'); +// await layersPanelPage.clickLayerOnLayersTab('Path'); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-path-selected-image.png'); +// await layersPanelPage.clickLayerOnLayersTab('mini_sample'); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-image-selected-image.png'); +// }); +// +// mainTest(qase([1787], 'CO-389 Copy layout and paste'), async ({ browserName }) => { +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await designPanelPage.changeHeightAndWidthForLayer('200', '200'); +// await mainPage.waitForChangeIsSaved(); +// +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// layersPanelPage = new LayersPanelPage(newPage); +// await viewModePage.openInspectTab(); +// await viewModePage.copyWidth(); +// await expect(viewModePage.rightSidebar).toHaveScreenshot( +// 'view-mode-copy-width-image.png'); +// await viewModePage.checkBuffer('width: 200px;', newPage, browserName); +// }); +// +// mainTest(qase([705], 'CO-384 Edit file'), async ({ page, browserName }) => { +// if (browserName === 'webkit') { +// +// } else { +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await designPanelPage.changeHeightAndWidthForLayer('200', '200'); +// await mainPage.waitForChangeIsSaved(); +// +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// layersPanelPage = new LayersPanelPage(newPage); +// +// await viewModePage.clickEditButton(); +// await newPage.waitForTimeout(1000); +// await viewModePage.isPageSwitched(newPage); +// +// await page.close(); +// await viewModePage.clickEditButton(); +// const oldPage = await viewModePage.clickEditButton(false); +// mainPage = new MainPage(oldPage); +// teamPage = new TeamPage(oldPage); +// await mainPage.waitForViewportVisible(); +// await expect(mainPage.viewport).toHaveScreenshot( +// 'main-page-opened.png', +// ); +// } +// }); +// }); +// +// mainTest.describe(() => { +// mainTest(qase([693], 'CO-372 Share prototype - get link (2 pages)'), async ({ page, browserName }) => { +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await mainPage.waitForChangeIsSaved(); +// await mainPage.clickAddPageButton(); +// await mainPage.waitForChangeIsSaved(); +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// await viewModePage.clickShareButton(); +// browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; +// await expect(viewModePage.shareLincDialog).toHaveScreenshot( +// 'view-mode-share-window-image.png', +// ); +// await viewModePage.clickGetLincButton(); +// await viewModePage.clickManagePermissionsButton(); +// await expect(viewModePage.shareLincDialog).toHaveScreenshot( +// 'view-mode-share-window-1page-selected-image.png', +// ); +// await viewModePage.selectAllPages(); +// await expect(viewModePage.shareLincDialog).toHaveScreenshot( +// 'view-mode-share-window-all-pages-selected-image.png', +// ); +// await viewModePage.clickGetLincButton(); +// const shareLinc = await viewModePage.clickCopyLincButton(); +// await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); +// +// await mainPage.clickPencilBoxButton(); +// await profilePage.logout(); +// await loginPage.isLoginPageOpened(); +// await profilePage.gotoLinc(shareLinc); +// const newViewModePage = new ViewModePage(page); +// await newViewModePage.isViewerSectionVisible(); +// await expect(newViewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-shared-image.png'); +// await loginPage.goto(); +// }); +// +// mainTest(qase([694], 'CO-373 Share prototype - destroy link'), async ({ page, browserName }) => { +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await mainPage.waitForChangeIsSaved(); +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// await viewModePage.clickShareButton(); +// await viewModePage.clickGetLincButton(); +// const shareLinc = await viewModePage.clickCopyLincButton(); +// await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); +// +// await viewModePage.clickDestroyLincButton(); +// +// await mainPage.clickPencilBoxButton(); +// await profilePage.logout(); +// await loginPage.isLoginPageOpened(); +// await profilePage.gotoLinc(shareLinc); +// viewModePage = new ViewModePage(page); +// await viewModePage.isViewerSectionVisible(false); +// await expect(mainPage.errorScreen).toHaveScreenshot( +// 'shared-error-image.png'); +// await loginPage.goto(); +// }); +// +// mainTest(qase([696], 'CO-375 Share prototype - manage permissions ("Can comment")'), async ({ page, browserName }) => { +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await mainPage.waitForChangeIsSaved(); +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// await viewModePage.clickShareButton(); +// await viewModePage.clickManagePermissionsButton(); +// await viewModePage.selectAllUsersCommentPermission(); +// await viewModePage.clickGetLincButton(); +// const shareLinc = await viewModePage.clickCopyLincButton(); +// await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); +// await expect(viewModePage.shareLincDialog).toHaveScreenshot( +// 'view-mode-share-window-all-users-comment-image.png', +// ); +// await newPage.close(); +// +// await mainPage.clickPencilBoxButton(); +// await profilePage.logout(); +// await loginPage.isLoginPageOpened(); +// await loginPage.enterEmail(process.env.SECOND_EMAIL); +// await loginPage.enterPwd(process.env.LOGIN_PWD); +// await loginPage.clickLoginButton(); +// await dashboardPage.isDashboardOpenedAfterLogin(); +// await profilePage.gotoLinc(shareLinc); +// viewModePage = new ViewModePage(page); +// await viewModePage.isViewerSectionVisible(); +// await viewModePage.clickCommentsButton(); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-shared-comments-image.png'); +// await viewModePage.gotoLinc(process.env.BASE_URL); +// await mainPage.isHeaderDisplayed('Projects'); +// await profilePage.logout(); +// }); +// +// mainTest(qase([697], 'CO-376 Share prototype - manage permissions ("Can inspect code ")'), async ({ page, browserName }) => { +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await mainPage.waitForChangeIsSaved(); +// const newPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(newPage); +// await viewModePage.waitForViewerSection(45000); +// await viewModePage.clickShareButton(); +// await viewModePage.clickManagePermissionsButton(); +// await viewModePage.selectAllUsersInspectPermission(); +// await viewModePage.clickGetLincButton(); +// const shareLinc = await viewModePage.clickCopyLincButton(); +// await viewModePage.isSuccessMessageDisplayed('Link copied successfully'); +// await expect(viewModePage.shareLincDialog).toHaveScreenshot( +// 'view-mode-share-window-all-users-inspect-image.png', +// ); +// await newPage.close(); +// +// await mainPage.clickPencilBoxButton(); +// await profilePage.logout(); +// await loginPage.isLoginPageOpened(); +// await loginPage.enterEmail(process.env.SECOND_EMAIL); +// await loginPage.enterPwd(process.env.LOGIN_PWD); +// await loginPage.clickLoginButton(); +// await dashboardPage.isDashboardOpenedAfterLogin(); +// await profilePage.gotoLinc(shareLinc); +// viewModePage = new ViewModePage(page); +// const inspectPanelPage = new InspectPanelPage(page); +// await viewModePage.isViewerSectionVisible(); +// await viewModePage.openInspectTab(); +// await inspectPanelPage.openCodeTab(); +// await page.waitForTimeout(200); +// await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( +// 'view-mode-shared-code-image.png'); +// await viewModePage.gotoLinc(process.env.BASE_URL); +// await mainPage.isHeaderDisplayed('Projects'); +// await profilePage.logout(); +// }); +// +// mainTest(qase(702,'CO-381 Comments dropdown (All and Only your comments)'), async ({ page }, testInfo) => { +// await testInfo.setTimeout(testInfo.timeout + 60000); +// const firstAdmin = random().concat('autotest'); +// const firstEmail = `${process.env.GMAIL_NAME}+${firstAdmin}@gmail.com`; +// +// await mainPage.createDefaultBoardByCoordinates(300, 300); +// await mainPage.waitForChangeIsSaved(); +// const newPage = await viewModePage.clickViewModeShortcut(); +// let viewModePage2 = new ViewModePage(newPage); +// await viewModePage2.clickCommentsButton(); +// await viewModePage2.addComment(); +// +// const comment = 'Test Comment (main user)'; +// let commentsPanelPage = new CommentsPanelPage(newPage); +// await commentsPanelPage.enterCommentText(comment); +// await commentsPanelPage.clickPostCommentButton(); +// await commentsPanelPage.isCommentDisplayedInPopUp(comment); +// await newPage.close(); +// await mainPage.backToDashboardFromFileEditor(); +// +// await teamPage.openInvitationsPageViaOptionsMenu(); +// await teamPage.clickInviteMembersToTeamButton(); +// await teamPage.isInviteMembersPopUpHeaderDisplayed( +// 'Invite members to the team', +// ); +// await teamPage.enterEmailToInviteMembersPopUp(firstEmail); +// await teamPage.selectInvitationRoleInPopUp('Admin'); +// await teamPage.clickSendInvitationButton(); +// await teamPage.isSuccessMessageDisplayed('Invitation sent successfully'); +// const firstInvite = await waitMessage(page, firstEmail, 40); +// +// await profilePage.logout(); +// await loginPage.isLoginPageOpened(); +// await page.goto(firstInvite.inviteUrl); +// await registerPage.isRegisterPageOpened(); +// await registerPage.enterEmail(firstEmail); +// await registerPage.enterPassword(process.env.LOGIN_PWD); +// await registerPage.clickOnCreateAccountBtn(); +// await registerPage.enterFullName(firstAdmin); +// await registerPage.clickOnAcceptTermsCheckbox(); +// await registerPage.clickOnCreateAccountSecondBtn(); +// await dashboardPage.fillOnboardingQuestions(); +// await teamPage.isTeamSelected(teamName); +// +// await dashboardPage.openFile(); +// await mainPage.isMainPageLoaded(); +// const secondPage = await viewModePage.clickViewModeShortcut(); +// viewModePage = new ViewModePage(secondPage); +// await viewModePage.clickCommentsButton(); +// await viewModePage.addComment(true); +// const comment2 = 'Test Comment (main user)'; +// commentsPanelPage = new CommentsPanelPage(secondPage); +// await commentsPanelPage.enterCommentText(comment2); +// await commentsPanelPage.clickPostCommentButton(); +// await commentsPanelPage.isCommentDisplayedInPopUp(comment2); +// await expect(secondPage).toHaveScreenshot('all-users-comments.png', { +// mask: [commentsPanelPage.commentsAuthorSection], +// }); +// await viewModePage.openCommentsDropdown(); +// await viewModePage.selectShowYourCommentsOption(); +// await expect(secondPage).toHaveScreenshot('only-your-comments.png', { +// mask: [commentsPanelPage.commentsAuthorSection], +// }); +// await secondPage.close(); +// +// await mainPage.backToDashboardFromFileEditor(); +// await profilePage.logout(); +// }); +// +// mainTest.afterEach(async () => { +// await loginPage.isLoginPageOpened(); +// await loginPage.enterEmail(process.env.LOGIN_EMAIL); +// await loginPage.enterPwd(process.env.LOGIN_PWD); +// await loginPage.clickLoginButton(); +// await dashboardPage.isDashboardOpenedAfterLogin(); +// }); });