Skip to content

Commit

Permalink
chore: extend the timeout of e2e local assertion because of the poor …
Browse files Browse the repository at this point in the history
…condition of local api.
  • Loading branch information
mrcuriosity-tw committed Mar 11, 2024
1 parent 864db42 commit 4f93e87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion frontend/e2e/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export const E2E_PROJECT_NAME = 'E2EProjectName';

export const CONFIG_STEP_SAVING_FILENAME = 'config-step.json';
export const METRICS_STEP_SAVING_FILENAME = 'metrics-step.json';
export const E2E_EXPECT_TIMEOUT = 30 * 1000;
export const E2E_EXPECT_LOCAL_TIMEOUT = 30 * 1000;
export const E2E_EXPECT_CI_TIMEOUT = 30 * 3 * 1000;
4 changes: 2 additions & 2 deletions frontend/e2e/pages/metrics/ReportStep.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { checkDownloadReport, downloadFileAndCheck } from 'e2e/utils/download';
import { expect, Locator, Page } from '@playwright/test';

import { E2E_EXPECT_TIMEOUT } from '../../fixtures';
import { E2E_EXPECT_CI_TIMEOUT } from '../../fixtures';
import { parse } from 'csv-parse/sync';
import path from 'path';
import fs from 'fs';
Expand Down Expand Up @@ -116,7 +116,7 @@ export class ReportStep {
}

async confirmGeneratedReport() {
await expect(this.page.getByRole('alert')).toContainText('Help Information', { timeout: E2E_EXPECT_TIMEOUT * 3 });
await expect(this.page.getByRole('alert')).toContainText('Help Information', { timeout: E2E_EXPECT_CI_TIMEOUT });
await expect(this.page.getByRole('alert')).toContainText(
'The file will expire in 30 minutes, please download it in time.',
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { E2E_EXPECT_TIMEOUT, VIEWPORT_DEFAULT } from 'e2e/fixtures';
import { E2E_EXPECT_LOCAL_TIMEOUT, E2E_EXPECT_CI_TIMEOUT, VIEWPORT_DEFAULT } from 'e2e/fixtures';
import { defineConfig, devices } from '@playwright/test';

/**
Expand All @@ -17,7 +17,7 @@ export default defineConfig({
timeout: 3 * 60 * 1000,
testDir: './e2e',
expect: {
timeout: E2E_EXPECT_TIMEOUT,
timeout: process.env.CI ? E2E_EXPECT_CI_TIMEOUT : E2E_EXPECT_LOCAL_TIMEOUT,
},
/* Run tests in files in parallel */
fullyParallel: true,
Expand Down

0 comments on commit 4f93e87

Please sign in to comment.