Parcourir la source

test: stabilize model pricing generator e2e

master
fengsilin il y a 3 semaines
Parent
révision
aeff58b122
1 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. +7
    -2
      web/e2e/model-pricing.spec.ts

+ 7
- 2
web/e2e/model-pricing.spec.ts Voir le fichier

@@ -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();



Chargement…
Annuler
Enregistrer