Skip to content

Commit

Permalink
[java] use --headless=new in EdgeDriverFunctionalTest
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Nov 7, 2024
1 parent 15b44c0 commit d411615
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,20 @@ void canSetPermission() {
@NoDriverBeforeTest
public void canSetPermissionHeadless() {
EdgeOptions options = new EdgeOptions();
options.addArguments("--headless=chrome");
options.addArguments("--headless=new");

localDriver = new WebDriverBuilder().get(options);
HasPermissions permissions = (HasPermissions) localDriver;

localDriver.get(pages.clicksPage);
assertThat(checkPermission(localDriver, CLIPBOARD_READ)).isEqualTo("prompt");
assertThat(checkPermission(localDriver, CLIPBOARD_WRITE)).isEqualTo("prompt");
assertThat(checkPermission(localDriver, CLIPBOARD_WRITE)).isEqualTo("granted");

permissions.setPermission(CLIPBOARD_READ, "granted");
permissions.setPermission(CLIPBOARD_WRITE, "granted");
permissions.setPermission(CLIPBOARD_WRITE, "prompt");

assertThat(checkPermission(localDriver, CLIPBOARD_READ)).isEqualTo("granted");
assertThat(checkPermission(localDriver, CLIPBOARD_WRITE)).isEqualTo("granted");
assertThat(checkPermission(localDriver, CLIPBOARD_WRITE)).isEqualTo("prompt");
}

public String checkPermission(WebDriver driver, String permission) {
Expand Down

0 comments on commit d411615

Please sign in to comment.