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

2 years ago

0.0.118

2 years ago

0.0.126

2 years ago

0.0.125

2 years ago

0.0.120

2 years ago

0.0.124

2 years ago

0.0.123

2 years ago

0.0.122

2 years ago

0.0.121

2 years ago

0.0.117

2 years ago

0.0.116

2 years ago

0.0.115

2 years ago

0.0.114

2 years ago

0.0.113

2 years ago

0.0.112

2 years ago

0.0.111

2 years ago

0.0.110

2 years ago

0.0.109

2 years ago

0.0.108

2 years ago

0.0.107

2 years ago

0.0.106

2 years ago

0.0.105

2 years ago

0.0.104

2 years ago

0.0.103

2 years ago

0.0.102

2 years ago

0.0.101

2 years ago

0.0.100

2 years ago

0.0.99

2 years ago

0.0.98

2 years ago

0.0.97

2 years ago

0.0.96

2 years ago

0.0.95

2 years ago

0.0.94

2 years ago

0.0.93

2 years ago

0.0.92

2 years ago