Skip to content

Commit

Permalink
refactor: patch update
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Feb 2, 2024
1 parent 867fd4f commit 5c3a673
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .changeset/red-fireants-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'storycap-testrun': patch
---

A micro update:

- Increased the default retry count for `retake` from 5 to 10
- Improved the type for `flakiness`
Empty file removed CHANGELOG.md
Empty file.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ The interval in milliseconds before attempting to capture the screenshot again.
### `flakiness.retake.retries`

**Type:** `number`
**Default:** `5`
**Default:** `10`

The number of times to repeat capturing the screenshot until the hash values of the images are identical. A value of 3 or more is recommended to achieve the effect of retries.

Expand Down Expand Up @@ -234,6 +234,20 @@ See [Page | Playwright][playwright-screenshot].

These are parameters that can be specified for each Story.

```typescript
// Button.stories.tsx
const meta: Meta<typeof Button> = {
component: Button,
parameters: {
screenshot: {
/* parameters... */
},
},
};

export default meta;
```

### `skip`

**Type:** `boolean`
Expand Down Expand Up @@ -264,7 +278,7 @@ Removes elements corresponding to the CSS selector.

## CHANGELOG

See [CHANGELOG.md](./CHANGELOG.md).
See [CHANGELOG.md](./packages/storycap-testrun/CHANGELOG.md).

## License

Expand Down
6 changes: 3 additions & 3 deletions packages/storycap-testrun/src/screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ export type ScreenshotOptions = {
};
flakiness?: {
metrics?: {
enabled: boolean;
enabled?: boolean;
retries?: number;
};
retake?: {
enabled: boolean;
enabled?: boolean;
interval?: number;
retries?: number;
};
Expand All @@ -66,7 +66,7 @@ const defaultScreenshotOptions: ResolvedScreenshotOptions = {
retake: {
enabled: true,
interval: 100,
retries: 5,
retries: 10,
},
},
hooks: [],
Expand Down

0 comments on commit 5c3a673

Please sign in to comment.