Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;

import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
import static org.testng.Assert.assertEquals;
Expand Down Expand Up @@ -110,21 +111,24 @@ public void testClickWithModifiers () {
FrameLocator frame = this.page.frameLocator (".demo-frame");

Locator items = frame.locator ("#selectable li");
Locator itemOne = items.nth (0);
Locator itemFour = items.nth (3);

items.nth (0)
.click (new Locator.ClickOptions ().setModifiers (List.of (KeyboardModifier.CONTROL)));
itemOne.click (new Locator.ClickOptions ().setModifiers (List.of (KeyboardModifier.CONTROL)));

items.nth (3)
.click (new Locator.ClickOptions ().setModifiers (List.of (KeyboardModifier.CONTROL)));
itemFour.click (new Locator.ClickOptions ().setModifiers (List.of (KeyboardModifier.CONTROL)));

this.page.waitForTimeout (2000);
assertThat (itemOne).hasClass (Pattern.compile (".*ui-selected.*"));
assertThat (itemFour).hasClass (Pattern.compile (".*ui-selected.*"));

this.page.navigate ("https://the-internet.herokuapp.com/");
this.page.getByRole (AriaRole.LINK, new Page.GetByRoleOptions ().setName ("File Download")
.setExact (true))
.click (new Locator.ClickOptions ().setModifiers (List.of (KeyboardModifier.SHIFT)));
// this.page.waitForTimeout (2000);

this.page.waitForTimeout (2000);
// this.page.navigate ("https://the-internet.herokuapp.com/");
// this.page.getByRole (AriaRole.LINK, new Page.GetByRoleOptions ().setName ("File Download")
// .setExact (true))
// .click (new Locator.ClickOptions ().setModifiers (List.of (KeyboardModifier.SHIFT)));
//
// this.page.waitForTimeout (2000);

}

Expand Down
Loading