Skip to content

Commit a0a76e7

Browse files
committed
ci frontend e2e tests fixes
1 parent 6055069 commit a0a76e7

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

.github/actions/setup-ci-compose/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
- name: Install yq
1313
shell: bash
1414
run: |
15-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
15+
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.50.1/yq_linux_amd64
1616
sudo chmod +x /usr/local/bin/yq
1717
1818
- name: Create CI compose configuration
@@ -47,9 +47,8 @@ runs:
4747
yq eval '.services.kafka.depends_on.zookeeper.condition = "service_started"' -i docker-compose.ci.yaml
4848
4949
# Cert-generator CI configuration
50-
yq eval 'select(.services."cert-generator".extra_hosts == null).services."cert-generator".extra_hosts = []' -i docker-compose.ci.yaml
51-
yq eval '.services."cert-generator".extra_hosts += ["host.docker.internal:host-gateway"]' -i docker-compose.ci.yaml
52-
yq eval '.services."cert-generator".environment += ["CI=true"]' -i docker-compose.ci.yaml
50+
yq eval '.services."cert-generator".extra_hosts = ((.services."cert-generator".extra_hosts // []) + ["host.docker.internal:host-gateway"] | unique)' -i docker-compose.ci.yaml
51+
yq eval '.services."cert-generator".environment = ((.services."cert-generator".environment // []) + ["CI=true"] | unique)' -i docker-compose.ci.yaml
5352
yq eval ".services.\"cert-generator\".volumes += [\"${KUBECONFIG_PATH}:/root/.kube/config:ro\"]" -i docker-compose.ci.yaml
5453
5554
echo "Created docker-compose.ci.yaml"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
if: always()
175175
with:
176176
token: ${{ secrets.CODECOV_TOKEN }}
177-
file: backend/coverage.xml
177+
files: backend/coverage.xml
178178
flags: backend
179179
name: backend-coverage
180180
slug: HardMax71/Integr8sCode

frontend/e2e/auth.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test.describe('Authentication', () => {
3131
await page.click('button[type="submit"]');
3232

3333
// Wait for error message to appear
34-
await expect(page.locator('p.text-red-600, p.text-red-400')).toBeVisible({ timeout: 10000 });
34+
await expect(page.locator('p.text-red-600, p.text-red-400')).toBeVisible();
3535
});
3636

3737
test('redirects to editor on successful login', async ({ page }) => {
@@ -43,7 +43,7 @@ test.describe('Authentication', () => {
4343
await page.click('button[type="submit"]');
4444

4545
// Should redirect to editor
46-
await expect(page).toHaveURL(/\/editor/, { timeout: 15000 });
46+
await expect(page).toHaveURL(/\/editor/);
4747
});
4848

4949
test('shows loading state during login', async ({ page }) => {
@@ -65,23 +65,23 @@ test.describe('Authentication', () => {
6565
await page.goto('/editor');
6666

6767
// Should redirect to login
68-
await expect(page).toHaveURL(/\/login/, { timeout: 10000 });
68+
await expect(page).toHaveURL(/\/login/);
6969
});
7070

7171
test('preserves redirect path after login', async ({ page }) => {
7272
// Try to access specific protected route
7373
await page.goto('/settings');
7474

7575
// Should redirect to login
76-
await expect(page).toHaveURL(/\/login/, { timeout: 10000 });
76+
await expect(page).toHaveURL(/\/login/);
7777

7878
// Login
7979
await page.fill('#username', 'user');
8080
await page.fill('#password', 'user123');
8181
await page.click('button[type="submit"]');
8282

8383
// Should redirect back to settings
84-
await expect(page).toHaveURL(/\/settings/, { timeout: 15000 });
84+
await expect(page).toHaveURL(/\/settings/);
8585
});
8686

8787
test('has link to registration page', async ({ page }) => {
@@ -108,7 +108,7 @@ test.describe('Logout', () => {
108108
await page.fill('#username', 'user');
109109
await page.fill('#password', 'user123');
110110
await page.click('button[type="submit"]');
111-
await expect(page).toHaveURL(/\/editor/, { timeout: 15000 });
111+
await expect(page).toHaveURL(/\/editor/);
112112
});
113113

114114
test('can logout from authenticated state', async ({ page }) => {
@@ -118,7 +118,7 @@ test.describe('Logout', () => {
118118
if (await logoutButton.isVisible()) {
119119
await logoutButton.click();
120120
// Should redirect to login
121-
await expect(page).toHaveURL(/\/login/, { timeout: 10000 });
121+
await expect(page).toHaveURL(/\/login/);
122122
}
123123
});
124124
});

frontend/playwright.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export default defineConfig({
44
testDir: './e2e',
55
fullyParallel: true,
66
forbidOnly: !!process.env.CI,
7-
retries: process.env.CI ? 2 : 0,
8-
workers: process.env.CI ? 1 : undefined,
9-
timeout: process.env.CI ? 60000 : 30000,
7+
retries: process.env.CI ? 1 : 0, // Reduced: 1 retry is enough to catch flakes
8+
workers: process.env.CI ? 2 : undefined, // Increased: tests are independent
9+
timeout: 30000, // 30s is plenty for page operations
1010
expect: {
11-
timeout: process.env.CI ? 10000 : 5000,
11+
timeout: 5000, // 5s for element expectations
1212
},
13-
reporter: 'html',
13+
reporter: process.env.CI ? [['html'], ['github']] : 'html',
1414
use: {
1515
baseURL: 'https://localhost:5001',
1616
ignoreHTTPSErrors: true,

0 commit comments

Comments
 (0)