From ecac20eb617335233bf11eba7a62b399611ccd6c Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Sun, 30 Jun 2024 18:00:42 -0400 Subject: [PATCH] Test adding 1+2 in Calculator --- tests/calculator.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/calculator.spec.ts 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'); +});