Skip to content

Commit b77dcaa

Browse files
committed
fix: add missing E2E global-setup and global-teardown files
- Created tests/e2e/global-setup.ts referenced by playwright.config.ts - Created tests/e2e/global-teardown.ts referenced by playwright.config.ts - Fixes E2E CI job MODULE_NOT_FOUND error
1 parent f3d5983 commit b77dcaa

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to NEXT Portal will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
66
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.15] - 2026-01-02
9+
10+
### Added
11+
12+
- Created missing global-setup.ts and global-teardown.ts for Playwright E2E tests
13+
- E2E tests now have proper setup/teardown hooks referenced in playwright.config.ts
14+
15+
### Fixed
16+
17+
- E2E CI job failing due to missing required module './tests/e2e/global-setup.ts'
18+
819
## [1.1.14] - 2026-01-02
920

1021
### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.14
1+
1.1.15

tests/e2e/global-setup.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Global Setup for Playwright E2E Tests
3+
* Runs once before all test files
4+
*/
5+
6+
import { FullConfig } from '@playwright/test';
7+
8+
async function globalSetup(config: FullConfig): Promise<void> {
9+
// Environment validation
10+
const baseURL = config.projects[0]?.use?.baseURL || process.env.PLAYWRIGHT_BASE_URL;
11+
12+
if (process.env.CI) {
13+
console.log('[E2E Setup] Running in CI environment');
14+
console.log(`[E2E Setup] Target URL: ${baseURL}`);
15+
}
16+
17+
// Database setup could be added here for CI
18+
// await setupTestDatabase();
19+
20+
// Seed test data could be added here
21+
// await seedTestUsers();
22+
23+
console.log('[E2E Setup] Global setup complete');
24+
}
25+
26+
export default globalSetup;

tests/e2e/global-teardown.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Global Teardown for Playwright E2E Tests
3+
* Runs once after all test files
4+
*/
5+
6+
import { FullConfig } from '@playwright/test';
7+
8+
async function globalTeardown(config: FullConfig): Promise<void> {
9+
if (process.env.CI) {
10+
console.log('[E2E Teardown] Running in CI environment');
11+
}
12+
13+
// Cleanup test data could be added here
14+
// await cleanupTestData();
15+
16+
// Database cleanup could be added here
17+
// await teardownTestDatabase();
18+
19+
console.log('[E2E Teardown] Global teardown complete');
20+
}
21+
22+
export default globalTeardown;

0 commit comments

Comments
 (0)