Skip to content

Commit

Permalink
Refactor ChromeDriverFunctionalTest: (#14398)
Browse files Browse the repository at this point in the history
Refactor ChromeDriverFunctionalTest: Remove redundant permission constants

Removed the CLIPBOARD_READ and CLIPBOARD_WRITE constants from the class level in ChromeDriverFunctionalTest to avoid redundancy. These constants are now defined within the canSetPermission method, reducing unnecessary visibility and improving code cohesion.

This change simplifies maintenance and enhances code clarity without altering existing functionality.

Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
  • Loading branch information
manuelsblanco and diemol authored Aug 19, 2024
1 parent d8a7172 commit 25c8376
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@

class ChromeDriverFunctionalTest extends JupiterTestBase {

private final String CLIPBOARD_READ = "clipboard-read";
private final String CLIPBOARD_WRITE = "clipboard-write";

@Test
@NoDriverBeforeTest
public void builderGeneratesDefaultChromeOptions() {
Expand Down Expand Up @@ -109,7 +106,9 @@ void canSetPermission() {
HasPermissions permissions = (HasPermissions) driver;

driver.get(pages.clicksPage);
String CLIPBOARD_READ = "clipboard-read";
assumeThat(checkPermission(driver, CLIPBOARD_READ)).isEqualTo("prompt");
String CLIPBOARD_WRITE = "clipboard-write";
assumeThat(checkPermission(driver, CLIPBOARD_WRITE)).isEqualTo("granted");

permissions.setPermission(CLIPBOARD_READ, "denied");
Expand Down

0 comments on commit 25c8376

Please sign in to comment.