Skip to content

Commit 5967274

Browse files
committed
Try removing the get by role.
1 parent 2e21fb7 commit 5967274

File tree

7 files changed

+15
-18
lines changed

7 files changed

+15
-18
lines changed

src/packages/admin-ui-components/src/combo-box/component.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const ComboBox = ({
112112

113113
return (
114114
<div className={styles.select} data-testid={testId}>
115-
<div className={clsx(styles.selectBox, isOpen && styles.open)}>
115+
<div className={clsx(styles.selectBox, isOpen && styles.open)} data-testid={`${testId}-box`}>
116116
<div className={styles.inputContainer}>
117117
{valueArray.length > 0 && (
118118
<div className={styles.selectedOptions}>
@@ -134,6 +134,7 @@ export const ComboBox = ({
134134
<input
135135
readOnly={!allowFreeTyping}
136136
className={styles.selectInput}
137+
data-testid={`${testId}-input`}
137138
{...getInputProps({
138139
ref: inputRef,
139140
onBlur: handleBlur,

src/packages/end-to-end/src/__tests__/ui/postgres/enum-editor.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('Detail Panel - should allow editing of an entity with an enum dropdown', a
88
await page.getByRole('cell', { name: '1', exact: true }).click();
99

1010
// This invoice starts in 'UNPAID' status, so let's change that.
11-
await page.getByTestId('detail-panel-field-paymentStatus').getByRole('combobox').click();
11+
await page.getByTestId('detail-panel-field-paymentStatus').click();
1212
await page.getByTestId('combo-option-PAID').click();
1313

1414
// We should have 'PAID' selected now.

src/packages/end-to-end/src/__tests__/ui/rest/basic-functionality.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test('Ensure vehicles can be listed and that they have pilots', async ({ page })
3232
test('Ensure people can be filtered', async ({ page }) => {
3333
await page.goto(config.adminUiUrl);
3434
await page.getByTestId('Person-entity-link').click();
35-
await page.getByTestId('url-filter').getByRole('combobox').click();
35+
await page.getByTestId('url-filter').click();
3636
await page.getByTestId('combo-option-4').click();
3737
await page.waitForURL((url) => url.toString().includes('filters=eyJ1cmxfaW4iOlsiNCJdfQ%3D%3D'));
3838
await page.getByTestId('spinner').waitFor({ state: 'hidden' });
@@ -43,7 +43,7 @@ test('Ensure people can be filtered', async ({ page }) => {
4343
await page.getByTestId('table').locator('tbody').locator('tr').nth(0).textContent()
4444
).toBe('4Darth Vader202136none41.9BBY');
4545

46-
await page.getByTestId('url-filter').getByRole('combobox').click();
46+
await page.getByTestId('url-filter').click();
4747
await page.getByTestId('combo-option-2').click();
4848
await page.waitForURL((url) => url.toString().includes('filters=eyJ1cmxfaW4iOlsiNCIsIjIiXX0%3D'));
4949
await page.getByTestId('spinner').waitFor({ state: 'hidden' });
@@ -67,7 +67,7 @@ test('Ensure people can be filtered', async ({ page }) => {
6767
test('Ensure vehicles can be filtered', async ({ page }) => {
6868
await page.goto(config.adminUiUrl);
6969
await page.getByTestId('Vehicle-entity-link').click();
70-
await page.getByTestId('url-filter').getByRole('combobox').click();
70+
await page.getByTestId('url-filter').click();
7171
await page.getByTestId('combo-option-4').click();
7272
await page.waitForURL((url) => url.toString().includes('filters=eyJ1cmxfaW4iOlsiNCJdfQ%3D%3D'));
7373
await page.getByTestId('spinner').waitFor({ state: 'hidden' });
@@ -78,7 +78,7 @@ test('Ensure vehicles can be filtered', async ({ page }) => {
7878
await page.getByTestId('table').locator('tbody').locator('tr').nth(0).textContent()
7979
).toBe('4Sand CrawlerDigger CrawlerCorellia Mining Corporation15000036.8 4630');
8080

81-
await page.getByTestId('url-filter').getByRole('combobox').click();
81+
await page.getByTestId('url-filter').click();
8282
await page.getByTestId('combo-option-14').click();
8383
await page.waitForURL((url) => url.toString().includes('filters=eyJ1cmxfaW4iOlsiNCIsIjE0Il19'));
8484
await page.getByTestId('spinner').waitFor({ state: 'hidden' });

src/packages/end-to-end/src/__tests__/ui/sqlite/components/selectbox.test.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ test('Check Select field shows correct number of selected items after adding add
2121
await page
2222
.locator('div')
2323
.filter({ hasText: /^tracks\*3 Selected×$/ })
24-
.getByRole('combobox')
2524
.click({ delay: 1000 });
2625
await page.getByRole('listbox').getByText('"40"').click();
2726
await expect(page.locator('form')).toContainText('4 Selected');
@@ -36,7 +35,6 @@ test('Check adding additional item to OneToMany field and saving functions as ex
3635
await page
3736
.locator('div')
3837
.filter({ hasText: /^tracks\*10 Selected×$/ })
39-
.getByRole('combobox')
4038
.click({ delay: 1000 });
4139
await page.getByText('"40"').click();
4240
await expect(page.locator('form')).toContainText('11 Selected');
@@ -52,10 +50,10 @@ test('Should allow navigation around using a keyboard', async ({ page }) => {
5250
await page.goto(config.adminUiUrl);
5351
await page.getByRole('link', { name: 'Employee' }).click();
5452

55-
await page.getByRole('combobox').nth(0).click();
56-
await page.getByRole('combobox').nth(0).press('ArrowDown', { delay: 300 });
57-
await page.getByRole('combobox').nth(0).press('ArrowDown', { delay: 300 });
58-
await page.getByRole('combobox').nth(0).press('Enter', { delay: 300 });
53+
await page.getByTestId('employee-filter').click();
54+
await page.getByTestId('employee-filter').press('ArrowDown', { delay: 300 });
55+
await page.getByTestId('employee-filter').press('ArrowDown', { delay: 300 });
56+
await page.getByTestId('employee-filter').press('Enter', { delay: 300 });
5957
await expect(await page.getByText('IT Manager×')).toBeVisible();
6058
await page.getByText('IT Manager×').press('Delete');
6159
await expect(await page.getByText('IT Manager×')).not.toBeVisible();

src/packages/end-to-end/src/__tests__/ui/sqlite/issues/gh192.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ test('ensure toast is displayed with the name of the item after creation', async
2929
await page
3030
.locator('div')
3131
.filter({ hasText: /^artist\*Select$/ })
32-
.getByRole('combobox')
3332
.click(); // Click the artist dropdown
3433
await page.locator('form').getByText('A Cor Do Som').click();
3534
await page
3635
.locator('div')
3736
.filter({ hasText: /^tracks\*Select$/ })
38-
.getByRole('combobox')
3937
.click();
4038
await page.locator('form').getByText('#9 Dream').click();
4139
await page.getByRole('button', { name: 'Save' }).click();

src/packages/end-to-end/src/__tests__/ui/sqlite/issues/gh218.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ test('Ensure filtering by multiple items works', async ({ page }) => {
55
await page.goto(config.adminUiUrl);
66
await page.getByRole('link', { name: 'Album' }).click();
77

8-
await page.getByTestId('artist-filter').getByRole('combobox').click();
8+
await page.getByTestId('artist-filter').click();
99
await page.getByTestId('combo-option-AC/DC').click();
10-
await page.getByTestId('artist-filter').getByRole('combobox').click();
10+
await page.getByTestId('artist-filter').click();
1111
await page.getByTestId('combo-option-Aaron Copland & London').click();
1212

1313
// Those rows should look like this:

src/packages/end-to-end/src/__tests__/ui/storage-provider/client-provided-id.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test('Ensure a new image note can be created when an ID is provided', async ({ p
3333
await page.getByLabel('id').click();
3434
await page.getByLabel('id').fill('8a8e1d03-6024-4163-ae73-9d369f9e2922');
3535

36-
await page.getByTestId('detail-panel-field-submission').getByRole('combobox').click();
36+
await page.getByTestId('detail-panel-field-submission').click();
3737
await page.getByTestId(`combo-option-${submissionId}`).click();
3838

3939
await page.getByRole('button', { name: 'Save' }).click();
@@ -68,7 +68,7 @@ test('Ensure a new image note cannot be created when an ID is not provided', asy
6868

6969
await page.getByLabel('note*').fill('This is a note');
7070

71-
await page.getByTestId('detail-panel-field-submission').getByRole('combobox').click();
71+
await page.getByTestId('detail-panel-field-submission').click();
7272
await page.getByTestId(`combo-option-${submissionId}`).click();
7373

7474
await page.getByRole('button', { name: 'Save' }).click();

0 commit comments

Comments
 (0)