diff --git a/src/tools/percentage-calculator/percentage-calculator.e2e.spec.ts b/src/tools/percentage-calculator/percentage-calculator.e2e.spec.ts index a8ef2d48..5cb07da2 100644 --- a/src/tools/percentage-calculator/percentage-calculator.e2e.spec.ts +++ b/src/tools/percentage-calculator/percentage-calculator.e2e.spec.ts @@ -10,27 +10,27 @@ test.describe('Tool - Percentage calculator', () => { }); test('Correctly works out percentages', async ({ page }) => { - await page.getByTestId('percentageX').locator('input').fill('123'); - await page.getByTestId('percentageY').locator('input').fill('456'); + await page.getByTestId('percentageX').locator('input').pressSequentially('123\n'); + await page.getByTestId('percentageY').locator('input').pressSequentially('456\n'); await expect(page.getByTestId('percentageResult').locator('input')).toHaveValue('560.88'); - await page.getByTestId('numberX').locator('input').fill('123'); - await page.getByTestId('numberY').locator('input').fill('456'); + await page.getByTestId('numberX').locator('input').pressSequentially('123\n'); + await page.getByTestId('numberY').locator('input').pressSequentially('456\n'); await expect(page.getByTestId('numberResult').locator('input')).toHaveValue('26.973684210526315'); - await page.getByTestId('numberFrom').locator('input').fill('123'); - await page.getByTestId('numberTo').locator('input').fill('456'); + await page.getByTestId('numberFrom').locator('input').pressSequentially('123\n'); + await page.getByTestId('numberTo').locator('input').pressSequentially('456\n'); await expect(page.getByTestId('percentageIncreaseDecrease').locator('input')).toHaveValue('270.7317073170732'); }); test('Displays empty results for incomplete input', async ({ page }) => { - await page.getByTestId('percentageX').locator('input').fill('123'); + await page.getByTestId('percentageX').locator('input').pressSequentially('123\n'); await expect(page.getByTestId('percentageResult').locator('input')).toHaveValue(''); - await page.getByTestId('numberY').locator('input').fill('456'); + await page.getByTestId('numberY').locator('input').pressSequentially('456\n'); await expect(page.getByTestId('numberResult').locator('input')).toHaveValue(''); - await page.getByTestId('numberFrom').locator('input').fill('123'); + await page.getByTestId('numberFrom').locator('input').pressSequentially('123\n'); await expect(page.getByTestId('percentageIncreaseDecrease').locator('input')).toHaveValue(''); }); });