Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 720 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 720 Bytes

Playwright Utilities

Utilities for working with @playwright/test.

Utilities

createDataTransfer

Used to create a DataTransfer. Useful when you want to perform drag and drop operations.

createDataTransfer = (args: {
  page: Page;
  filePath: string;
  fileName: string;
  fileType: string;
}): Promise<DataTransfer>;

Usage:

import { createDataTransfer } from "playwright-utilities";
import { resolve } from "node:path";

await createDataTransfer({
  filePath: resolve(__dirname, "foo.png"),
  fileName: "foo.png",
  fileType: "image/png",
});