Skip to content

Commit 38ff941

Browse files
committed
wip
1 parent cfcdae5 commit 38ff941

6 files changed

Lines changed: 110 additions & 6 deletions

File tree

dashboard/e2e/selectors/common.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const COMMON_SELECTORS = {
2+
tableRow: 'tr',
3+
tableHeader: 'th',
4+
5+
originDropdown: '[data-test-id="origin-dropdown"]',
6+
originOption: (origin: string) => `[data-test-id="origin-option-${origin}"]`,
7+
} as const;

dashboard/e2e/selectors/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './common';
2+
export * from './tree-listing';
3+
export * from './tree-details';
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
export const TREE_DETAILS_SELECTORS = {
2+
breadcrumbTreesLink: '[data-test-id="breadcrumb-trees-link"]',
3+
4+
treeHeaderTable: 'table',
5+
6+
tabs: {
7+
builds: 'button:has-text("Builds")',
8+
boots: 'button:has-text("Boots")',
9+
tests: 'button:has-text("Tests")',
10+
},
11+
12+
filters: {
13+
button: 'button:has-text("Filters")',
14+
drawer: 'aside',
15+
filterButton: '[data-test-id="filter-button"]',
16+
cancelButton: '[data-test-id="filter-cancel-button"]',
17+
clearAllFilters: 'text="Clear all"',
18+
},
19+
20+
buildHistoryGraph: 'img',
21+
22+
statusCard: {
23+
title: '.flex-col:has(div:has-text("Build status"))',
24+
titleFirst: '.flex-col:has(div:has-text("Build status"))',
25+
statusButton: (status: string) => `[data-test-id="${status}"]`,
26+
},
27+
28+
summaryCards: {
29+
arch: 'text="Summary"',
30+
},
31+
32+
issuesCard: {
33+
title: 'text="Issues"',
34+
button: 'button[aria-label="Issues"]',
35+
},
36+
37+
buildTable: {
38+
table: 'table',
39+
statusFilters: {
40+
all: 'button:has-text("All:")',
41+
success: 'button:has-text("Success:")',
42+
failed: 'button:has-text("Failed:")',
43+
inconclusive: 'button:has-text("Inconclusive:")',
44+
},
45+
searchInput: 'input[placeholder*="Search"]',
46+
detailsButton: '[data-test-id="details-button"]',
47+
},
48+
49+
bootsTable: {
50+
statusFilters: {
51+
all: 'button:has-text("All:")',
52+
success: 'button:has-text("Success:")',
53+
failed: 'button:has-text("Failed:")',
54+
inconclusive: 'button:has-text("Inconclusive:")',
55+
},
56+
detailsButton: '[data-test-id="details-button"]',
57+
},
58+
59+
testsTable: {
60+
statusFilters: {
61+
all: 'button:has-text("All:")',
62+
success: 'button:has-text("Success:")',
63+
failed: 'button:has-text("Failed:")',
64+
inconclusive: 'button:has-text("Inconclusive:")',
65+
},
66+
testItem: 'tr',
67+
detailsButton: '[data-test-id="details-button"]',
68+
},
69+
70+
configTable: {
71+
link: (config: string) => `a:has-text("${config}")`,
72+
},
73+
} as const;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const TREE_LISTING_SELECTORS = {
2+
table: 'table',
3+
treeColumnHeader: 'th button:has-text("Tree")',
4+
branchColumnHeader: 'th button:has-text("Branch")',
5+
6+
intervalInput: 'input[type="number"][min="1"]',
7+
8+
itemsPerPageDropdown: '[role="listbox"]',
9+
itemsPerPageOption: (value: string) => `[role="option"]:has-text("${value}")`,
10+
11+
searchInput: 'input[type="text"]',
12+
13+
nextPageButton: '[role="button"]:has-text(">")',
14+
previousPageButton: '[role="button"]:has-text("<")',
15+
16+
treeNameCell: (treeName: string) => `td a:has-text("${treeName}")`,
17+
firstTreeCell: 'td a',
18+
19+
breadcrumbTreesLink: '[data-test-id="breadcrumb-link"]:has-text("Trees")',
20+
} as const;

dashboard/e2e/tree-details.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { test, expect } from '@playwright/test';
22

3-
import {
4-
TREE_DETAILS_SELECTORS,
5-
TREE_LISTING_SELECTORS,
6-
} from './e2e-selectors';
3+
import { TREE_DETAILS_SELECTORS, TREE_LISTING_SELECTORS } from './selectors';
74

85
test.describe('Tree Details Page Tests', () => {
96
test.beforeEach(async ({ page }) => {

dashboard/e2e/tree-listing.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { test, expect } from '@playwright/test';
22

3-
import { TREE_LISTING_SELECTORS, COMMON_SELECTORS } from './e2e-selectors';
3+
import {
4+
TREE_LISTING_SELECTORS,
5+
COMMON_SELECTORS,
6+
TREE_DETAILS_SELECTORS,
7+
} from './selectors';
48

59
const PAGE_LOAD_TIMEOUT = 5000;
610
const DEFAULT_ACTION_TIMEOUT = 1000;
@@ -88,7 +92,7 @@ test.describe('Tree Listing Page Tests', () => {
8892
expect(url).toMatch(/\/tree\/[^/]+\/[^/]+\/[^/]+$/);
8993

9094
const breadcrumbLink = page.locator(
91-
TREE_LISTING_SELECTORS.breadcrumbTreesLink,
95+
TREE_DETAILS_SELECTORS.breadcrumbTreesLink,
9296
);
9397
await expect(breadcrumbLink).toBeVisible({ timeout: 15000 });
9498
await breadcrumbLink.click();

0 commit comments

Comments
 (0)