Skip to content

Commit 0c041f8

Browse files
committed
Fix tests
1 parent 9432884 commit 0c041f8

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

packages/app/playwright.config.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import { defineConfig, devices } from '@playwright/test';
55
*/
66
export default defineConfig({
77
testDir: './tests/e2e',
8+
/* Global setup to ensure server is ready */
9+
globalSetup: require.resolve('./global-setup.js'),
810
/* Run tests in files in parallel */
911
fullyParallel: true,
1012
/* Fail the build on CI if you accidentally left test.only in the source code. */
1113
forbidOnly: !!process.env.CI,
1214
/* Retry on CI only */
13-
retries: process.env.CI ? 2 : 0,
15+
retries: process.env.CI ? 2 : 1,
1416
/* Use multiple workers on CI for faster execution */
15-
workers: process.env.CI ? 4 : undefined,
17+
workers: undefined,
1618
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
1719
reporter: [
1820
['html'],
@@ -45,8 +47,9 @@ export default defineConfig({
4547
webServer: {
4648
command:
4749
'NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_TELEMETRY_DISABLED=1 yarn run dev',
48-
reuseExistingServer: true,
49-
timeout: 120 * 1000,
50+
port: 8080,
51+
reuseExistingServer: !process.env.CI,
52+
timeout: 180 * 1000,
5053
stdout: 'pipe',
5154
stderr: 'pipe',
5255
},

packages/app/tests/e2e/features/search/search-filters.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test.describe('Search Filters', { tag: ['@search'] }, () => {
1111
const FILTER_CHECKBOX_INFO = '[data-testid="filter-checkbox-info"]';
1212
const FILTER_SEARCH_SEVERITY_TEXT = '[data-testid="filter-search-SeverityText"]';
1313
const FILTER_PIN_INFO = '[data-testid="filter-pin-info"]';
14-
const FILTER_GROUP = '[data-testid="filter-group-"]';
14+
const FILTER_GROUP = '[data-testid^="filter-group-"]';
1515

1616
test('Comprehensive search filters workflow - apply, exclude, clear, and pin filters', async ({ page }) => {
1717
await test.step('Apply error filter from Severity group', async () => {
@@ -102,7 +102,7 @@ test.describe('Search Filters', { tag: ['@search'] }, () => {
102102
});
103103

104104
await test.step('Interact with filter checkbox and verify actions', async () => {
105-
const filterGroups = page.locator('[data-testid^="filter-group-"]');
105+
const filterGroups = page.locator(FILTER_GROUP);
106106
const firstGroup = filterGroups.first();
107107
const filterCheckboxes = firstGroup.locator('[data-testid^="filter-checkbox-"]');
108108
await expect(filterCheckboxes.first()).toBeVisible();

packages/app/tests/e2e/features/traces-workflow.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,21 @@ test.describe('Advanced Search Workflow - Traces', { tag: '@traces' }, () => {
9292
});
9393

9494
await test.step('Verify trace attributes are displayed', async () => {
95-
const traceAttributes = ['TraceId', 'SpanId', 'SpanName', 'Top Level Attributes', 'Span Attributes'];
95+
const traceAttributes = ['TraceId', 'SpanId', 'SpanName'];
9696

9797
for (const attribute of traceAttributes) {
98-
const attributeElement = page.locator(`text=${attribute}`);
98+
const attributeElement = page.locator(`div[class*="HyperJson_key__"]`).filter({ hasText: new RegExp(`^${attribute}$`) });
9999
await expect(attributeElement).toBeVisible();
100100
}
101101

102102
await page.keyboard.press('PageDown');
103103
await page.waitForTimeout(500);
104104

105-
const spanAttributesSection = page.locator('text=Span Attributes, text=SpanAttributes');
105+
// Look for section headers that might not be in HyperJson_key divs
106+
const topLevelAttributesSection = page.locator('text=Top Level Attributes');
107+
await expect(topLevelAttributesSection).toBeVisible();
108+
109+
const spanAttributesSection = page.locator('text=Span Attributes');
106110
await expect(spanAttributesSection).toBeVisible();
107111
});
108112
});

0 commit comments

Comments
 (0)