diff --git a/tests/calculator.spec.ts b/tests/calculator.spec.ts new file mode 100644 index 00000000..07f16cd6 --- /dev/null +++ b/tests/calculator.spec.ts @@ -0,0 +1,14 @@ +import { test, expect } from '@playwright/test'; + +test.beforeEach(async ({ page }) => { + await page.goto('http://localhost:1998/'); + await page.getByText('Calculator').dblclick(); +}); + +test('can do some math', async ({ page }) => { + await page.frameLocator('iframe').getByRole('button', { name: '1' }).click(); + await page.frameLocator('iframe').getByLabel('add').click(); + await page.frameLocator('iframe').getByRole('button', { name: '2' }).click(); + await page.frameLocator('iframe').getByLabel('equals').click(); + await expect(page.frameLocator('iframe').getByRole('textbox')).toHaveValue('3'); +});