0.0.126 • Published 2 years ago

@fwoosh/test v0.0.126

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@fwoosh/test

Easily test your fwoosh stories using playwright.

Installation

To install the package.

npm i --save-dev @fwoosh/test
# or
yarn add -D @fwoosh/test

Configuration

To use this you must first install @playwright/test:

npm i --save-dev @playwright/test
# or
yarn add -D @playwright/test

Then create a playwright.config.ts:

import { PlaywrightTestConfig } from "@playwright/test";

const config: PlaywrightTestConfig = {
  testMatch: ["**/*.spec.tsx"],
};

export default config;

Writing Tests

Once you have @fwoosh/test configured you can start writing tests.

import { expect, test } from "@fwoosh/test";

test.describe.parallel("Button", () => {
  test("should be clickable", async ({ page, workbench }) => {
    await workbench.goto("Components/Button/Playground");

    const button = page.locator("text=Click me");

    await expect(button).toBeVisible();
    await button.click();
  });
});

or if you have lots of tests for the same story:

import { expect, test } from "@fwoosh/test";

test.beforeEach(async ({ workbench }) => {
  await workbench.goto("Components/Button/Playground");
});

test.describe.parallel("Button", () => {
  test("should be clickable", async ({ page }) => {
    const button = page.locator("text=Click me");

    await expect(button).toBeVisible();
    await button.click();
  });
});
0.0.119

3 years ago

0.0.118

3 years ago

0.0.126

3 years ago

0.0.125

3 years ago

0.0.120

3 years ago

0.0.124

3 years ago

0.0.123

3 years ago

0.0.122

3 years ago

0.0.121

3 years ago

0.0.117

3 years ago

0.0.116

3 years ago

0.0.115

3 years ago

0.0.114

3 years ago

0.0.113

3 years ago

0.0.112

3 years ago

0.0.111

3 years ago

0.0.110

3 years ago

0.0.109

3 years ago

0.0.108

3 years ago

0.0.107

3 years ago

0.0.106

3 years ago

0.0.105

3 years ago

0.0.104

3 years ago

0.0.103

3 years ago

0.0.102

3 years ago

0.0.101

3 years ago

0.0.100

3 years ago

0.0.99

3 years ago

0.0.98

3 years ago

0.0.97

3 years ago

0.0.96

3 years ago

0.0.95

3 years ago

0.0.94

3 years ago

0.0.93

3 years ago

0.0.92

3 years ago