From 1b37415e5dfad586cd1a006b7b9ecdd1f0e3ea7c Mon Sep 17 00:00:00 2001 From: chalapkoStanislav Date: Fri, 23 Aug 2024 23:08:53 +0300 Subject: [PATCH] webkit test fix --- pages/dashboard/dashboard-page.js | 4 + pages/dashboard/team-page.js | 11 +- pages/workspace/main-page.js | 10 ++ pages/workspace/view-mode-page.js | 4 + tests/assets/assets-colors.spec.js | 7 +- tests/assets/assets-shortcuts-panel.spec.js | 5 +- .../create-main-components.spec.js | 5 +- tests/view-mode.spec.js | 107 +++++++++++++----- 8 files changed, 120 insertions(+), 33 deletions(-) diff --git a/pages/dashboard/dashboard-page.js b/pages/dashboard/dashboard-page.js index 6d4cc6ff..deff6430 100644 --- a/pages/dashboard/dashboard-page.js +++ b/pages/dashboard/dashboard-page.js @@ -884,4 +884,8 @@ exports.DashboardPage = class DashboardPage extends BasePage { async checkPageNumber(number) { await expect(this.onboardingPaginator).toHaveText(`${number}/5`); } + + async waitForCreateFilePlaceholderVisible() { + await this.createFileButtonPlaceholder.first().waitFor({ state: 'visible' }); + } }; diff --git a/pages/dashboard/team-page.js b/pages/dashboard/team-page.js index 7c85cc28..ab6de121 100644 --- a/pages/dashboard/team-page.js +++ b/pages/dashboard/team-page.js @@ -10,6 +10,7 @@ exports.TeamPage = class TeamPage extends BasePage { // Teams this.teamCurrentBtn = page.locator('button[class*="current-team"]'); + this.teamCurrentBtnWebkit = page.locator('button[class*="current-team"] div span').first(); this.teamList = page.locator('ul[class*="teams-dropdown"]'); this.createNewTeamMenuItem = page.locator('#teams-selector-create-team'); this.teamNameInput = page.locator('#name'); @@ -111,8 +112,14 @@ exports.TeamPage = class TeamPage extends BasePage { await this.createNewTeamButton.click(); } - async isTeamSelected(teamName) { - await expect(this.teamCurrentBtn).toHaveText(teamName); + async isTeamSelected(teamName, browserName = 'chrome') { + browserName === 'webkit' + ? await expect(this.teamCurrentBtnWebkit).toHaveText(teamName) + : await expect(this.teamCurrentBtn).toHaveText(teamName); + } + + async waitForTeamBtn(timeout = 10000) { + await this.teamCurrentBtnWebkit.waitFor({ state: 'visible' , timeout: timeout}); } async openTeamsListIfClosed() { diff --git a/pages/workspace/main-page.js b/pages/workspace/main-page.js index aa8699c1..8ff5653f 100644 --- a/pages/workspace/main-page.js +++ b/pages/workspace/main-page.js @@ -338,6 +338,16 @@ exports.MainPage = class MainPage extends BasePage { await expect(this.viewport).toBeVisible(); } + async isMainPageVisible() { + try { + await this.viewport.waitFor({ state: 'visible' , timeout: 8000}); + return true; + } catch (error) { + console.log(error); + return false; + } + } + async isProjectAndFileNameExistInFile(projectName, fileName) { await expect(this.projectNameSpan).toContainText(projectName); await expect(this.fileNameSpan.last()).toHaveText(fileName); diff --git a/pages/workspace/view-mode-page.js b/pages/workspace/view-mode-page.js index 72857042..576b4906 100644 --- a/pages/workspace/view-mode-page.js +++ b/pages/workspace/view-mode-page.js @@ -281,6 +281,10 @@ exports.ViewModePage = class ViewModePage extends BasePage { : await expect(this.viewerLoyautSection).not.toBeVisible(); } + async waitForViewerSection(timeout = 10000) { + await this.viewerLoyautSection.waitFor({ state: 'visible' , timeout: timeout}); + } + async clickDestroyLincButton() { await this.destroyLincButton.click(); await this.destroyLincButton.click(); diff --git a/tests/assets/assets-colors.spec.js b/tests/assets/assets-colors.spec.js index ec0a4d82..ff8f1363 100644 --- a/tests/assets/assets-colors.spec.js +++ b/tests/assets/assets-colors.spec.js @@ -12,13 +12,16 @@ const { qase } = require('playwright-qase-reporter/dist/playwright'); const teamName = random().concat('autotest'); -test.beforeEach(async ({ page }) => { +test.beforeEach(async ({ page, browserName }) => { const teamPage = new TeamPage(page); const dashboardPage = new DashboardPage(page); const mainPage = new MainPage(page); await teamPage.createTeam(teamName); await teamPage.isTeamSelected(teamName); await dashboardPage.createFileViaPlaceholder(); + browserName === 'webkit' && !( await mainPage.isMainPageVisible()) + ? await dashboardPage.createFileViaPlaceholder() + : null; await mainPage.isMainPageLoaded(); }); @@ -48,7 +51,7 @@ mainTest.describe(() => { await colorPalettePopUp.clickSaveColorStyleButton(); await mainPage.clickViewportTwice(); await mainPage.waitForChangeIsSaved(); - }); + }); mainTest(qase(933,'AS-23 File library colors - add'), async ({ page }) => { const assetsPanelPage = new AssetsPanelPage(page); diff --git a/tests/assets/assets-shortcuts-panel.spec.js b/tests/assets/assets-shortcuts-panel.spec.js index 4937478e..06ad3f77 100644 --- a/tests/assets/assets-shortcuts-panel.spec.js +++ b/tests/assets/assets-shortcuts-panel.spec.js @@ -9,13 +9,16 @@ const { qase } = require('playwright-qase-reporter/dist/playwright'); const teamName = random().concat('autotest'); -test.beforeEach(async ({ page }) => { +test.beforeEach(async ({ page, browserName }) => { const teamPage = new TeamPage(page); const dashboardPage = new DashboardPage(page); const mainPage = new MainPage(page); await teamPage.createTeam(teamName); await teamPage.isTeamSelected(teamName); await dashboardPage.createFileViaPlaceholder(); + browserName === 'webkit' && !( await mainPage.isMainPageVisible()) + ? await dashboardPage.createFileViaPlaceholder() + : null; await mainPage.isMainPageLoaded(); }); diff --git a/tests/components/main-components/create-main-components.spec.js b/tests/components/main-components/create-main-components.spec.js index 1d8e1d99..c563854b 100644 --- a/tests/components/main-components/create-main-components.spec.js +++ b/tests/components/main-components/create-main-components.spec.js @@ -13,12 +13,15 @@ const { qase } = require('playwright-qase-reporter/dist/playwright'); const teamName = random().concat('autotest'); -test.beforeEach(async ({ page }) => { +test.beforeEach(async ({ page, browserName }) => { const dashboardPage = new DashboardPage(page); const teamPage = new TeamPage(page); const mainPage = new MainPage(page); await teamPage.createTeam(teamName); await dashboardPage.createFileViaPlaceholder(); + browserName === 'webkit' && !( await mainPage.isMainPageVisible()) + ? await dashboardPage.createFileViaPlaceholder() + : null; await mainPage.isMainPageLoaded(); }); diff --git a/tests/view-mode.spec.js b/tests/view-mode.spec.js index 7f0cc233..e2ee2ba2 100644 --- a/tests/view-mode.spec.js +++ b/tests/view-mode.spec.js @@ -20,7 +20,7 @@ const { waitMessage } = require('../helpers/gmail'); const teamName = random().concat('autotest'); let teamPage,dashboardPage,mainPage,viewModePage,prototypePanelPage,designPanelPage,layersPanelPage,profilePage,loginPage,registerPage; -test.beforeEach(async ({ page }) => { +test.beforeEach(async ({ page, browserName }) => { teamPage = new TeamPage(page); dashboardPage = new DashboardPage(page); mainPage = new MainPage(page); @@ -32,8 +32,12 @@ test.beforeEach(async ({ page }) => { loginPage = new LoginPage(page); registerPage = new RegisterPage(page); await teamPage.createTeam(teamName); - await teamPage.isTeamSelected(teamName); + browserName === 'webkit' ? await teamPage.waitForTeamBtn(15000) : null; + await teamPage.isTeamSelected(teamName, browserName); await dashboardPage.createFileViaPlaceholder(); + browserName === 'webkit' && !( await mainPage.isMainPageVisible()) + ? await dashboardPage.createFileViaPlaceholder() + : null; await mainPage.isMainPageLoaded(); }); @@ -44,33 +48,36 @@ test.afterEach(async ({ page }, testInfo) => { mainTest.describe(() => { - mainTest.afterEach(async ({ page }, testInfo) => { + mainTest.afterEach(async () => { await mainPage.backToDashboardFromFileEditor(); }); - mainTest(qase([685], 'CO-364 Click view mode (From right top click) - no boards created'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; 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 () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( 'view-mode-page-image.png', ); }); - mainTest(qase([690], 'CO-369 Full screen on/off'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickFullScreenButton(); await expect(viewModePage.fullScreenSection).toHaveScreenshot( 'view-mode-full-screen-image.png', @@ -81,35 +88,40 @@ mainTest.describe(() => { ); }); - mainTest(qase([698], 'CO-377 Click arrows to navigate to other boards'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : 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', ); 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 () => { + 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); @@ -118,6 +130,7 @@ mainTest.describe(() => { await mainPage.waitForChangeIsSaved(); const newPage = await viewModePage.clickViewModeShortcut(); viewModePage = new ViewModePage(newPage); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await expect(viewModePage.viewerLoyautSection).toHaveScreenshot( 'first-board-view-mode-page-image.png', ); @@ -135,28 +148,32 @@ mainTest.describe(() => { ); }); - mainTest(qase([699], 'CO-378 Click board dropdown to navigate to other boards'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; 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 }) => { + mainTest(qase([689], 'CO-368 Interactions dropdown'), async ({ browserName }) => { await mainPage.createDefaultBoardByCoordinates(300, 300); await mainPage.createDefaultBoardByCoordinates(500, 500, true); await mainPage.waitForChangeIsSaved(); @@ -164,6 +181,7 @@ mainTest.describe(() => { await prototypePanelPage.dragAndDropPrototypeArrowConnector(300, 300); const newPage = await viewModePage.clickViewModeShortcut(); viewModePage = new ViewModePage(newPage); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickInteractionsDropdown(); await expect(viewModePage.interactionsDropdownOptions).toHaveScreenshot( 'show-on-click-interactions-options-default-image.png', @@ -188,64 +206,76 @@ mainTest.describe(() => { ); }); - mainTest(qase([691], 'CO-370 Change scale'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; 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 () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; 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 () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.openPageDropdown(); await expect(viewModePage.pageDropdownOptions).toHaveScreenshot( 'page-list-image.png', @@ -264,11 +294,12 @@ mainTest.describe(() => { ); }); - mainTest(qase([701], 'CO-380 Create comment'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickCommentsButton(); await viewModePage.addComment(); @@ -287,11 +318,12 @@ mainTest.describe(() => { }); }); - mainTest(qase([709], 'CO-388 Reply comment'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickCommentsButton(); await viewModePage.addComment(); @@ -309,11 +341,12 @@ mainTest.describe(() => { }); }); - mainTest(qase([710], 'CO-389 Edit comment'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickCommentsButton(); await viewModePage.addComment(); @@ -330,16 +363,18 @@ mainTest.describe(() => { 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 () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickCommentsButton(); await viewModePage.addComment(); @@ -351,16 +386,18 @@ mainTest.describe(() => { 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 () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; const commentsPanelPage = new CommentsPanelPage(newPage); await viewModePage.clickCommentsButton(); await viewModePage.addComment(); @@ -378,22 +415,25 @@ mainTest.describe(() => { 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 () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; const commentsPanelPage = new CommentsPanelPage(newPage); await viewModePage.clickCommentsButton(); await viewModePage.addComment(); @@ -416,20 +456,23 @@ mainTest.describe(() => { }); }); - mainTest(qase([706], 'CO-385 Switch to Inspect view'), async () => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; 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 () => { + 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(); @@ -439,6 +482,7 @@ mainTest.describe(() => { const newPage = await viewModePage.clickViewModeShortcut(); viewModePage = new ViewModePage(newPage); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; layersPanelPage = new LayersPanelPage(newPage); const inspectPanelPage = new InspectPanelPage(newPage); await viewModePage.openInspectTab(); @@ -449,7 +493,7 @@ mainTest.describe(() => { 'view-mode-code-tab-image.png'); }); - mainTest(qase([717], 'CO-396 Inspect functionality- Export'), async () => { + mainTest(qase([717], 'CO-396 Inspect functionality- Export'), async ({browserName}) => { await mainPage.createDefaultBoardByCoordinates(300, 300); await designPanelPage.changeHeightAndWidthForLayer('200', '200'); await mainPage.waitForChangeIsSaved(); @@ -459,6 +503,7 @@ mainTest.describe(() => { const newPage = await viewModePage.clickViewModeShortcut(); viewModePage = new ViewModePage(newPage); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; designPanelPage = new DesignPanelPage(newPage); await viewModePage.openInspectTab(); @@ -492,6 +537,7 @@ mainTest.describe(() => { const newPage = await viewModePage.clickViewModeShortcut(); viewModePage = new ViewModePage(newPage); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; layersPanelPage = new LayersPanelPage(newPage); await viewModePage.openInspectTab(); await layersPanelPage.clickLayerOnLayersTab('Rectangle'); @@ -511,13 +557,14 @@ mainTest.describe(() => { 'view-mode-image-selected-image.png'); }); - mainTest(qase([1787], 'CO-389 Copy layout and paste'), async ({ page, browserName }) => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; layersPanelPage = new LayersPanelPage(newPage); await viewModePage.openInspectTab(); await viewModePage.copyWidth(); @@ -536,6 +583,7 @@ mainTest.describe(() => { const newPage = await viewModePage.clickViewModeShortcut(); viewModePage = new ViewModePage(newPage); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; layersPanelPage = new LayersPanelPage(newPage); await viewModePage.clickEditButton(); @@ -556,14 +604,16 @@ mainTest.describe(() => { }); mainTest.describe(() => { - mainTest(qase([693], 'CO-372 Share prototype - get link (2 pages)'), async ({ page }) => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickShareButton(); + browserName === 'webkit' ? await newPage.waitForTimeout(1000) : null; await expect(viewModePage.shareLincDialog).toHaveScreenshot( 'view-mode-share-window-image.png', ); @@ -591,11 +641,12 @@ mainTest.describe(() => { await loginPage.goto(); }); - mainTest(qase([694], 'CO-373 Share prototype - destroy link'), async ({ page }) => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickShareButton(); await viewModePage.clickGetLincButton(); const shareLinc = await viewModePage.clickCopyLincButton(); @@ -614,11 +665,12 @@ mainTest.describe(() => { await loginPage.goto(); }); - mainTest(qase([696], 'CO-375 Share prototype - manage permissions ("Can comment")'), async ({ page }) => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickShareButton(); await viewModePage.clickManagePermissionsButton(); await viewModePage.selectAllUsersCommentPermission(); @@ -648,11 +700,12 @@ mainTest.describe(() => { await profilePage.logout(); }); - mainTest(qase([697], 'CO-376 Share prototype - manage permissions ("Can inspect code ")'), async ({ page }) => { + 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); + browserName === 'webkit' ? await viewModePage.waitForViewerSection(15000) : null; await viewModePage.clickShareButton(); await viewModePage.clickManagePermissionsButton(); await viewModePage.selectAllUsersInspectPermission();