diff --git a/web/e2e/model-pricing.spec.ts b/web/e2e/model-pricing.spec.ts index 515f13e..733edd5 100644 --- a/web/e2e/model-pricing.spec.ts +++ b/web/e2e/model-pricing.spec.ts @@ -27,6 +27,10 @@ async function fillByTestId(page: Page, testId: string, value: string) { await fillControl(page.getByTestId(testId), value); } +async function countGeneratorRatioRows(page: Page) { + return await page.getByTestId(/^generator-ratio-value-/).count(); +} + async function fetchModelPricing( request: APIRequestContext, model: string, @@ -67,8 +71,9 @@ test.describe.serial('Model Pricing E2E', () => { const generator = page.getByTestId('model-pricing-generator'); await generator.locator('input[value="replace_all"]').check({ force: true }); - await fillByTestId(page, 'generator-ratio-value-2', '1'); - await fillByTestId(page, 'generator-ratio-ratio-2', '1.5'); + const qualityRowIndex = (await countGeneratorRatioRows(page)) - 1; + await fillByTestId(page, `generator-ratio-value-${qualityRowIndex}`, 'standard'); + await fillByTestId(page, `generator-ratio-ratio-${qualityRowIndex}`, '1.5'); await expect(page.getByTestId('generator-apply')).toBeEnabled(); await page.getByTestId('generator-apply').click();