From fc0c183eecc117497d917bd8d3439d8ccf609a9c Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 18 Dec 2020 12:01:47 -0800 Subject: [PATCH] docs: add Java requirements section (#148) --- README.md | 2 ++ .../microsoft/playwright/example/Main.java | 36 ------------------- 2 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 playwright/src/main/java/com/microsoft/playwright/example/Main.java diff --git a/README.md b/README.md index 4eb184f5..7953ec6d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Headless execution is supported for all the browsers on all platforms. Check out ## Usage +Playwright supports Java 8 and above. + #### Add Maven dependency Playwright is distributed as a set of [Maven](https://maven.apache.org/what-is-maven.html) modules. The easiest way to use it is to add a couple of dependencies to your Maven `pom.xml` file as described below. If you're not familiar with Maven please refer to its [documentation](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html). diff --git a/playwright/src/main/java/com/microsoft/playwright/example/Main.java b/playwright/src/main/java/com/microsoft/playwright/example/Main.java deleted file mode 100644 index dd904cbb..00000000 --- a/playwright/src/main/java/com/microsoft/playwright/example/Main.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.microsoft.playwright.example; - -import com.microsoft.playwright.*; - -import java.io.File; -import java.nio.file.Paths; - -public class Main { - public static void main(String[] args) throws Exception { - Playwright playwright = Playwright.create(); - Browser browser = playwright.chromium().launch(); - BrowserContext context = browser.newContext( - new Browser.NewContextOptions().withViewport(800, 600)); - Page page = context.newPage(); - page.navigate("https://webkit.org"); - page.click("text=check feature status"); - page.screenshot(new Page.ScreenshotOptions().withPath(Paths.get("s.png"))); - browser.close(); - playwright.close(); - } -}