try fix e2e

This commit is contained in:
Denys Vuika
2023-03-01 09:40:30 +00:00
committed by Sheena Malhotra
parent 31017e82dc
commit 53d6b97421

View File

@@ -39,7 +39,7 @@ export async function checkContextMenu(item: string, expectedContextMenu: string
const actualActions = await contextMenu.getMenuItems(); const actualActions = await contextMenu.getMenuItems();
for (const action of expectedContextMenu) { for (const action of expectedContextMenu) {
expect(actualActions.includes(action)).toBe(true); expect(actualActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await Utils.pressEscape(); await Utils.pressEscape();
@@ -51,7 +51,7 @@ export async function checkToolbarPrimary(item: string, expectedToolbarPrimary:
const actualPrimaryActions = await toolbar.getButtons(); const actualPrimaryActions = await toolbar.getButtons();
for (const action of expectedToolbarPrimary) { for (const action of expectedToolbarPrimary) {
expect(actualPrimaryActions.includes(action)).toBe(true); expect(actualPrimaryActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
} }
@@ -61,7 +61,7 @@ export async function checkToolbarMoreActions(item: string, expectedToolbarMore:
const actualMoreActions = await toolbar.menu.getMenuItems(); const actualMoreActions = await toolbar.menu.getMenuItems();
for (const action of expectedToolbarMore) { for (const action of expectedToolbarMore) {
expect(actualMoreActions.includes(action)).toBe(true); expect(actualMoreActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await toolbar.closeMoreMenu(); await toolbar.closeMoreMenu();
@@ -72,14 +72,14 @@ export async function checkToolbarActions(item: string, expectedToolbarPrimary:
const actualPrimaryActions = await toolbar.getButtons(); const actualPrimaryActions = await toolbar.getButtons();
for (const action of expectedToolbarPrimary) { for (const action of expectedToolbarPrimary) {
expect(actualPrimaryActions.includes(action)).toBe(true); expect(actualPrimaryActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
const actualMoreActions = await toolbar.menu.getMenuItems(); const actualMoreActions = await toolbar.menu.getMenuItems();
for (const action of expectedToolbarMore) { for (const action of expectedToolbarMore) {
expect(actualMoreActions.includes(action)).toBe(true); expect(actualMoreActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await toolbar.closeMoreMenu(); await toolbar.closeMoreMenu();
@@ -92,7 +92,7 @@ export async function checkMultipleSelContextMenu(items: string[], expectedConte
const actualActions = await contextMenu.getMenuItems(); const actualActions = await contextMenu.getMenuItems();
for (const action of expectedContextMenu) { for (const action of expectedContextMenu) {
expect(actualActions.includes(action)).toBe(true); expect(actualActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await Utils.pressEscape(); await Utils.pressEscape();
@@ -104,7 +104,7 @@ export async function checkMultipleSelToolbarPrimary(items: string[], expectedTo
const actualPrimaryActions = await toolbar.getButtons(); const actualPrimaryActions = await toolbar.getButtons();
for (const action of expectedToolbarPrimary) { for (const action of expectedToolbarPrimary) {
expect(actualPrimaryActions.includes(action)).toBe(true); expect(actualPrimaryActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
} }
@@ -117,14 +117,14 @@ export async function checkMultipleSelToolbarActions(
const actualPrimaryActions = await toolbar.getButtons(); const actualPrimaryActions = await toolbar.getButtons();
for (const action of expectedToolbarPrimary) { for (const action of expectedToolbarPrimary) {
expect(actualPrimaryActions.includes(action)).toBe(true); expect(actualPrimaryActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await toolbar.openMoreMenu(); await toolbar.openMoreMenu();
const actualMoreActions = await toolbar.menu.getMenuItems(); const actualMoreActions = await toolbar.menu.getMenuItems();
for (const action of expectedToolbarMore) { for (const action of expectedToolbarMore) {
expect(actualMoreActions.includes(action)).toBe(true); expect(actualMoreActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await toolbar.closeMoreMenu(); await toolbar.closeMoreMenu();
@@ -139,14 +139,14 @@ export async function checkViewerActions(item: string, expectedToolbarPrimary: s
actualPrimaryActions = removeClosePreviousNextOldInfo(actualPrimaryActions); actualPrimaryActions = removeClosePreviousNextOldInfo(actualPrimaryActions);
for (const action of expectedToolbarPrimary) { for (const action of expectedToolbarPrimary) {
expect(actualPrimaryActions.includes(action)).toBe(true); expect(actualPrimaryActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await viewerToolbar.openMoreMenu(); await viewerToolbar.openMoreMenu();
const actualMoreActions = await viewerToolbar.menu.getMenuItems(); const actualMoreActions = await viewerToolbar.menu.getMenuItems();
for (const action of expectedToolbarMore) { for (const action of expectedToolbarMore) {
expect(actualMoreActions.includes(action)).toBe(true); expect(actualMoreActions.includes(action)).toBe(true, `Expected to contain ${action}`);
} }
await Utils.pressEscape(); await Utils.pressEscape();