Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/punkpeye/playwright-utilities
Playwright utilities
https://github.com/punkpeye/playwright-utilities
Last synced: 3 months ago
JSON representation
Playwright utilities
- Host: GitHub
- URL: https://github.com/punkpeye/playwright-utilities
- Owner: punkpeye
- License: other
- Created: 2022-08-26T01:39:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-26T02:02:03.000Z (over 2 years ago)
- Last Synced: 2024-09-30T06:08:20.931Z (3 months ago)
- Language: TypeScript
- Size: 131 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Playwright Utilities
Utilities for working with [`@playwright/test`](https://playwright.dev/).
## Utilities
- [`createDataTransfer`](#createDataTransfer)
### `createDataTransfer`
Used to create a [DataTransfer](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer). Useful when you want to perform drag and drop operations.
```ts
createDataTransfer = (args: {
page: Page;
filePath: string;
fileName: string;
fileType: string;
}): Promise;
```Usage:
```ts
import { createDataTransfer } from "playwright-utilities";
import { resolve } from "node:path";await createDataTransfer({
filePath: resolve(__dirname, "foo.png"),
fileName: "foo.png",
fileType: "image/png",
});
```