Skip to content

Commit

Permalink
docs: restructure readme file (#43)
Browse files Browse the repository at this point in the history
* docs: restructure readme file

* chore: generate changeset
  • Loading branch information
SebastianSedzik authored Jan 4, 2024
1 parent a2e7892 commit ccc39fc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-guests-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'playwright-decorators': patch
---

Restructure readme file
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TypeScript's decorators for writing Playwright based tests.
npm i playwright-decorators
```

## 🏗️ Usage
## 👀 Examples
Declare tests using `@suite` and `@test` decorators
```ts
import { suite, test, slow, tag, TestArgs, TestInfo } from 'playwright-decorators';
Expand All @@ -36,11 +36,28 @@ class MyTestSuite {
}
}
```
To view all the available decorators, check the [documentation](#-documentation) section.
For guidance on creating custom decorators, refer to the [custom decorators](#custom-decorators) section.
Explore additional examples in the [examples](./examples) directory.
1. To view all the available decorators, check the [docs](#-docs) section.
2. For guidance on creating custom decorators, refer to the [custom decorators](#custom-decorators) section.
3. Explore additional examples in the [examples](./examples) directory.

## 📖 Docs
- [Creating a test suite: `@suite`](#creating-a-test-suite-suiteoptions)
- [Creating a test: `@test`](#creating-a-test-testoptions)
- [Run method before all tests in the suite: `@beforeAll`](#run-method-before-all-tests-in-the-suite-beforeall)
- [Run method before each test in the suite: `@beforeEach`](#run-method-before-each-test-in-the-suite-beforeeach)
- [Run method after all tests in the suite: `@afterAll`](#run-method-after-all-tests-in-the-suite-afterall)
- [Run method after each test in the suite: `@afterEach`](#run-method-after-each-test-in-the-suite-aftereach)
- [Skip test or suite: `@skip`](#skip-test-or-suite-skipreason-string)
- [Mark test or suite as "should fail": `@fail`](#mark-test-or-suite-as-should-fail-failreason-string)
- [Mark test or suite as "fixme", with the intention to fix it: `@fixme`](#mark-test-or-suite-as-fixme-with-the-intention-to-fix-it-fixmereason-string)
- [Mark test or suite as "slow": `@slow`](#mark-test-or-suite-as-slow-slowreason-string)
- [Run only selected test(s) or suite(s): `@only`](#run-only-selected-tests-or-suites-only)
- [Run test(s) or suite(s) with certain tag(s): `@tag`](#run-tests-or-suites-with-certain-tags-tagtags-string)
- [Add custom annotation to test(s): `@annotate`](#add-custom-annotation-to-tests-annotatetype-string-description-string)
- [Run test(s) or suite(s) in debug mode: `@debug`](#run-tests-or-suites-in-debug-mode-debug)
- [Run test(s) or suite(s) in preview mode: `@preview`](#run-tests-or-suites-in-preview-mode-preview)
- [Create custom decorator: `createSuiteDecorator`, `createTestDecorator`, `createSuiteAndTestDecorator`](#custom-decorators)

## 📝 Documentation
### Creating a test suite: `@suite(options?)`
Mark class as test suite.
Under the hood, decorator creates a `describe` block and runs all methods decorated by `@test` inside it.
Expand Down

0 comments on commit ccc39fc

Please sign in to comment.