chore: update cli to 1.10.0-next-1616100617000 (#348)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Test
|
||||
name: Build & Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -9,7 +9,7 @@ on:
|
||||
- master
|
||||
- release-*
|
||||
jobs:
|
||||
build:
|
||||
dev:
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -48,3 +48,44 @@ jobs:
|
||||
cd tools/test-spring-boot-starter
|
||||
mvn package -D skipTests --no-transfer-progress
|
||||
java -jar target/test-spring-boot*.jar
|
||||
|
||||
stable:
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
browser-channel: [chrome]
|
||||
include:
|
||||
- os: windows-latest
|
||||
browser-channel: msedge
|
||||
- os: macos-latest
|
||||
browser-channel: msedge
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: microsoft/playwright-github-action@v1
|
||||
- name: Install Media Pack
|
||||
if: matrix.os == 'windows-latest'
|
||||
shell: powershell
|
||||
run: Install-WindowsFeature Server-Media-Foundation
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
- name: Download drivers
|
||||
shell: bash
|
||||
run: scripts/download_driver_for_all_platforms.sh
|
||||
- name: Build with Maven
|
||||
run: mvn -B package -D skipTests --no-transfer-progress
|
||||
- name: Run tests
|
||||
run: mvn test --no-transfer-progress
|
||||
env:
|
||||
BROWSER: chromium
|
||||
BROWSER_CHANNEL: ${{ matrix.browser-channel }}
|
||||
|
||||
@@ -68,6 +68,20 @@ public interface BrowserType {
|
||||
* href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
|
||||
*/
|
||||
public List<String> args;
|
||||
/**
|
||||
* Chromium distribution channel, one of
|
||||
* <ul>
|
||||
* <li> chrome</li>
|
||||
* <li> chrome-beta</li>
|
||||
* <li> chrome-dev</li>
|
||||
* <li> chrome-canary</li>
|
||||
* <li> msedge</li>
|
||||
* <li> msedge-beta</li>
|
||||
* <li> msedge-dev</li>
|
||||
* <li> msedge-canary</li>
|
||||
* </ul>
|
||||
*/
|
||||
public String channel;
|
||||
/**
|
||||
* Enable Chromium sandboxing. Defaults to {@code false}.
|
||||
*/
|
||||
@@ -144,6 +158,10 @@ public interface BrowserType {
|
||||
this.args = args;
|
||||
return this;
|
||||
}
|
||||
public LaunchOptions setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
return this;
|
||||
}
|
||||
public LaunchOptions setChromiumSandbox(boolean chromiumSandbox) {
|
||||
this.chromiumSandbox = chromiumSandbox;
|
||||
return this;
|
||||
@@ -222,6 +240,20 @@ public interface BrowserType {
|
||||
* Toggles bypassing page's Content-Security-Policy.
|
||||
*/
|
||||
public Boolean bypassCSP;
|
||||
/**
|
||||
* Chromium distribution channel, one of
|
||||
* <ul>
|
||||
* <li> chrome</li>
|
||||
* <li> chrome-beta</li>
|
||||
* <li> chrome-dev</li>
|
||||
* <li> chrome-canary</li>
|
||||
* <li> msedge</li>
|
||||
* <li> msedge-beta</li>
|
||||
* <li> msedge-dev</li>
|
||||
* <li> msedge-canary</li>
|
||||
* </ul>
|
||||
*/
|
||||
public String channel;
|
||||
/**
|
||||
* Enable Chromium sandboxing. Defaults to {@code true}.
|
||||
*/
|
||||
@@ -383,6 +415,10 @@ public interface BrowserType {
|
||||
this.bypassCSP = bypassCSP;
|
||||
return this;
|
||||
}
|
||||
public LaunchPersistentContextOptions setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
return this;
|
||||
}
|
||||
public LaunchPersistentContextOptions setChromiumSandbox(boolean chromiumSandbox) {
|
||||
this.chromiumSandbox = chromiumSandbox;
|
||||
return this;
|
||||
|
||||
@@ -52,19 +52,20 @@ public interface Download {
|
||||
*/
|
||||
InputStream createReadStream();
|
||||
/**
|
||||
* Deletes the downloaded file.
|
||||
* Deletes the downloaded file. Will wait for the download to finish if necessary.
|
||||
*/
|
||||
void delete();
|
||||
/**
|
||||
* Returns download error if any.
|
||||
* Returns download error if any. Will wait for the download to finish if necessary.
|
||||
*/
|
||||
String failure();
|
||||
/**
|
||||
* Returns path to the downloaded file in case of successful download.
|
||||
* Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if
|
||||
* necessary.
|
||||
*/
|
||||
Path path();
|
||||
/**
|
||||
* Saves the download to a user-specified path.
|
||||
* Saves the download to a user-specified path. It is safe to call this method while the download is still in progress.
|
||||
*
|
||||
* @param path Path where the download should be saved.
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
*/
|
||||
public class TestAutoClose {
|
||||
@Test
|
||||
void shouldAllowUsingTryWithResources() throws Exception {
|
||||
void shouldAllowUsingTryWithResources() {
|
||||
try (Playwright playwright = Playwright.create();
|
||||
Browser browser = Utils.getBrowserTypeFromEnv(playwright).launch();
|
||||
BrowserContext context = browser.newContext();
|
||||
|
||||
@@ -51,12 +51,17 @@ public class TestBase {
|
||||
return "firefox".equals(browserType.name());
|
||||
}
|
||||
|
||||
private static String getBrowserChannelFromEnv() {
|
||||
return System.getenv("BROWSER_CHANNEL");
|
||||
}
|
||||
|
||||
static BrowserType.LaunchOptions createLaunchOptions() {
|
||||
String headfulEnv = System.getenv("HEADFUL");
|
||||
headful = headfulEnv != null && !"0".equals(headfulEnv) && !"false".equals(headfulEnv);
|
||||
BrowserType.LaunchOptions options;
|
||||
options = new BrowserType.LaunchOptions();
|
||||
options.headless = !headful;
|
||||
options.channel = getBrowserChannelFromEnv();
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -88,11 +88,12 @@ public class TestBrowserContextExposeFunction extends TestBase {
|
||||
context.exposeFunction("woof", args -> actualArgs.add(args[0]));
|
||||
context.addInitScript("window['woof']('context')");
|
||||
Page page = context.newPage();
|
||||
page.addInitScript("window['woof']('page')");
|
||||
page.evaluate("undefined");
|
||||
assertEquals(asList("context"), actualArgs);
|
||||
actualArgs.clear();
|
||||
page.addInitScript("window['woof']('page')");
|
||||
page.reload();
|
||||
assertTrue(actualArgs.contains("context"));
|
||||
assertTrue(actualArgs.contains("page"));
|
||||
assertEquals(asList("context", "page"), actualArgs);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -368,6 +368,8 @@ public class TestPageKeyboard extends TestBase {
|
||||
void shouldSupportMacOSShortcuts() {
|
||||
// Test for MacOS only
|
||||
Assumptions.assumeTrue(isMac);
|
||||
// @see https://github.com/microsoft/playwright/issues/5721
|
||||
Assumptions.assumeFalse(isFirefox());
|
||||
page.navigate(server.PREFIX + "/input/textarea.html");
|
||||
ElementHandle textarea = page.querySelector("textarea");
|
||||
textarea.type("some text");
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.10.0-next-1615230258000
|
||||
1.10.0-next-1616100617000
|
||||
|
||||
Reference in New Issue
Block a user