From a2708e3027abff9773e1578945f56a731798f4bf Mon Sep 17 00:00:00 2001 From: KateMaruk Date: Mon, 27 Nov 2023 10:15:09 +0200 Subject: [PATCH] update tests for running in parallel --- pages/workspace/main-page.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pages/workspace/main-page.js b/pages/workspace/main-page.js index 85460fac..5db9f017 100644 --- a/pages/workspace/main-page.js +++ b/pages/workspace/main-page.js @@ -1,5 +1,6 @@ const { expect } = require("@playwright/test"); const { BasePage } = require("../base-page"); +const { getPlatformName } = require("../../helpers/string-generator"); exports.MainPage = class MainPage extends BasePage { /** @@ -1520,26 +1521,41 @@ exports.MainPage = class MainPage extends BasePage { } async pressHideShowRulersShortcut(browserName) { - if (browserName === 'webkit') { + const os = getPlatformName(); + if (os === 'MacOS') { await this.page.keyboard.press("Meta+Shift+R"); } else { - await this.page.keyboard.press("Control+Shift+R"); + if (browserName === 'webkit') { + await this.page.keyboard.press("Meta+Shift+R"); + } else { + await this.page.keyboard.press("Control+Shift+R"); + } } } async pressHideShowGridsShortcut(browserName) { - if (browserName === 'webkit') { + const os = getPlatformName(); + if (os === "MacOS") { await this.page.keyboard.press("Meta+'"); } else { - await this.page.keyboard.press("Control+'"); + if (browserName === 'webkit') { + await this.page.keyboard.press("Meta+'"); + } else { + await this.page.keyboard.press("Control+'"); + } } } async pressSelectAllShortcut(browserName) { - if (browserName === 'webkit') { + const os = getPlatformName(); + if (os === "MacOS") { await this.page.keyboard.press("Meta+A"); } else { - await this.page.keyboard.press("Control+A"); + if (browserName === 'webkit') { + await this.page.keyboard.press("Meta+A"); + } else { + await this.page.keyboard.press("Control+A"); + } } }