Skip to content

Commit

Permalink
chore: update javadocs to reference set* methods (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Mar 5, 2021
1 parent 71b5865 commit 10da11c
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ default List<Cookie> cookies() {
* public static void main(String[] args) {
* try (Playwright playwright = Playwright.create()) {
* BrowserType webkit = playwright.webkit()
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().withHeadless(false));
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
* BrowserContext context = browser.newContext();
* context.exposeBinding("pageURL", (source, args) -> source.page().url());
* Page page = context.newPage();
Expand All @@ -279,7 +279,7 @@ default List<Cookie> cookies() {
* ElementHandle element = (ElementHandle) args[0];
* System.out.println(element.textContent());
* return null;
* }, new BrowserContext.ExposeBindingOptions().withHandle(true));
* }, new BrowserContext.ExposeBindingOptions().setHandle(true));
* page.setContent("" +
* "<script>\n" +
* " document.addEventListener('click', event => window.clicked(event.target));\n" +
Expand Down Expand Up @@ -315,7 +315,7 @@ default void exposeBinding(String name, BindingCallback callback) {
* public static void main(String[] args) {
* try (Playwright playwright = Playwright.create()) {
* BrowserType webkit = playwright.webkit()
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().withHeadless(false));
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
* BrowserContext context = browser.newContext();
* context.exposeBinding("pageURL", (source, args) -> source.page().url());
* Page page = context.newPage();
Expand All @@ -338,7 +338,7 @@ default void exposeBinding(String name, BindingCallback callback) {
* ElementHandle element = (ElementHandle) args[0];
* System.out.println(element.textContent());
* return null;
* }, new BrowserContext.ExposeBindingOptions().withHandle(true));
* }, new BrowserContext.ExposeBindingOptions().setHandle(true));
* page.setContent("" +
* "<script>\n" +
* " document.addEventListener('click', event => window.clicked(event.target));\n" +
Expand Down Expand Up @@ -376,7 +376,7 @@ default void exposeBinding(String name, BindingCallback callback) {
* public static void main(String[] args) {
* try (Playwright playwright = Playwright.create()) {
* BrowserType webkit = playwright.webkit()
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().withHeadless(false));
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
* context.exposeFunction("sha1", args -> {
* String text = (String) args[0];
* MessageDigest crypto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ default Browser connect(String wsEndpoint) {
* <pre>{@code
* // Or "firefox" or "webkit".
* Browser browser = chromium.launch(new BrowserType.LaunchOptions()
* .withIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
* .setIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
* }</pre>
*
* <p> > **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works
Expand Down Expand Up @@ -588,7 +588,7 @@ default Browser launch() {
* <pre>{@code
* // Or "firefox" or "webkit".
* Browser browser = chromium.launch(new BrowserType.LaunchOptions()
* .withIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
* .setIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
* }</pre>
*
* <p> > **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ default void scrollIntoViewIfNeeded() {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1153,7 +1153,7 @@ default List<String> selectOption(String values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1174,7 +1174,7 @@ default List<String> selectOption(String values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1197,7 +1197,7 @@ default List<String> selectOption(ElementHandle values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1218,7 +1218,7 @@ default List<String> selectOption(ElementHandle values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1241,7 +1241,7 @@ default List<String> selectOption(String[] values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1262,7 +1262,7 @@ default List<String> selectOption(String[] values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1285,7 +1285,7 @@ default List<String> selectOption(SelectOption values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1306,7 +1306,7 @@ default List<String> selectOption(SelectOption values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1329,7 +1329,7 @@ default List<String> selectOption(ElementHandle[] values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1350,7 +1350,7 @@ default List<String> selectOption(ElementHandle[] values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1373,7 +1373,7 @@ default List<String> selectOption(SelectOption[] values) {
* // single selection matching the value
* handle.selectOption("blue");
* // single selection matching the label
* handle.selectOption(new SelectOption().withLabel("Blue"));
* handle.selectOption(new SelectOption().setLabel("Blue"));
* // multiple selection
* handle.selectOption(new String[] {"red", "green", "blue"});
* }</pre>
Expand Down Expand Up @@ -1515,7 +1515,7 @@ default void tap() {
* <p> To press a special key, like {@code Control} or {@code ArrowDown}, use {@link ElementHandle#press ElementHandle.press()}.
* <pre>{@code
* elementHandle.type("Hello"); // Types instantly
* elementHandle.type("World", new ElementHandle.TypeOptions().withDelay(100)); // Types slower, like a user
* elementHandle.type("World", new ElementHandle.TypeOptions().setDelay(100)); // Types slower, like a user
* }</pre>
*
* <p> An example of typing into a text field and then submitting the form:
Expand All @@ -1536,7 +1536,7 @@ default void type(String text) {
* <p> To press a special key, like {@code Control} or {@code ArrowDown}, use {@link ElementHandle#press ElementHandle.press()}.
* <pre>{@code
* elementHandle.type("Hello"); // Types instantly
* elementHandle.type("World", new ElementHandle.TypeOptions().withDelay(100)); // Types slower, like a user
* elementHandle.type("World", new ElementHandle.TypeOptions().setDelay(100)); // Types slower, like a user
* }</pre>
*
* <p> An example of typing into a text field and then submitting the form:
Expand Down Expand Up @@ -1652,7 +1652,7 @@ default void waitForElementState(ElementState state) {
* ElementHandle div = page.querySelector("div");
* // Waiting for the "span" selector relative to the div.
* ElementHandle span = div.waitForSelector("span", new ElementHandle.WaitForSelectorOptions()
* .withState(WaitForSelectorState.ATTACHED));
* .setState(WaitForSelectorState.ATTACHED));
* }</pre>
*
* <p> <strong>NOTE:</strong> This method does not work across navigations, use {@link Page#waitForSelector Page.waitForSelector()} instead.
Expand All @@ -1676,7 +1676,7 @@ default ElementHandle waitForSelector(String selector) {
* ElementHandle div = page.querySelector("div");
* // Waiting for the "span" selector relative to the div.
* ElementHandle span = div.waitForSelector("span", new ElementHandle.WaitForSelectorOptions()
* .withState(WaitForSelectorState.ATTACHED));
* .setState(WaitForSelectorState.ATTACHED));
* }</pre>
*
* <p> <strong>NOTE:</strong> This method does not work across navigations, use {@link Page#waitForSelector Page.waitForSelector()} instead.
Expand Down
28 changes: 14 additions & 14 deletions playwright/src/main/java/com/microsoft/playwright/Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ default void press(String selector, String key) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1833,7 +1833,7 @@ default List<String> selectOption(String selector, String values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1856,7 +1856,7 @@ default List<String> selectOption(String selector, String values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1881,7 +1881,7 @@ default List<String> selectOption(String selector, ElementHandle values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1904,7 +1904,7 @@ default List<String> selectOption(String selector, ElementHandle values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1929,7 +1929,7 @@ default List<String> selectOption(String selector, String[] values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1952,7 +1952,7 @@ default List<String> selectOption(String selector, String[] values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -1977,7 +1977,7 @@ default List<String> selectOption(String selector, SelectOption values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -2000,7 +2000,7 @@ default List<String> selectOption(String selector, SelectOption values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -2025,7 +2025,7 @@ default List<String> selectOption(String selector, ElementHandle[] values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -2048,7 +2048,7 @@ default List<String> selectOption(String selector, ElementHandle[] values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand All @@ -2073,7 +2073,7 @@ default List<String> selectOption(String selector, SelectOption[] values) {
* // single selection matching the value
* frame.selectOption("select#colors", "blue");
* // single selection matching both the value and the label
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
* // multiple selection
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
* }</pre>
Expand Down Expand Up @@ -2266,7 +2266,7 @@ default String textContent(String selector) {
* // Types instantly
* frame.type("#mytextarea", "Hello");
* // Types slower, like a user
* frame.type("#mytextarea", "World", new Frame.TypeOptions().withDelay(100));
* frame.type("#mytextarea", "World", new Frame.TypeOptions().setDelay(100));
* }</pre>
*
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See <a
Expand All @@ -2285,7 +2285,7 @@ default void type(String selector, String text) {
* // Types instantly
* frame.type("#mytextarea", "Hello");
* // Types slower, like a user
* frame.type("#mytextarea", "World", new Frame.TypeOptions().withDelay(100));
* frame.type("#mytextarea", "World", new Frame.TypeOptions().setDelay(100));
* }</pre>
*
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See <a
Expand Down
Loading

0 comments on commit 10da11c

Please sign in to comment.