Back to Storybook

Component Playwright Test

docs/_snippets/component-playwright-test.md

10.3.6481 B
Original Source
js
import { test, expect } from '@playwright/test';

test('Login Form inputs', async ({ page }) => {
  await page.goto('http://localhost:6006/iframe.html?id=components-login-form--example');
  const email = await page.inputValue('#email');
  const password = await page.inputValue('#password');
  await expect(email).toBe('[email protected]');
  await expect(password).toBe('a-random-password');
});