Skip to content

Commit

Permalink
Test adding 1+2 in Calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Jun 30, 2024
1 parent 0cfa179 commit ecac20e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/calculator.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
});

0 comments on commit ecac20e

Please sign in to comment.