Skip to content

Instantly share code, notes, and snippets.

@zac11
Created January 21, 2023 06:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zac11/1eb0a205b9f57ca4c02cb4d255cf368b to your computer and use it in GitHub Desktop.
/// <reference lib="dom"/>
import { createDataTransfer } from "playwright-utilities";
import { resolve } from "node:path";
import { chromium,test } from "@playwright/test";
test.use({ viewport: { width: 1400, height: 1000 } });
test('Launch the Selectors hub test page',async()=>{
const browser = await chromium.launch({
headless: false
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto("https://cgi-lib.berkeley.edu/ex/fup.html");
await page.waitForTimeout(5000);
const element1 = page.locator("input[name='upfile']");
await element1.setInputFiles("/Users/Rahul_Yadav/Downloads/shub.png");
await page.locator("input[value='Press']").click();
await page.waitForTimeout(5000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment