af4f911fac3c2c4e045491639539aa62d7369916
Route all package downloads in the release pipeline through the DevDiv_PublicPackages Azure Artifacts feed, as required by SFI-ES4.2.4: - Maven: a pipeline-only settings.xml mirrors central to the feed and MavenAuthenticate@0 supplies credentials. The published poms and public CI keep using Maven Central. - npm: the pipeline writes .npmrc pointing at the feed and runs npmAuthenticate@0. download_driver.sh now runs npm from the repository root and uses `npm pack` instead of a hard-coded registry.npmjs.org URL, so the configured registry is used for both the gitHead lookup and the playwright-core tarball. - Skip the release-branch check on manual runs and gate the ESRP publish job on v1.* tags so the feed setup can be exercised by hand.
🎭 Playwright for Java
Website | API reference
Playwright is a Java library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.
| Linux | macOS | Windows | |
|---|---|---|---|
| Chromium 151.0.7922.34 | ✅ | ✅ | ✅ |
| WebKit 26.5 | ✅ | ✅ | ✅ |
| Firefox 153.0 | ✅ | ✅ | ✅ |
Documentation
https://playwright.dev/java/docs/intro
API Reference
https://playwright.dev/java/docs/api/class-playwright
Example
This code snippet navigates to Playwright homepage in Chromium, Firefox and WebKit, and saves 3 screenshots.
import com.microsoft.playwright.*;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
public class PageScreenshot {
public static void main(String[] args) {
try (Playwright playwright = Playwright.create()) {
List<BrowserType> browserTypes = Arrays.asList(
playwright.chromium(),
playwright.webkit(),
playwright.firefox()
);
for (BrowserType browserType : browserTypes) {
try (Browser browser = browserType.launch()) {
BrowserContext context = browser.newContext();
Page page = context.newPage();
page.navigate("https://playwright.dev/");
page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("screenshot-" + browserType.name() + ".png")));
}
}
}
}
}
Other languages
More comfortable in another programming language? Playwright is also available in
Description
Languages
Java
98.2%
HTML
1.2%
Shell
0.5%
CSS
0.1%