Skip to content

Commit c039fd0

Browse files
committed
test: update selectors
1 parent b4113e4 commit c039fd0

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

test/e2e/connector.spec.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,14 @@ test.describe('Organization Management', () => {
171171
await orgManagement.getByRole('button', { name: /add member/i }).click()
172172

173173
// Wait for the add-member form to appear
174-
const usernameInput = orgManagement.locator('input[name="new-member-username"]')
174+
const usernameInput = orgManagement.locator('#new-member-username')
175175
await expect(usernameInput).toBeVisible({ timeout: 5000 })
176176

177177
// Fill in the form
178178
await usernameInput.fill('newuser')
179179

180-
// Select role
181-
const roleSelect = orgManagement.locator('select[name="new-member-role"]')
182-
await expect(roleSelect).toBeVisible({ timeout: 5000 })
183-
await roleSelect.selectOption('admin')
180+
// Select role (SelectField renders id on the <select>, not name)
181+
await orgManagement.locator('#new-member-role').selectOption('admin')
184182

185183
// Submit
186184
await orgManagement.getByRole('button', { name: /^add$/i }).click()
@@ -219,7 +217,7 @@ test.describe('Organization Management', () => {
219217
const orgManagement = page.getByRole('region', { name: /organization management/i })
220218
await expect(orgManagement).toBeVisible({ timeout: 10_000 })
221219

222-
const roleSelect = orgManagement.locator('select[name="role-member2"]')
220+
const roleSelect = orgManagement.locator('#role-member2')
223221
await expect(roleSelect).toBeVisible({ timeout: 5000 })
224222
await roleSelect.selectOption('admin')
225223
await page.waitForTimeout(500)
@@ -258,11 +256,6 @@ test.describe('Package Access Controls', () => {
258256
await expect(page.locator('h1')).toContainText('kit', { timeout: 30_000 })
259257
}
260258

261-
/** The access section is identified by the "Team Access" heading */
262-
function accessSection(page: Page) {
263-
return page.locator('section:has(#access-heading)')
264-
}
265-
266259
test('shows team access section on scoped package when connected', async ({
267260
page,
268261
gotoConnected,
@@ -299,13 +292,12 @@ test.describe('Package Access Controls', () => {
299292

300293
await section.getByRole('button', { name: /grant team access/i }).click()
301294

302-
const teamSelect = section.locator('select[name="grant-team"]')
295+
const teamSelect = section.locator('#grant-team-select')
303296
await expect(teamSelect).toBeVisible()
304297
await expect(teamSelect.locator('option')).toHaveCount(4, { timeout: 10_000 })
305298
await teamSelect.selectOption({ label: 'nuxt:triage' })
306299

307-
const permissionSelect = section.locator('select[name="grant-permission"]')
308-
await permissionSelect.selectOption('read-write')
300+
await section.locator('#grant-permission-select').selectOption('read-write')
309301

310302
await section.getByRole('button', { name: /^grant$/i }).click()
311303
await page.waitForTimeout(500)
@@ -348,7 +340,7 @@ test.describe('Package Access Controls', () => {
348340
await expect(section).toBeVisible({ timeout: 15_000 })
349341

350342
await section.getByRole('button', { name: /grant team access/i }).click()
351-
const teamSelect = section.locator('select[name="grant-team"]')
343+
const teamSelect = section.locator('#grant-team-select')
352344
await expect(teamSelect).toBeVisible()
353345

354346
await section.getByRole('button', { name: /cancel granting access/i }).click()
@@ -436,3 +428,8 @@ test.describe('Operations Queue', () => {
436428
expect(operations).toHaveLength(0)
437429
})
438430
})
431+
432+
/** The access section is identified by the "Team Access" heading */
433+
function accessSection(page: Page) {
434+
return page.locator('section:has(#access-heading)')
435+
}

0 commit comments

Comments
 (0)