diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 22bc68267..adab1f4d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,12 +4,10 @@ on: jobs: build: timeout-minutes: 30 - strategy: - fail-fast: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: microsoft/playwright-github-action@v1 + - uses: microsoft/playwright-github-action@v1.5.0 - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb9b176db..73a858c8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: microsoft/playwright-github-action@v1 + - uses: microsoft/playwright-github-action@v1.5.0 - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -64,7 +64,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: microsoft/playwright-github-action@v1 + - uses: microsoft/playwright-github-action@v1.5.0 - name: Install Media Pack if: matrix.os == 'windows-latest' shell: powershell diff --git a/README.md b/README.md index 76106c978..58b45090b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 93.0.4530.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 93.0.4543.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 14.2 | ✅ | ✅ | ✅ | | Firefox 89.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index af9cd7d48..9bb1fb8c4 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -673,7 +673,9 @@ default Page newPage() { */ Page newPage(NewPageOptions options); /** - * NOTE: Tracing is only supported on Chromium-based browsers. + * NOTE: This API controls Chromium Tracing + * which is a low-level chromium-specific debugging tool. API to control Playwright Tracing + * could be found here. * *
You can use {@link Browser#startTracing Browser.startTracing()} and {@link Browser#stopTracing Browser.stopTracing()} to * create a trace file that can be opened in Chrome DevTools performance panel. @@ -690,7 +692,9 @@ default void startTracing(Page page) { startTracing(page, null); } /** - * NOTE: Tracing is only supported on Chromium-based browsers. + * NOTE: This API controls Chromium Tracing + * which is a low-level chromium-specific debugging tool. API to control Playwright Tracing + * could be found here. * *
You can use {@link Browser#startTracing Browser.startTracing()} and {@link Browser#stopTracing Browser.stopTracing()} to * create a trace file that can be opened in Chrome DevTools performance panel. @@ -705,7 +709,9 @@ default void startTracing() { startTracing(null); } /** - * NOTE: Tracing is only supported on Chromium-based browsers. + * NOTE: This API controls Chromium Tracing + * which is a low-level chromium-specific debugging tool. API to control Playwright Tracing + * could be found here. * *
You can use {@link Browser#startTracing Browser.startTracing()} and {@link Browser#stopTracing Browser.stopTracing()} to * create a trace file that can be opened in Chrome DevTools performance panel. @@ -720,7 +726,9 @@ default void startTracing() { */ void startTracing(Page page, StartTracingOptions options); /** - * NOTE: Tracing is only supported on Chromium-based browsers. + * NOTE: This API controls Chromium Tracing + * which is a low-level chromium-specific debugging tool. API to control Playwright Tracing + * could be found here. * *
Returns the buffer with trace data. */ diff --git a/playwright/src/main/java/com/microsoft/playwright/Download.java b/playwright/src/main/java/com/microsoft/playwright/Download.java index 589bf1b41..a53813f7f 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Download.java +++ b/playwright/src/main/java/com/microsoft/playwright/Download.java @@ -23,8 +23,7 @@ /** * {@code Download} objects are dispatched by page via the {@link Page#onDownload Page.onDownload()} event. * - *
If {@code downloadsPath} isn't specified, all the downloaded files belonging to the browser context are deleted when the - * browser context is closed. And all downloaded files are deleted when the browser closes. + *
All the downloaded files belonging to the browser context are deleted when the browser context is closed. * *
Download event is emitted once the download starts. Download path becomes available once download completes: *
{@code
diff --git a/playwright/src/main/java/com/microsoft/playwright/Frame.java b/playwright/src/main/java/com/microsoft/playwright/Frame.java
index 08bdb91d9..006821b3a 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Frame.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Frame.java
@@ -358,6 +358,48 @@ public DispatchEventOptions setTimeout(double timeout) {
return this;
}
}
+ class DragAndDropOptions {
+ /**
+ * Whether to bypass the actionability checks. Defaults to
+ * {@code false}.
+ */
+ public Boolean force;
+ /**
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
+ * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
+ * inaccessible pages. Defaults to {@code false}.
+ */
+ public Boolean noWaitAfter;
+ /**
+ * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
+ * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
+ * Page.setDefaultTimeout()} methods.
+ */
+ public Double timeout;
+ /**
+ * When set, this method only performs the actionability
+ * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without
+ * performing it.
+ */
+ public Boolean trial;
+
+ public DragAndDropOptions setForce(boolean force) {
+ this.force = force;
+ return this;
+ }
+ public DragAndDropOptions setNoWaitAfter(boolean noWaitAfter) {
+ this.noWaitAfter = noWaitAfter;
+ return this;
+ }
+ public DragAndDropOptions setTimeout(double timeout) {
+ this.timeout = timeout;
+ return this;
+ }
+ public DragAndDropOptions setTrial(boolean trial) {
+ this.trial = trial;
+ return this;
+ }
+ }
class FillOptions {
/**
* Whether to bypass the actionability checks. Defaults to
@@ -596,6 +638,32 @@ public IsEnabledOptions setTimeout(double timeout) {
return this;
}
}
+ class IsHiddenOptions {
+ /**
+ * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
+ * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
+ * Page.setDefaultTimeout()} methods.
+ */
+ public Double timeout;
+
+ public IsHiddenOptions setTimeout(double timeout) {
+ this.timeout = timeout;
+ return this;
+ }
+ }
+ class IsVisibleOptions {
+ /**
+ * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
+ * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
+ * Page.setDefaultTimeout()} methods.
+ */
+ public Double timeout;
+
+ public IsVisibleOptions setTimeout(double timeout) {
+ this.timeout = timeout;
+ return this;
+ }
+ }
class PressOptions {
/**
* Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0.
@@ -1051,8 +1119,8 @@ default ElementHandle addStyleTag() {
* When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code TimeoutError}. Passing
* zero timeout disables this.
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
*/
default void check(String selector) {
check(selector, null);
@@ -1074,8 +1142,8 @@ default void check(String selector) {
*
When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code TimeoutError}. Passing
* zero timeout disables this.
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
*/
void check(String selector, CheckOptions options);
List childFrames();
@@ -1093,8 +1161,8 @@ default void check(String selector) {
*
When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code TimeoutError}. Passing
* zero timeout disables this.
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
*/
default void click(String selector) {
click(selector, null);
@@ -1113,8 +1181,8 @@ default void click(String selector) {
*
When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code TimeoutError}. Passing
* zero timeout disables this.
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
*/
void click(String selector, ClickOptions options);
/**
@@ -1138,8 +1206,8 @@ default void click(String selector) {
*
*
NOTE: {@code frame.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
*/
default void dblclick(String selector) {
dblclick(selector, null);
@@ -1161,8 +1229,8 @@ default void dblclick(String selector) {
*
*
NOTE: {@code frame.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
*/
void dblclick(String selector, DblclickOptions options);
/**
@@ -1196,8 +1264,8 @@ default void dblclick(String selector) {
* frame.dispatchEvent("#source", "dragstart", arg);
* }
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
* @param eventInit Optional event-specific initialization properties.
*/
@@ -1235,8 +1303,8 @@ default void dispatchEvent(String selector, String type, Object eventInit) {
* frame.dispatchEvent("#source", "dragstart", arg);
* }
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
*/
default void dispatchEvent(String selector, String type) {
@@ -1273,12 +1341,16 @@ default void dispatchEvent(String selector, String type) {
* frame.dispatchEvent("#source", "dragstart", arg);
* }
*
- * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details.
+ * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See
+ * working with selectors for more details.
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
* @param eventInit Optional event-specific initialization properties.
*/
void dispatchEvent(String selector, String type, Object eventInit, DispatchEventOptions options);
+ default void dragAndDrop(String source, String target) {
+ dragAndDrop(source, target, null);
+ }
+ void dragAndDrop(String source, String target, DragAndDropOptions options);
/**
* Returns the return value of {@code expression}.
*
@@ -1523,8 +1595,8 @@ default JSHandle evaluateHandle(String expression) {
*
* To send fine-grained keyboard events, use {@link Frame#type Frame.type()}. * - * @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See working with selectors for more details. + * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See + * working with selectors for more details. * @param value Value to fill for the {@code }, {@code