Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(e2e): pick the Codex model by testid, not by an unset display name

Alfredo Lopez7bca8ec0d8fc
diff --git a/scripts/e2e/prepare-codex-approved-tools.mjs b/scripts/e2e/prepare-codex-approved-tools.mjs
index 4f6df44b1..eea2b0cf2 100644
--- a/scripts/e2e/prepare-codex-approved-tools.mjs
+++ b/scripts/e2e/prepare-codex-approved-tools.mjs
@@ -102,7 +102,6 @@ function scenarioMetadata(run, label, catalogSize, port, probePort) {
subscriptionName: `Codex fixture ${label} ${run}`,
connectionKey: `${run}-grant-${label}`,
modelName: 'gpt-5.3-codex',
- modelLabel: 'Codex isolated tool test',
fixtureUrl: `http://127.0.0.1:${port}`,
upstreamEvidenceUrl: `http://127.0.0.1:${probePort}`,
}
diff --git a/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts b/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts
index 0474c26d1..b21bca0f6 100644
--- a/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts
+++ b/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts
@@ -123,11 +123,16 @@ async function openAgentChat(desktop: Page, scenario: Scenario) {
desktop.getByRole('button', { name: 'Switch chat agent', exact: true })
).toContainText(scenario.agentDisplayName)
await desktop.getByRole('button', { name: 'Model — Select model', exact: true }).click()
- const modelOption = desktop.getByRole('menuitemradio').filter({ hasText: scenario.modelLabel })
+ // The menu labels an option with the allowlist entry's displayName and
+ // falls back to the model id when there is none (ModelSelector.tsx:276).
+ // The Codex allowlist carries no displayName, so the id is what renders.
+ // Keying on the testid (ModelSelector.tsx:269) anchors this to the same
+ // id the Control UI step bound, instead of to a label nothing defines.
+ const modelOption = desktop.getByTestId(`model-option-${scenario.modelName}`)
await expect(modelOption).toHaveCount(1)
await modelOption.click()
await expect(
- desktop.getByRole('button', { name: `Model — ${scenario.modelLabel}`, exact: true })
+ desktop.getByRole('button', { name: `Model — ${scenario.modelName}`, exact: true })
).toBeVisible()
await expect(desktop.getByTestId('agent-response')).toHaveCount(0)
}
diff --git a/tests/e2e/playwright/helpers/approved-tools-scenarios.ts b/tests/e2e/playwright/helpers/approved-tools-scenarios.ts
index 20a393387..e9455ff34 100644
--- a/tests/e2e/playwright/helpers/approved-tools-scenarios.ts
+++ b/tests/e2e/playwright/helpers/approved-tools-scenarios.ts
@@ -34,7 +34,6 @@ export type Scenario = {
subscriptionName: string
connectionKey: string
modelName: string
- modelLabel: string
fixtureUrl: string
upstreamEvidenceUrl: string
}
@@ -102,7 +101,6 @@ export function scenarios(): Scenario[] {
'subscriptionName',
'connectionKey',
'modelName',
- 'modelLabel',
'fixtureUrl',
] as const
const rows = parsed as Scenario[]
diff --git a/tests/e2e/playwright/helpers/approved-tools-workflow.ts b/tests/e2e/playwright/helpers/approved-tools-workflow.ts
index feae78fd9..51e2622bf 100644
--- a/tests/e2e/playwright/helpers/approved-tools-workflow.ts
+++ b/tests/e2e/playwright/helpers/approved-tools-workflow.ts
@@ -32,7 +32,6 @@ function workflowScenario(): WorkflowScenario {
'subscriptionName',
'connectionKey',
'modelName',
- 'modelLabel',
'workflowName',
'workflowNamespace',
'runId',
@@ -170,11 +169,16 @@ export async function workflowJourney(page: Page, testInfo: TestInfo) {
desktop.getByRole('button', { name: 'Switch chat agent', exact: true })
).toContainText(scenario.agentDisplayName)
await desktop.getByRole('button', { name: 'Model — Select model', exact: true }).click()
- const option = desktop.getByRole('menuitemradio').filter({ hasText: scenario.modelLabel })
+ // The menu labels an option with the allowlist entry's displayName and
+ // falls back to the model id when there is none (ModelSelector.tsx:276).
+ // The Codex allowlist carries no displayName, so the id is what renders.
+ // Keying on the testid (ModelSelector.tsx:269) anchors this to the same
+ // id the Control UI step bound, instead of to a label nothing defines.
+ const option = desktop.getByTestId(`model-option-${scenario.modelName}`)
await expect(option).toHaveCount(1)
await option.click()
await expect(
- desktop.getByRole('button', { name: `Model — ${scenario.modelLabel}`, exact: true })
+ desktop.getByRole('button', { name: `Model — ${scenario.modelName}`, exact: true })
).toBeVisible()
})
diff --git a/tests/e2e/playwright/package-lock.json b/tests/e2e/playwright/package-lock.json
index 5869bd991..e6d559457 100644
--- a/tests/e2e/playwright/package-lock.json
+++ b/tests/e2e/playwright/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.60",
+ "version": "0.1.61",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-playwright-tests",
- "version": "0.1.60",
+ "version": "0.1.61",
"devDependencies": {
"@playwright/test": "^1.50.0",
"@types/node": "^22.0.0",
diff --git a/tests/e2e/playwright/package.json b/tests/e2e/playwright/package.json
index 277ba51f8..d831cabd2 100644
--- a/tests/e2e/playwright/package.json
+++ b/tests/e2e/playwright/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.60",
+ "version": "0.1.61",
"private": true,
"description": "Playwright E2E tests for Control UI and Desktop App",
"scripts": {