Add generated API files
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Accessibility{
|
||||
|
||||
class SnapshotOptions {
|
||||
Boolean interestingOnly;
|
||||
ElementHandle root;
|
||||
}
|
||||
Object snapshot(SnapshotOptions options);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Browser{
|
||||
void close();
|
||||
List<BrowserContext> contexts();
|
||||
boolean isConnected();
|
||||
|
||||
class NewContextOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
BrowserContext newContext(NewContextOptions options);
|
||||
|
||||
class NewPageOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
Page newPage(NewPageOptions options);
|
||||
String version();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface BrowserContext{
|
||||
void close();
|
||||
void addCookies(List<Object> cookies);
|
||||
|
||||
class AddInitScriptArg {
|
||||
}
|
||||
void addInitScript(String script, AddInitScriptArg arg);
|
||||
Browser browser();
|
||||
void clearCookies();
|
||||
void clearPermissions();
|
||||
List<Object> cookies(String urls);
|
||||
void exposeBinding(String name, String playwrightBinding);
|
||||
void exposeFunction(String name, String playwrightFunction);
|
||||
|
||||
class GrantPermissionsOptions {
|
||||
String origin;
|
||||
}
|
||||
void grantPermissions(List<String> permissions, GrantPermissionsOptions options);
|
||||
Page newPage();
|
||||
List<Page> pages();
|
||||
void route(String url, BiConsumer<Route, Request> handler);
|
||||
void setDefaultNavigationTimeout(int timeout);
|
||||
void setDefaultTimeout(int timeout);
|
||||
void setExtraHTTPHeaders(Map<String, String> headers);
|
||||
|
||||
class SetGeolocationGeolocation {
|
||||
Integer latitude;
|
||||
Integer longitude;
|
||||
Integer accuracy;
|
||||
}
|
||||
void setGeolocation(SetGeolocationGeolocation geolocation);
|
||||
|
||||
class SetHTTPCredentialsHttpCredentials {
|
||||
String username;
|
||||
String password;
|
||||
}
|
||||
void setHTTPCredentials(SetHTTPCredentialsHttpCredentials httpCredentials);
|
||||
void setOffline(boolean offline);
|
||||
void unroute(String url, BiConsumer<Route, Request> handler);
|
||||
Object waitForEvent(String event, String optionsOrPredicate);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface BrowserServer{
|
||||
void close();
|
||||
void kill();
|
||||
Object process();
|
||||
String wsEndpoint();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface BrowserType{
|
||||
|
||||
class ConnectOptions {
|
||||
String wsEndpoint;
|
||||
Integer slowMo;
|
||||
Logger logger;
|
||||
Integer timeout;
|
||||
}
|
||||
Browser connect(ConnectOptions options);
|
||||
String executablePath();
|
||||
|
||||
class LaunchOptions {
|
||||
Boolean headless;
|
||||
String executablePath;
|
||||
List<String> args;
|
||||
Boolean ignoreDefaultArgs;
|
||||
Object proxy;
|
||||
String downloadsPath;
|
||||
String artifactsPath;
|
||||
Boolean chromiumSandbox;
|
||||
Map<String, String> firefoxUserPrefs;
|
||||
Boolean handleSIGINT;
|
||||
Boolean handleSIGTERM;
|
||||
Boolean handleSIGHUP;
|
||||
Logger logger;
|
||||
Integer timeout;
|
||||
Map<String, String> env;
|
||||
Boolean devtools;
|
||||
Integer slowMo;
|
||||
}
|
||||
Browser launch(LaunchOptions options);
|
||||
|
||||
class LaunchPersistentContextOptions {
|
||||
Boolean headless;
|
||||
String executablePath;
|
||||
List<String> args;
|
||||
Boolean ignoreDefaultArgs;
|
||||
Object proxy;
|
||||
Boolean acceptDownloads;
|
||||
String downloadsPath;
|
||||
String artifactsPath;
|
||||
Boolean chromiumSandbox;
|
||||
Boolean handleSIGINT;
|
||||
Boolean handleSIGTERM;
|
||||
Boolean handleSIGHUP;
|
||||
Logger logger;
|
||||
Integer timeout;
|
||||
Map<String, String> env;
|
||||
Boolean devtools;
|
||||
Integer slowMo;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
BrowserContext launchPersistentContext(String userDataDir, LaunchPersistentContextOptions options);
|
||||
|
||||
class LaunchServerOptions {
|
||||
Boolean headless;
|
||||
Integer port;
|
||||
String executablePath;
|
||||
List<String> args;
|
||||
Boolean ignoreDefaultArgs;
|
||||
Object proxy;
|
||||
String downloadsPath;
|
||||
String artifactsPath;
|
||||
Boolean chromiumSandbox;
|
||||
Map<String, String> firefoxUserPrefs;
|
||||
Boolean handleSIGINT;
|
||||
Boolean handleSIGTERM;
|
||||
Boolean handleSIGHUP;
|
||||
Logger logger;
|
||||
Integer timeout;
|
||||
Map<String, String> env;
|
||||
Boolean devtools;
|
||||
}
|
||||
BrowserServer launchServer(LaunchServerOptions options);
|
||||
String name();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface CDPSession{
|
||||
void detach();
|
||||
|
||||
class SendParams {
|
||||
}
|
||||
Object send(String method, SendParams params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface ChromiumBrowser{
|
||||
CDPSession newBrowserCDPSession();
|
||||
|
||||
class StartTracingOptions {
|
||||
String path;
|
||||
Boolean screenshots;
|
||||
List<String> categories;
|
||||
}
|
||||
void startTracing(Page page, StartTracingOptions options);
|
||||
byte[] stopTracing();
|
||||
void close();
|
||||
List<BrowserContext> contexts();
|
||||
boolean isConnected();
|
||||
|
||||
class NewContextOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
BrowserContext newContext(NewContextOptions options);
|
||||
|
||||
class NewPageOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
Page newPage(NewPageOptions options);
|
||||
String version();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface ChromiumBrowserContext{
|
||||
List<Page> backgroundPages();
|
||||
CDPSession newCDPSession(Page page);
|
||||
List<Worker> serviceWorkers();
|
||||
void close();
|
||||
void addCookies(List<Object> cookies);
|
||||
|
||||
class AddInitScriptArg {
|
||||
}
|
||||
void addInitScript(String script, AddInitScriptArg arg);
|
||||
Browser browser();
|
||||
void clearCookies();
|
||||
void clearPermissions();
|
||||
List<Object> cookies(String urls);
|
||||
void exposeBinding(String name, String playwrightBinding);
|
||||
void exposeFunction(String name, String playwrightFunction);
|
||||
|
||||
class GrantPermissionsOptions {
|
||||
String origin;
|
||||
}
|
||||
void grantPermissions(List<String> permissions, GrantPermissionsOptions options);
|
||||
Page newPage();
|
||||
List<Page> pages();
|
||||
void route(String url, BiConsumer<Route, Request> handler);
|
||||
void setDefaultNavigationTimeout(int timeout);
|
||||
void setDefaultTimeout(int timeout);
|
||||
void setExtraHTTPHeaders(Map<String, String> headers);
|
||||
|
||||
class SetGeolocationGeolocation {
|
||||
Integer latitude;
|
||||
Integer longitude;
|
||||
Integer accuracy;
|
||||
}
|
||||
void setGeolocation(SetGeolocationGeolocation geolocation);
|
||||
|
||||
class SetHTTPCredentialsHttpCredentials {
|
||||
String username;
|
||||
String password;
|
||||
}
|
||||
void setHTTPCredentials(SetHTTPCredentialsHttpCredentials httpCredentials);
|
||||
void setOffline(boolean offline);
|
||||
void unroute(String url, BiConsumer<Route, Request> handler);
|
||||
Object waitForEvent(String event, String optionsOrPredicate);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface ChromiumCoverage{
|
||||
|
||||
class StartCSSCoverageOptions {
|
||||
Boolean resetOnNavigation;
|
||||
}
|
||||
void startCSSCoverage(StartCSSCoverageOptions options);
|
||||
|
||||
class StartJSCoverageOptions {
|
||||
Boolean resetOnNavigation;
|
||||
Boolean reportAnonymousScripts;
|
||||
}
|
||||
void startJSCoverage(StartJSCoverageOptions options);
|
||||
List<Object> stopCSSCoverage();
|
||||
List<Object> stopJSCoverage();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface ConsoleMessage{
|
||||
List<JSHandle> args();
|
||||
Object location();
|
||||
String text();
|
||||
String type();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Dialog{
|
||||
void accept(String promptText);
|
||||
String defaultValue();
|
||||
void dismiss();
|
||||
String message();
|
||||
String type();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Download{
|
||||
Readable createReadStream();
|
||||
void delete();
|
||||
String failure();
|
||||
String path();
|
||||
void saveAs(String path);
|
||||
String suggestedFilename();
|
||||
String url();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface ElementHandle{
|
||||
ElementHandle querySelector(String selector);
|
||||
List<ElementHandle> querySelectorAll(String selector);
|
||||
Object evalOnSelector(String selector, String pageFunction, Object arg);
|
||||
Object evalOnSelectorAll(String selector, String pageFunction, Object arg);
|
||||
Object boundingBox();
|
||||
|
||||
class CheckOptions {
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void check(CheckOptions options);
|
||||
|
||||
class ClickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer clickCount;
|
||||
Integer delay;
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void click(ClickOptions options);
|
||||
Frame contentFrame();
|
||||
|
||||
class DblclickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer delay;
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void dblclick(DblclickOptions options);
|
||||
void dispatchEvent(String type, Object eventInit);
|
||||
|
||||
class FillOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void fill(String value, FillOptions options);
|
||||
void focus();
|
||||
String getAttribute(String name);
|
||||
|
||||
class HoverOptions {
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Integer timeout;
|
||||
}
|
||||
void hover(HoverOptions options);
|
||||
String innerHTML();
|
||||
String innerText();
|
||||
Frame ownerFrame();
|
||||
|
||||
class PressOptions {
|
||||
Integer delay;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void press(String key, PressOptions options);
|
||||
|
||||
class ScreenshotOptions {
|
||||
String path;
|
||||
enum Type { JPEG, PNG }
|
||||
Type type;
|
||||
Integer quality;
|
||||
Boolean omitBackground;
|
||||
Integer timeout;
|
||||
}
|
||||
byte[] screenshot(ScreenshotOptions options);
|
||||
|
||||
class ScrollIntoViewIfNeededOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void scrollIntoViewIfNeeded(ScrollIntoViewIfNeededOptions options);
|
||||
|
||||
class SelectOptionOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
List<String> selectOption(String values, SelectOptionOptions options);
|
||||
|
||||
class SelectTextOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void selectText(SelectTextOptions options);
|
||||
|
||||
class SetInputFilesOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void setInputFiles(String files, SetInputFilesOptions options);
|
||||
String textContent();
|
||||
String toString();
|
||||
|
||||
class TypeOptions {
|
||||
Integer delay;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void type(String text, TypeOptions options);
|
||||
|
||||
class UncheckOptions {
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void uncheck(UncheckOptions options);
|
||||
enum ElementState { DISABLED, ENABLED, HIDDEN, STABLE, VISIBLE }
|
||||
|
||||
class WaitForElementStateOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void waitForElementState(ElementState state, WaitForElementStateOptions options);
|
||||
|
||||
class WaitForSelectorOptions {
|
||||
enum State { ATTACHED, DETACHED, HIDDEN, VISIBLE }
|
||||
State state;
|
||||
Integer timeout;
|
||||
}
|
||||
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
||||
ElementHandle asElement();
|
||||
void dispose();
|
||||
Object evaluate(String pageFunction, Object arg);
|
||||
JSHandle evaluateHandle(String pageFunction, Object arg);
|
||||
Map<String, JSHandle> getProperties();
|
||||
JSHandle getProperty(String propertyName);
|
||||
Object jsonValue();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface FileChooser{
|
||||
ElementHandle element();
|
||||
boolean isMultiple();
|
||||
Page page();
|
||||
|
||||
class SetFilesOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void setFiles(String files, SetFilesOptions options);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface FirefoxBrowser{
|
||||
void close();
|
||||
List<BrowserContext> contexts();
|
||||
boolean isConnected();
|
||||
|
||||
class NewContextOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
BrowserContext newContext(NewContextOptions options);
|
||||
|
||||
class NewPageOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
Page newPage(NewPageOptions options);
|
||||
String version();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Frame{
|
||||
ElementHandle querySelector(String selector);
|
||||
List<ElementHandle> querySelectorAll(String selector);
|
||||
Object evalOnSelector(String selector, String pageFunction, Object arg);
|
||||
Object evalOnSelectorAll(String selector, String pageFunction, Object arg);
|
||||
|
||||
class AddScriptTagOptions {
|
||||
String url;
|
||||
String path;
|
||||
String content;
|
||||
String type;
|
||||
}
|
||||
ElementHandle addScriptTag(AddScriptTagOptions options);
|
||||
|
||||
class AddStyleTagOptions {
|
||||
String url;
|
||||
String path;
|
||||
String content;
|
||||
}
|
||||
ElementHandle addStyleTag(AddStyleTagOptions options);
|
||||
|
||||
class CheckOptions {
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void check(String selector, CheckOptions options);
|
||||
List<Frame> childFrames();
|
||||
|
||||
class ClickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer clickCount;
|
||||
Integer delay;
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void click(String selector, ClickOptions options);
|
||||
String content();
|
||||
|
||||
class DblclickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer delay;
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void dblclick(String selector, DblclickOptions options);
|
||||
|
||||
class DispatchEventOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void dispatchEvent(String selector, String type, Object eventInit, DispatchEventOptions options);
|
||||
Object evaluate(String pageFunction, Object arg);
|
||||
JSHandle evaluateHandle(String pageFunction, Object arg);
|
||||
|
||||
class FillOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void fill(String selector, String value, FillOptions options);
|
||||
|
||||
class FocusOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void focus(String selector, FocusOptions options);
|
||||
ElementHandle frameElement();
|
||||
|
||||
class GetAttributeOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String getAttribute(String selector, String name, GetAttributeOptions options);
|
||||
|
||||
class GotoOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
String referer;
|
||||
}
|
||||
Response navigate(String url, GotoOptions options);
|
||||
|
||||
class HoverOptions {
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Integer timeout;
|
||||
}
|
||||
void hover(String selector, HoverOptions options);
|
||||
|
||||
class InnerHTMLOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String innerHTML(String selector, InnerHTMLOptions options);
|
||||
|
||||
class InnerTextOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String innerText(String selector, InnerTextOptions options);
|
||||
boolean isDetached();
|
||||
String name();
|
||||
Page page();
|
||||
Frame parentFrame();
|
||||
|
||||
class PressOptions {
|
||||
Integer delay;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void press(String selector, String key, PressOptions options);
|
||||
|
||||
class SelectOptionOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
List<String> selectOption(String selector, String values, SelectOptionOptions options);
|
||||
|
||||
class SetContentOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
void setContent(String html, SetContentOptions options);
|
||||
|
||||
class SetInputFilesOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void setInputFiles(String selector, String files, SetInputFilesOptions options);
|
||||
|
||||
class TextContentOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String textContent(String selector, TextContentOptions options);
|
||||
String title();
|
||||
|
||||
class TypeOptions {
|
||||
Integer delay;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void type(String selector, String text, TypeOptions options);
|
||||
|
||||
class UncheckOptions {
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void uncheck(String selector, UncheckOptions options);
|
||||
String url();
|
||||
|
||||
class WaitForFunctionOptions {
|
||||
enum Polling { UMBE, RAF }
|
||||
Polling polling;
|
||||
Integer timeout;
|
||||
}
|
||||
JSHandle waitForFunction(String pageFunction, Object arg, WaitForFunctionOptions options);
|
||||
enum LoadState { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
|
||||
class WaitForLoadStateOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void waitForLoadState(LoadState state, WaitForLoadStateOptions options);
|
||||
|
||||
class WaitForNavigationOptions {
|
||||
Integer timeout;
|
||||
String url;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
Response waitForNavigation(WaitForNavigationOptions options);
|
||||
|
||||
class WaitForSelectorOptions {
|
||||
enum State { ATTACHED, DETACHED, HIDDEN, VISIBLE }
|
||||
State state;
|
||||
Integer timeout;
|
||||
}
|
||||
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
||||
void waitForTimeout(int timeout);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface JSHandle{
|
||||
ElementHandle asElement();
|
||||
void dispose();
|
||||
Object evaluate(String pageFunction, Object arg);
|
||||
JSHandle evaluateHandle(String pageFunction, Object arg);
|
||||
Map<String, JSHandle> getProperties();
|
||||
JSHandle getProperty(String propertyName);
|
||||
Object jsonValue();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Keyboard{
|
||||
void down(String key);
|
||||
void insertText(String text);
|
||||
|
||||
class PressOptions {
|
||||
Integer delay;
|
||||
}
|
||||
void press(String key, PressOptions options);
|
||||
|
||||
class TypeOptions {
|
||||
Integer delay;
|
||||
}
|
||||
void type(String text, TypeOptions options);
|
||||
void up(String key);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Logger{
|
||||
enum Severity { ERROR, INFO, VERBOSE, WARNING }
|
||||
boolean isEnabled(String name, Severity severity);
|
||||
|
||||
class LogHints {
|
||||
String color;
|
||||
}
|
||||
void log(String name, Severity severity, String message, List<Object> args, LogHints hints);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Mouse{
|
||||
|
||||
class ClickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer clickCount;
|
||||
Integer delay;
|
||||
}
|
||||
void click(int x, int y, ClickOptions options);
|
||||
|
||||
class DblclickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer delay;
|
||||
}
|
||||
void dblclick(int x, int y, DblclickOptions options);
|
||||
|
||||
class DownOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer clickCount;
|
||||
}
|
||||
void down(DownOptions options);
|
||||
|
||||
class MoveOptions {
|
||||
Integer steps;
|
||||
}
|
||||
void move(int x, int y, MoveOptions options);
|
||||
|
||||
class UpOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer clickCount;
|
||||
}
|
||||
void up(UpOptions options);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Page{
|
||||
|
||||
class CloseOptions {
|
||||
Boolean runBeforeUnload;
|
||||
}
|
||||
void close(CloseOptions options);
|
||||
ElementHandle querySelector(String selector);
|
||||
List<ElementHandle> querySelectorAll(String selector);
|
||||
Object evalOnSelector(String selector, String pageFunction, Object arg);
|
||||
Object evalOnSelectorAll(String selector, String pageFunction, Object arg);
|
||||
|
||||
class AddInitScriptArg {
|
||||
}
|
||||
void addInitScript(String script, AddInitScriptArg arg);
|
||||
|
||||
class AddScriptTagOptions {
|
||||
String url;
|
||||
String path;
|
||||
String content;
|
||||
String type;
|
||||
}
|
||||
ElementHandle addScriptTag(AddScriptTagOptions options);
|
||||
|
||||
class AddStyleTagOptions {
|
||||
String url;
|
||||
String path;
|
||||
String content;
|
||||
}
|
||||
ElementHandle addStyleTag(AddStyleTagOptions options);
|
||||
void bringToFront();
|
||||
|
||||
class CheckOptions {
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void check(String selector, CheckOptions options);
|
||||
|
||||
class ClickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer clickCount;
|
||||
Integer delay;
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void click(String selector, ClickOptions options);
|
||||
String content();
|
||||
BrowserContext context();
|
||||
|
||||
class DblclickOptions {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
Button button;
|
||||
Integer delay;
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void dblclick(String selector, DblclickOptions options);
|
||||
|
||||
class DispatchEventOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void dispatchEvent(String selector, String type, Object eventInit, DispatchEventOptions options);
|
||||
|
||||
class EmulateMediaOptions {
|
||||
enum Media { PRINT, SCREEN }
|
||||
Media media;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
}
|
||||
void emulateMedia(EmulateMediaOptions options);
|
||||
Object evaluate(String pageFunction, Object arg);
|
||||
JSHandle evaluateHandle(String pageFunction, Object arg);
|
||||
void exposeBinding(String name, String playwrightBinding);
|
||||
void exposeFunction(String name, String playwrightFunction);
|
||||
|
||||
class FillOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void fill(String selector, String value, FillOptions options);
|
||||
|
||||
class FocusOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void focus(String selector, FocusOptions options);
|
||||
Frame frame(String options);
|
||||
List<Frame> frames();
|
||||
|
||||
class GetAttributeOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String getAttribute(String selector, String name, GetAttributeOptions options);
|
||||
|
||||
class GoBackOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
Response goBack(GoBackOptions options);
|
||||
|
||||
class GoForwardOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
Response goForward(GoForwardOptions options);
|
||||
|
||||
class GotoOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
String referer;
|
||||
}
|
||||
Response navigate(String url, GotoOptions options);
|
||||
|
||||
class HoverOptions {
|
||||
Object position;
|
||||
enum Modifier { ALT, CONTROL, META, SHIFT }
|
||||
Set<Modifier> modifiers;
|
||||
Boolean force;
|
||||
Integer timeout;
|
||||
}
|
||||
void hover(String selector, HoverOptions options);
|
||||
|
||||
class InnerHTMLOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String innerHTML(String selector, InnerHTMLOptions options);
|
||||
|
||||
class InnerTextOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String innerText(String selector, InnerTextOptions options);
|
||||
boolean isClosed();
|
||||
Frame mainFrame();
|
||||
Page opener();
|
||||
|
||||
class PdfOptions {
|
||||
String path;
|
||||
Integer scale;
|
||||
Boolean displayHeaderFooter;
|
||||
String headerTemplate;
|
||||
String footerTemplate;
|
||||
Boolean printBackground;
|
||||
Boolean landscape;
|
||||
String pageRanges;
|
||||
String format;
|
||||
String width;
|
||||
String height;
|
||||
Object margin;
|
||||
Boolean preferCSSPageSize;
|
||||
}
|
||||
byte[] pdf(PdfOptions options);
|
||||
|
||||
class PressOptions {
|
||||
Integer delay;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void press(String selector, String key, PressOptions options);
|
||||
|
||||
class ReloadOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
Response reload(ReloadOptions options);
|
||||
void route(String url, BiConsumer<Route, Request> handler);
|
||||
|
||||
class ScreenshotOptions {
|
||||
String path;
|
||||
enum Type { JPEG, PNG }
|
||||
Type type;
|
||||
Integer quality;
|
||||
Boolean fullPage;
|
||||
Object clip;
|
||||
Boolean omitBackground;
|
||||
Integer timeout;
|
||||
}
|
||||
byte[] screenshot(ScreenshotOptions options);
|
||||
|
||||
class SelectOptionOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
List<String> selectOption(String selector, String values, SelectOptionOptions options);
|
||||
|
||||
class SetContentOptions {
|
||||
Integer timeout;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
void setContent(String html, SetContentOptions options);
|
||||
void setDefaultNavigationTimeout(int timeout);
|
||||
void setDefaultTimeout(int timeout);
|
||||
void setExtraHTTPHeaders(Map<String, String> headers);
|
||||
|
||||
class SetInputFilesOptions {
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void setInputFiles(String selector, String files, SetInputFilesOptions options);
|
||||
|
||||
class SetViewportSizeViewportSize {
|
||||
Integer width;
|
||||
Integer height;
|
||||
}
|
||||
void setViewportSize(SetViewportSizeViewportSize viewportSize);
|
||||
|
||||
class TextContentOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
String textContent(String selector, TextContentOptions options);
|
||||
String title();
|
||||
|
||||
class TypeOptions {
|
||||
Integer delay;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void type(String selector, String text, TypeOptions options);
|
||||
|
||||
class UncheckOptions {
|
||||
Boolean force;
|
||||
Boolean noWaitAfter;
|
||||
Integer timeout;
|
||||
}
|
||||
void uncheck(String selector, UncheckOptions options);
|
||||
void unroute(String url, BiConsumer<Route, Request> handler);
|
||||
String url();
|
||||
Object viewportSize();
|
||||
Object waitForEvent(String event, String optionsOrPredicate);
|
||||
|
||||
class WaitForFunctionOptions {
|
||||
enum Polling { UMBE, RAF }
|
||||
Polling polling;
|
||||
Integer timeout;
|
||||
}
|
||||
JSHandle waitForFunction(String pageFunction, Object arg, WaitForFunctionOptions options);
|
||||
enum LoadState { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
|
||||
class WaitForLoadStateOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
void waitForLoadState(LoadState state, WaitForLoadStateOptions options);
|
||||
|
||||
class WaitForNavigationOptions {
|
||||
Integer timeout;
|
||||
String url;
|
||||
enum WaitUntil { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
WaitUntil waitUntil;
|
||||
}
|
||||
Response waitForNavigation(WaitForNavigationOptions options);
|
||||
|
||||
class WaitForRequestOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
Request waitForRequest(String urlOrPredicate, WaitForRequestOptions options);
|
||||
|
||||
class WaitForResponseOptions {
|
||||
Integer timeout;
|
||||
}
|
||||
Response waitForResponse(String urlOrPredicate, WaitForResponseOptions options);
|
||||
|
||||
class WaitForSelectorOptions {
|
||||
enum State { ATTACHED, DETACHED, HIDDEN, VISIBLE }
|
||||
State state;
|
||||
Integer timeout;
|
||||
}
|
||||
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
||||
void waitForTimeout(int timeout);
|
||||
List<Worker> workers();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Request{
|
||||
Object failure();
|
||||
Frame frame();
|
||||
Map<String, String> headers();
|
||||
boolean isNavigationRequest();
|
||||
String method();
|
||||
String postData();
|
||||
byte[] postDataBuffer();
|
||||
Object postDataJSON();
|
||||
Request redirectedFrom();
|
||||
Request redirectedTo();
|
||||
String resourceType();
|
||||
Response response();
|
||||
String url();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Response{
|
||||
byte[] body();
|
||||
Error finished();
|
||||
Frame frame();
|
||||
Map<String, String> headers();
|
||||
Object json();
|
||||
boolean ok();
|
||||
Request request();
|
||||
int status();
|
||||
String statusText();
|
||||
String text();
|
||||
String url();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Route{
|
||||
void abort(String errorCode);
|
||||
|
||||
class ContinueOverrides {
|
||||
String method;
|
||||
String postData;
|
||||
Map<String, String> headers;
|
||||
}
|
||||
void continue_(ContinueOverrides overrides);
|
||||
|
||||
class FulfillResponse {
|
||||
Integer status;
|
||||
Map<String, String> headers;
|
||||
String contentType;
|
||||
String body;
|
||||
String path;
|
||||
}
|
||||
void fulfill(FulfillResponse response);
|
||||
Request request();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Selectors{
|
||||
|
||||
class RegisterOptions {
|
||||
Boolean contentScript;
|
||||
}
|
||||
void register(String name, String script, RegisterOptions options);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface TimeoutError{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface WebKitBrowser{
|
||||
void close();
|
||||
List<BrowserContext> contexts();
|
||||
boolean isConnected();
|
||||
|
||||
class NewContextOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
BrowserContext newContext(NewContextOptions options);
|
||||
|
||||
class NewPageOptions {
|
||||
Boolean acceptDownloads;
|
||||
Boolean ignoreHTTPSErrors;
|
||||
Boolean bypassCSP;
|
||||
Object viewport;
|
||||
String userAgent;
|
||||
Integer deviceScaleFactor;
|
||||
Boolean isMobile;
|
||||
Boolean hasTouch;
|
||||
Boolean javaScriptEnabled;
|
||||
String timezoneId;
|
||||
Object geolocation;
|
||||
String locale;
|
||||
List<String> permissions;
|
||||
Map<String, String> extraHTTPHeaders;
|
||||
Boolean offline;
|
||||
Object httpCredentials;
|
||||
enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
||||
ColorScheme colorScheme;
|
||||
Logger logger;
|
||||
String relativeArtifactsPath;
|
||||
Boolean recordVideos;
|
||||
Object videoSize;
|
||||
Boolean recordTrace;
|
||||
}
|
||||
Page newPage(NewPageOptions options);
|
||||
String version();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
interface Worker{
|
||||
Object evaluate(String pageFunction, Object arg);
|
||||
JSHandle evaluateHandle(String pageFunction, Object arg);
|
||||
String url();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user