From 50b173a94d337fe7021570abc1d6d21a5c5be623 Mon Sep 17 00:00:00 2001 From: Steve Churchill Date: Wed, 4 Feb 2026 09:59:30 +0000 Subject: [PATCH] Use path.resolve for test download paths Import path and replace hardcoded relative file path strings with path.resolve in anomalies-, expenses- and resources-tests to create platform-independent paths for downloaded PNG/PDF comparisons. Commented-out CI test.fixme lines and removed minor trailing whitespace. This improves cross-OS reliability for file comparisons in the e2e tests. --- e2etests/tests/anomalies-tests.spec.ts | 61 ++++++++++---------- e2etests/tests/expenses-tests.spec.ts | 23 ++++---- e2etests/tests/resources-tests.spec.ts | 79 +++++++++++++------------- 3 files changed, 81 insertions(+), 82 deletions(-) diff --git a/e2etests/tests/anomalies-tests.spec.ts b/e2etests/tests/anomalies-tests.spec.ts index 62541a459..2ad77a205 100644 --- a/e2etests/tests/anomalies-tests.spec.ts +++ b/e2etests/tests/anomalies-tests.spec.ts @@ -18,6 +18,7 @@ import { debugLog } from '../utils/debug-logging'; import { deleteAnomalyPolicy } from '../utils/teardown-utils'; import { expect, request } from '@playwright/test'; import { test } from '../fixtures/page.fixture'; +import path from 'path'; test.describe('[MPT-14737] Anomalies Tests', { tag: ['@ui', '@anomalies'] }, () => { test.use({ restoreSession: true }); @@ -279,10 +280,10 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] }); test('[231435] Verify Chart export for each category by comparing downloaded png', async ({ anomaliesPage }) => { - test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); - let actualPath = 'tests/downloads/anomaly-expenses-region-daily-chart-export.png'; - let expectedPath = 'tests/expected/expected-anomaly-expenses-region-daily-chart-export.png'; - let diffPath = 'tests/downloads/diff-anomaly-expenses-region-daily-chart-export.png'; + // test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); + let actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-region-daily-chart-export.png'); + let expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-region-daily-chart-export.png'); + let diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-region-daily-chart-export.png'); let match: boolean; await anomaliesPage.page.clock.setFixedTime(new Date('2025-11-13T12:45:00Z')); @@ -300,9 +301,9 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] }); await test.step('Category: Resource type', async () => { - actualPath = 'tests/downloads/anomaly-expenses-resource-type-daily-chart-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-resource-type-daily-chart-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-resource-type-daily-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-resource-type-daily-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-resource-type-daily-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-resource-type-daily-chart-export.png'); await anomaliesPage.selectCategorizeBy('Resource type'); await anomaliesPage.downloadFile(anomaliesPage.exportChartBtn, actualPath); @@ -311,9 +312,9 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] }); await test.step('Category: Data source', async () => { - actualPath = 'tests/downloads/anomaly-expenses-data-source-daily-chart-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-data-source-daily-chart-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-data-source-daily-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-data-source-daily-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-data-source-daily-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-data-source-daily-chart-export.png'); await anomaliesPage.selectCategorizeBy('Data source'); await anomaliesPage.downloadFile(anomaliesPage.exportChartBtn, actualPath); @@ -322,9 +323,9 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] }); await test.step('Category: Owner', async () => { - actualPath = 'tests/downloads/anomaly-expenses-owner-daily-chart-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-owner-daily-chart-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-owner-daily-chart-export.png'; + actualPath = path.resolve('tests', 'downloads/anomaly-expenses-owner-daily-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-owner-daily-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-owner-daily-chart-export.png'); await anomaliesPage.selectCategorizeBy('Owner'); await anomaliesPage.downloadFile(anomaliesPage.exportChartBtn, actualPath); @@ -333,9 +334,9 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] }); await test.step('Category: Pool', async () => { - actualPath = 'tests/downloads/anomaly-expenses-pool-daily-chart-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-pool-daily-chart-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-pool-daily-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-pool-daily-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-pool-daily-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-pool-daily-chart-export.png'); await anomaliesPage.selectCategorizeBy('Pool'); await anomaliesPage.downloadFile(anomaliesPage.exportChartBtn, actualPath); @@ -345,10 +346,10 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] }); test('[231436] Verify Chart export for each expenses option by comparing downloaded png', async ({ anomaliesPage }) => { - test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); - let actualPath = 'tests/downloads/anomaly-expenses-service-daily-chart-export.png'; - let expectedPath = 'tests/expected/expected-anomaly-expenses-service-daily-chart-export.png'; - let diffPath = 'tests/downloads/diff-anomaly-expenses-service-daily-chart-export.png'; + // test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); + let actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-service-daily-chart-export.png'); + let expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-service-daily-chart-export.png'); + let diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-service-daily-chart-export.png'); let match: boolean; await anomaliesPage.page.clock.setFixedTime(new Date('2025-11-11T14:11:00Z')); @@ -361,18 +362,18 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] match = await comparePngImages(expectedPath, actualPath, diffPath); expect.soft(match).toBe(true); - actualPath = 'tests/downloads/anomaly-expenses-service-daily-chart-no-legend-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-service-daily-chart-no-legend-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-service-daily-chart-no-legend-export.png'; + actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-service-daily-chart-no-legend-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-service-daily-chart-no-legend-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-service-daily-chart-no-legend-export.png'); await anomaliesPage.clickShowLegend(); await anomaliesPage.downloadFile(anomaliesPage.exportChartBtn, actualPath); match = await comparePngImages(expectedPath, actualPath, diffPath); expect.soft(match).toBe(true); - actualPath = 'tests/downloads/anomaly-expenses-service-weekly-chart-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-service-weekly-chart-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-service-weekly-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-service-weekly-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-service-weekly-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-service-weekly-chart-export.png'); await anomaliesPage.clickShowLegend(); await anomaliesPage.selectExpenses('Weekly'); @@ -380,16 +381,15 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] match = await comparePngImages(expectedPath, actualPath, diffPath); expect.soft(match).toBe(true); - actualPath = 'tests/downloads/anomaly-expenses-service-monthly-chart-export.png'; - expectedPath = 'tests/expected/expected-anomaly-expenses-service-monthly-chart-export.png'; - diffPath = 'tests/downloads/diff-anomaly-expenses-service-monthly-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'anomaly-expenses-service-monthly-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-anomaly-expenses-service-monthly-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-anomaly-expenses-service-monthly-chart-export.png'); await anomaliesPage.selectExpenses('Monthly'); await anomaliesPage.downloadFile(anomaliesPage.exportChartBtn, actualPath); match = await comparePngImages(expectedPath, actualPath, diffPath); expect.soft(match).toBe(true); }); - test('[231439] Verify detected anomalies are displayed in the table correctly', async ({ anomaliesPage }) => { await anomaliesPage.page.clock.setFixedTime(new Date('2025-11-11T14:11:00Z')); await anomaliesPage.navigateToURL(); @@ -421,4 +421,3 @@ test.describe('[MPT-14737] Mocked Anomalies Tests', { tag: ['@ui', '@anomalies'] await expect(resourcesPage.heading).toBeVisible(); }); }); - diff --git a/e2etests/tests/expenses-tests.spec.ts b/e2etests/tests/expenses-tests.spec.ts index 7bae87425..52de8c735 100644 --- a/e2etests/tests/expenses-tests.spec.ts +++ b/e2etests/tests/expenses-tests.spec.ts @@ -14,6 +14,7 @@ import { ExpensesDefaultResponse } from '../mocks/expenses-page-mocks'; import { comparePdfFiles } from '../utils/pdf-comparison'; import { isWithinRoundingDrift } from '../utils/custom-assertions'; import { getEnvironmentTestOrgName } from '../utils/environment-util'; +import path from 'path'; test.describe('[MPT-12859] Expenses Page default view Tests', { tag: ['@ui', '@expenses'] }, () => { test.describe.configure({ mode: 'default' }); @@ -94,7 +95,7 @@ test.describe('[MPT-12859] Expenses Page default view Tests', { tag: ['@ui', '@e }); test.describe('[MPT-12859] Expenses page default view mocked tests', { tag: ['@ui', '@expenses'] }, () => { - test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); + // test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); test.describe.configure({ mode: 'default' }); const apiInterceptions: InterceptionEntry[] = [ @@ -118,11 +119,10 @@ test.describe('[MPT-12859] Expenses page default view mocked tests', { tag: ['@u await expensesPage.clickDailyBtnIfNotSelected(); }); }); - test('[231183] Verify expenses chart download', { tag: '@p1' }, async ({ expensesPage }) => { - let actualPath = 'tests/downloads/expenses-page-daily-chart.pdf'; - let expectedPath = 'tests/expected/expected-expenses-page-daily-chart.pdf'; - let diffPath = 'tests/downloads/expenses-page-daily-chart-diff.png'; + let actualPath = path.resolve('tests', 'downloads', 'expenses-page-daily-chart.pdf'); + let expectedPath = path.resolve('tests', 'expected', 'expected-expenses-page-daily-chart.pdf'); + let diffPath = path.resolve('tests', 'downloads', 'expenses-page-daily-chart-diff.png'); let match: boolean; await test.step('Download the default chart', async () => { @@ -132,9 +132,9 @@ test.describe('[MPT-12859] Expenses page default view mocked tests', { tag: ['@u }); await test.step('Download weekly chart and compare', async () => { - actualPath = 'tests/downloads/expenses-page-weekly-chart.pdf'; - expectedPath = 'tests/expected/expected-expenses-page-weekly-chart.pdf'; - diffPath = 'tests/downloads/expenses-page-weekly-chart-diff.png'; + actualPath = path.resolve('tests', 'downloads', 'expenses-page-weekly-chart.pdf'); + expectedPath = path.resolve('tests', 'expected', 'expected-expenses-page-weekly-chart.pdf'); + diffPath = path.resolve('tests', 'downloads', 'expenses-page-weekly-chart-diff.png'); await expensesPage.clickWeeklyBtn(); await expensesPage.downloadFile(expensesPage.downloadButton, actualPath); @@ -143,9 +143,9 @@ test.describe('[MPT-12859] Expenses page default view mocked tests', { tag: ['@u }); await test.step('Download monthly chart and compare', async () => { - actualPath = 'tests/downloads/expenses-page-monthly-chart.pdf'; - expectedPath = 'tests/expected/expected-expenses-page-monthly-chart.pdf'; - diffPath = 'tests/downloads/expenses-page-monthly-chart-diff.png'; + actualPath = path.resolve('tests', 'downloads', 'expenses-page-monthly-chart.pdf'); + expectedPath = path.resolve('tests', 'expected', 'expected-expenses-page-monthly-chart.pdf'); + diffPath = path.resolve('tests', 'downloads', 'expenses-page-monthly-chart-diff.png'); await expensesPage.clickMonthlyBtn(); await expensesPage.downloadFile(expensesPage.downloadButton, actualPath); @@ -154,7 +154,6 @@ test.describe('[MPT-12859] Expenses page default view mocked tests', { tag: ['@u }); }); }); - test.describe('[MPT-12859] Expenses Page Source Breakdown Tests', { tag: ['@ui', '@expenses'] }, () => { test.describe.configure({ mode: 'default' }); test.use({ restoreSession: true }); diff --git a/e2etests/tests/resources-tests.spec.ts b/e2etests/tests/resources-tests.spec.ts index 8509bbc35..987060d74 100644 --- a/e2etests/tests/resources-tests.spec.ts +++ b/e2etests/tests/resources-tests.spec.ts @@ -35,6 +35,7 @@ import { import { fetchBreakdownExpenses } from '../utils/api-helpers'; import { InterceptionEntry } from '../types/interceptor.types'; import { debugLog } from '../utils/debug-logging'; +import path from 'path'; test.describe('[MPT-11957] Resources page tests', { tag: ['@ui', '@resources'] }, () => { test.describe.configure({ mode: 'default' }); @@ -751,10 +752,10 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour }); test('[230784] Verify default service daily expenses chart export with and without legend', { tag: '@p1' }, async ({ resourcesPage }) => { - test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); - let actualPath = 'tests/downloads/expenses-chart-export.png'; - let expectedPath = 'tests/expected/expected-expenses-chart-export.png'; - let diffPath = 'tests/downloads/diff-expenses-chart-export.png'; + // test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); + let actualPath = path.resolve('tests', 'downloads', 'expenses-chart-export.png'); + let expectedPath = path.resolve('tests', 'expected', 'expected-expenses-chart-export.png'); + let diffPath = path.resolve('tests', 'downloads', 'diff-expenses-chart-export.png'); let match: boolean; await test.step('Verify the default chart is Service Daily Expenses with legend displayed', async () => { @@ -769,9 +770,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/expenses-chart-export-without-legend.png'; - expectedPath = 'tests/expected/expected-expenses-chart-export-without-legend.png'; - diffPath = 'tests/downloads/diff-expenses-chart-export-without-legend.png'; + actualPath = path.resolve('tests', 'downloads', 'expenses-chart-export-without-legend.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-expenses-chart-export-without-legend.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-expenses-chart-export-without-legend.png'); await test.step('Toggle Show Legend and verify the chart without legend', async () => { await resourcesPage.clickShowLegend(); @@ -782,10 +783,10 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour }); test('[230785] Verify weekly and monthly expenses chart export', async ({ resourcesPage }) => { - test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); - let actualPath = 'tests/downloads/weekly-expenses-chart-export.png'; - let expectedPath = 'tests/expected/expected-weekly-expenses-chart-export.png'; - let diffPath = 'tests/downloads/diff-weekly-expenses-chart-export.png'; + // test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); + let actualPath = path.resolve('tests', 'downloads', 'weekly-expenses-chart-export.png'); + let expectedPath = path.resolve('tests', 'expected', 'expected-weekly-expenses-chart-export.png'); + let diffPath = path.resolve('tests', 'downloads', 'diff-weekly-expenses-chart-export.png'); let match: boolean; await test.step('Change expenses to Weekly and verify the chart', async () => { @@ -795,9 +796,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/monthly-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-monthly-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-monthly-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'monthly-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-monthly-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-monthly-expenses-chart-export.png'); await test.step('Change expenses to Monthly and verify the chart', async () => { await resourcesPage.selectExpenses('Monthly'); @@ -808,10 +809,10 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour }); test('[230786] Verify expenses chart export with different categories', async ({ resourcesPage }) => { - test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); - let actualPath = 'tests/downloads/region-expenses-chart-export.png'; - let expectedPath = 'tests/expected/expected-region-expenses-chart-export.png'; - let diffPath = 'tests/downloads/diff-region-expenses-chart-export.png'; + // test.fixme(process.env.CI === '1', 'Tests do not work in CI. It appears that the png comparison is unsupported on linux'); + let actualPath = path.resolve('tests', 'downloads', 'region-expenses-chart-export.png'); + let expectedPath = path.resolve('tests', 'expected', 'expected-region-expenses-chart-export.png'); + let diffPath = path.resolve('tests', 'downloads', 'diff-region-expenses-chart-export.png'); let match: boolean; await test.step('Change categorization to Region and verify the chart', async () => { @@ -821,9 +822,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/resource-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-resource-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-resource-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'resource-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-resource-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-resource-expenses-chart-export.png'); await test.step('Change categorization to Resource Type and verify the chart', async () => { await resourcesPage.selectCategorizeBy('Resource type'); @@ -832,9 +833,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/data-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-data-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-data-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'data-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-data-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-data-expenses-chart-export.png'); await test.step('Change categorization to Data source and verify the chart', async () => { await resourcesPage.selectCategorizeBy('Data source'); @@ -843,9 +844,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/owner-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-owner-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-owner-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'owner-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-owner-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-owner-expenses-chart-export.png'); await test.step('Change categorization to Owner and verify the chart', async () => { await resourcesPage.selectCategorizeBy('Owner'); @@ -854,9 +855,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/pool-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-pool-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-pool-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'pool-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-pool-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-pool-expenses-chart-export.png'); await test.step('Change categorization to Pool and verify the chart', async () => { await resourcesPage.selectCategorizeBy('Pool'); @@ -865,9 +866,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/k8node-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-k8node-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-k8node-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'k8node-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-k8node-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-k8node-expenses-chart-export.png'); await test.step('Change categorization to K8s node and verify the chart', async () => { await resourcesPage.selectCategorizeBy('K8s node'); @@ -876,9 +877,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/k8sservice-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-k8sservice-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-k8sservice-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'k8sservice-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-k8sservice-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-k8sservice-expenses-chart-export.png'); await test.step('Change categorization to K8s service and verify the chart', async () => { await resourcesPage.selectCategorizeBy('K8s service'); @@ -887,9 +888,9 @@ test.describe('[MPT-11957] Resources page mocked tests', { tag: ['@ui', '@resour expect.soft(match).toBe(true); }); - actualPath = 'tests/downloads/k8snamespace-expenses-chart-export.png'; - expectedPath = 'tests/expected/expected-k8snamespace-expenses-chart-export.png'; - diffPath = 'tests/downloads/diff-k8snamespace-expenses-chart-export.png'; + actualPath = path.resolve('tests', 'downloads', 'k8snamespace-expenses-chart-export.png'); + expectedPath = path.resolve('tests', 'expected', 'expected-k8snamespace-expenses-chart-export.png'); + diffPath = path.resolve('tests', 'downloads', 'diff-k8snamespace-expenses-chart-export.png'); await test.step('Change categorization to K8s namespace and verify the chart', async () => { await resourcesPage.selectCategorizeBy('K8s namespace');