Skip to content
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,35 @@
package com.webforj.samples.pages.alert;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class AlertExpansesPage {

private static final String ROUTE = "alertexpanses";

private final Locator alertXSmall;
private final Locator alertMedium;
private final Locator alertXLarge;

public AlertExpansesPage(Page page) {
this.alertXSmall = page.locator("dwc-alert").filter(new Locator.FilterOptions().setHasText("This alert uses the XSMALL expanse."));
this.alertMedium = page.locator("dwc-alert").filter(new Locator.FilterOptions().setHasText("This alert uses the MEDIUM expanse."));
this.alertXLarge = page.locator("dwc-alert").filter(new Locator.FilterOptions().setHasText("This alert uses the XLARGE expanse."));
}

public static String getRoute() {
return ROUTE;
}

public Locator getAlertXSmall() {
return alertXSmall;
}

public Locator getAlertMedium() {
return alertMedium;
}

public Locator getAlertXLarge() {
return alertXLarge;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.webforj.samples.pages.alert;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class AlertThemesPage {

private static final String ROUTE = "alertthemes";

private final Locator successAlert;

public AlertThemesPage(Page page) {
this.successAlert = page.locator("dwc-alert").filter(new Locator.FilterOptions().setHasText("This is an alert with the SUCCESS theme!"));
}

public static String getRoute() {
return ROUTE;
}

public Locator getSuccessAlert() {
return successAlert;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.webforj.samples.pages.applayout.applayout;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.AriaRole;

public class AppLayoutPage {

private static final String ROUTE = "applayout";

private final Locator dashboardLink;

public AppLayoutPage(Page page) {
this.dashboardLink = page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Dashboard"));

}

public static String getRoute() {
return ROUTE;
}

public Locator getDashboardLink() {
return dashboardLink;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.webforj.samples.pages.applayout.applayoutdrawerutility;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class AppLayoutDrawerUtilityPage {

private static final String ROUTE = "applayoutdrawerutility";

private final Locator headerText;

public AppLayoutDrawerUtilityPage(Page page) {

this.headerText = page.getByText("Joe Smith");
}

public static String getRoute() {
return ROUTE;
}

public Locator getHeaderText() {
return headerText;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.webforj.samples.pages.applayout.fullnavbar;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class AppLayoutFullNavbarPage {


private static final String ROUTE = "applayoutfullnavbar";

private final Locator header;

public AppLayoutFullNavbarPage(Page page) {
this.header = page.locator("header");
}

public static String getRoute() {
return ROUTE;
}

public Locator getHeaderText() {
return header;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.webforj.samples.pages.applayout.multipleheaders;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class AppLayoutMultipleHeadersPage {

private static final String ROUTE = "applayoutmultipleheaders";

private final Locator dwcToolbar;

public AppLayoutMultipleHeadersPage(Page page) {
this.dwcToolbar = page.locator("dwc-toolbar");
}

public static String getRoute() {
return ROUTE;
}

public Locator getDwcToolbar() {
return dwcToolbar;
}

}
14 changes: 7 additions & 7 deletions src/test/java/com/webforj/samples/pages/appnav/AppNavPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public AppNavPage(Page page) {

this.tablerIcon = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("menu 2"));
this.appLayout = page.locator("dwc-app-layout");
this.paragraph = page.getByText("Content for", new Page.GetByTextOptions().setExact(false));
this.paragraph = page.getByText("Content for", new Page.GetByTextOptions());

this.inboxDropdown = page.getByText("Inbox", new Page.GetByTextOptions().setExact(false));
this.inboxDropdown = page.getByText("Inbox", new Page.GetByTextOptions());

this.sidebarPrimaryTab = page.getByText("Primary", new Page.GetByTextOptions().setExact(false));
this.sidebarPrimaryTab = page.getByText("Primary", new Page.GetByTextOptions());

this.aboutDropdown = page.getByText("About", new Page.GetByTextOptions().setExact(false));
this.sidebarWebforJ = page.getByText("webforJ", new Page.GetByTextOptions().setExact(false));
this.sidebarGitHub = page.getByText("GitHub", new Page.GetByTextOptions().setExact(false));
this.sidebarDocumentation = page.getByText("Documentation", new Page.GetByTextOptions().setExact(false));
this.aboutDropdown = page.getByText("About", new Page.GetByTextOptions());
this.sidebarWebforJ = page.getByText("webforJ", new Page.GetByTextOptions());
this.sidebarGitHub = page.getByText("GitHub", new Page.GetByTextOptions());
this.sidebarDocumentation = page.getByText("Documentation", new Page.GetByTextOptions());
}

public static String getRoute() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.webforj.samples.pages.button;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.AriaRole;

public class ButtonDisablePage {

private static final String ROUTE = "buttondisable";

private final Locator submitButton;
private final Locator emailInput;

public ButtonDisablePage(Page page) {
this.submitButton = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Submit"));
this.emailInput = page.getByRole(AriaRole.TEXTBOX, new Page.GetByRoleOptions().setName("Enter an email"));
}

public static String getRoute() {
return ROUTE;
}

public Locator getSubmitButton() {
return submitButton;
}

public Locator getEmailInput() {
return emailInput;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.webforj.samples.pages.button;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.AriaRole;

public class ButtonEventPage {

private static final String ROUTE = "buttonevent";

private final Locator button;
private final Page page;

public ButtonEventPage(Page page) {
this.button = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Click Me!"));
this.page = page;
}

public static String getRoute() {
return ROUTE;
}

public Locator getButton() {
return button;
}

public Locator getCounterText(String text) {
return page.getByText("Current Counter: " + text);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.webforj.samples.pages.button;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class ButtonThemesPage {

private static final String ROUTE = "buttonthemes";

private final Locator solidButton;
private final Locator outlinedButton;

public ButtonThemesPage(Page page) {
this.solidButton = page.locator("dwc-button").filter(new Locator.FilterOptions().setHasText("Danger"));
this.outlinedButton = page.locator("dwc-button").filter(new Locator.FilterOptions().setHasText("Outlined Button"));
}

public static String getRoute() {
return ROUTE;
}

public Locator getSolidButton() {
return solidButton;
}

public Locator getOutlinedButton() {
return outlinedButton;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.webforj.samples.pages.checkbox;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;

public class CheckboxHorizontalTextPage {

private static final String ROUTE = "checkboxhorizontaltext";

private final Locator dailyCheckbox;

public CheckboxHorizontalTextPage(Page page) {
this.dailyCheckbox = page.getByText("Daily").nth(1);
}

public static String getRoute() {
return ROUTE;
}

public Locator getDailyCheckbox() {
return dailyCheckbox;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.webforj.samples.pages.composite;

import com.microsoft.playwright.Page;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.options.AriaRole;

public class CompositePage {

private static final String ROUTE = "composite/";

private final Locator toDoInput;
private final Locator firstTaskCheckbox;
private final Locator firstDeleteButton;

public CompositePage(Page page) {
this.toDoInput = page.getByRole(AriaRole.TEXTBOX, new Page.GetByRoleOptions().setName("Enter a new task and press Enter..."));
this.firstTaskCheckbox = page.getByRole(AriaRole.CHECKBOX, new Page.GetByRoleOptions().setName("Review documentation"));
this.firstDeleteButton = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Delete")).first();
}

public static String getRoute() {
return ROUTE;
}

public Locator getToDoInput() {
return toDoInput;
}

public Locator getFirstTaskCheckbox() {
return firstTaskCheckbox;
}

public Locator getFirstDeleteButton() {
return firstDeleteButton;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.webforj.samples.pages.dialog;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.AriaRole;

public class DialogAutoFocusPage {

private static final String ROUTE = "dialogautofocus";

private final Locator textField;

public DialogAutoFocusPage(Page page) {
this.textField = page.getByRole(AriaRole.TEXTBOX, new Page.GetByRoleOptions().setName("This Box is Auto Focused"));
}

public static String getRoute() {
return ROUTE;
}

public Locator getTextField() {
return textField;
}
}
Loading