Skip to content

Commit 416956f

Browse files
author
jackn
committed
fix: Use .last() to target parameter name input specifically
Multiple inputs match placeholder*='voltage' (Model Format and Parameter Name). Using .last() to select the second one (parameter name input) and .fill() method.
1 parent 08dedad commit 416956f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

frontend/e2e/configurator.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ test.describe('Product Configurator', () => {
6666

6767
// Add first parameter (voltage - enum)
6868
// Scroll to the parameter form inputs (they're below the fold)
69-
await page.locator('input[placeholder*="voltage"]').scrollIntoViewIfNeeded();
70-
await page.fill('input[placeholder*="voltage"]', 'voltage');
69+
await page.locator('input[placeholder*="voltage"]').last().scrollIntoViewIfNeeded();
70+
await page.locator('input[placeholder*="voltage"]').last().fill('voltage');
7171
await page.selectOption('select', 'enum');
7272
await page.fill('input[placeholder*="120,208"]', '120V,208V,240V');
7373
await page.click('button:has-text("Add Parameter")');
@@ -83,7 +83,7 @@ test.describe('Product Configurator', () => {
8383
await expect(page.locator('h3:has-text("Add Parameter")')).toBeVisible();
8484

8585
// Add second parameter (length - enum)
86-
await page.fill('input[placeholder*="voltage"]', 'length');
86+
await page.locator('input[placeholder*="voltage"]').last().fill('length');
8787
// Type should already be enum from previous
8888
await page.fill('input[placeholder*="120,208"]', '3ft,6ft,10ft');
8989
await page.click('button:has-text("Add Parameter")');
@@ -122,10 +122,10 @@ test.describe('Product Configurator', () => {
122122
// Add parameter
123123

124124

125-
await page.locator('input[placeholder*="voltage"]').scrollIntoViewIfNeeded();
125+
await page.locator('input[placeholder*="voltage"]').last().scrollIntoViewIfNeeded();
126126

127127

128-
await page.fill('input[placeholder*="voltage"]', 'test');
128+
await page.locator('input[placeholder*="voltage"]').last().fill('test');
129129
await page.selectOption('select', 'enum');
130130
await page.fill('input[placeholder*="120,208"]', 'A,B,C');
131131
await page.click('button:has-text("Add Parameter")');
@@ -212,17 +212,17 @@ test.describe('Product Configurator', () => {
212212
// Add voltage parameter
213213

214214

215-
await page.locator('input[placeholder*="voltage"]').scrollIntoViewIfNeeded();
215+
await page.locator('input[placeholder*="voltage"]').last().scrollIntoViewIfNeeded();
216216

217217

218-
await page.fill('input[placeholder*="voltage"]', 'voltage');
218+
await page.locator('input[placeholder*="voltage"]').last().fill('voltage');
219219
await page.selectOption('select', 'enum');
220220
await page.fill('input[placeholder*="120,208"]', '120V,208V');
221221
await page.click('button:has-text("Add Parameter")');
222222
await expect(page.locator('text=/parameter added/i')).toBeVisible({ timeout: 5000 });
223223

224224
// Add length parameter
225-
await page.fill('input[placeholder*="voltage"]', 'length');
225+
await page.locator('input[placeholder*="voltage"]').last().fill('length');
226226
await page.fill('input[placeholder*="120,208"]', '3ft,6ft');
227227
await page.click('button:has-text("Add Parameter")');
228228
await expect(page.locator('text=/parameter added/i')).toBeVisible({ timeout: 5000 });

0 commit comments

Comments
 (0)