Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set timeout in before all #3007

Merged
merged 4 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/preview-middleware/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { PlaywrightTestConfig } from '@sap-ux-private/playwright';
*/
import 'dotenv/config';

const timeout = 5 * 60000 + 30000;
/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand Down Expand Up @@ -35,8 +34,6 @@ const config: PlaywrightTestConfig = {
use: { ...devices['Desktop Chrome'], channel: 'chrome', viewport: { width: 1720, height: 900 } }
}
],
/* 5 min for npm i + 30000 ms default timeout */
timeout,
globalSetup: require.resolve('./test/integration/utils/global-setup')
};
export default defineConfig(config);
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { Page } from '@sap-ux-private/playwright';
import { writeFile } from 'fs/promises';
import { join } from 'path';
import type { UI5Version } from '@sap-ux/ui5-info';
import { SERVER_TIMEOUT, TIMEOUT } from '../utils/constant';

const buildUrl =
(port = 3000) =>
Expand Down Expand Up @@ -75,7 +76,6 @@ middleware:
path: ../../../dist/ui5/middleware.js
`;
};
const timeout = 50 * 1000;

const getYamlPath = (cwd: string): string => {
return join(cwd, 'ui5.yaml');
Expand All @@ -97,7 +97,7 @@ const prepare = async (ui5Version: string) => {
getUrl = buildUrl(port);
await startServer({
command: `cd ${testCwd} && npx ui5 serve --port ${port}`,
launchTimeout: timeout,
launchTimeout: SERVER_TIMEOUT,
port: port,
host: 'localhost',
protocol: 'http',
Expand All @@ -117,11 +117,15 @@ const UI5Versions = JSON.parse(process.env.UI5Versions ?? '[]') as UI5Version[];

for (const { version } of UI5Versions) {
test.describe(`UI5 version: ${version}`, () => {
test.beforeAll(async () => {
test.setTimeout(TIMEOUT);
await prepare(version);
});

test.afterEach(async () => {
await teardownServer();
});
test('Click on Go button and check an element ', async ({ page }) => {
await prepare(version);
await check({ page });
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const TIMEOUT = 5 * 60000; // 5 min for npm install
export const SERVER_TIMEOUT = 50 * 1000;