Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4935 test refactoring element sidenav #5375

Open
wants to merge 4 commits into
base: angular_rework_development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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 @@ -13,6 +13,7 @@
import io.github.com.pages.ProgressBarPage;
import io.github.com.pages.ProgressSpinnerPage;
import io.github.com.pages.RadioButtonPage;
import io.github.com.pages.SideNavPage;
import io.github.com.pages.SlideTogglePage;

@JSite("https://jdi-testing.github.io/jdi-light/angular-page/#/")
Expand All @@ -39,6 +40,9 @@ public class StaticSite {
@Url("buttons_toggle")
public static ButtonTogglePage buttonTogglePage;

@Url("sidenav")
public static SideNavPage sideNavPage;

@Url("divider")
public static DividerPage dividerPage;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.github.com.enums;

public enum ConfigurableMode {

OVER("over"),
SIDE("side"),
PUSH("push");

private final String mode;

ConfigurableMode(String mode) {
this.mode = mode;
}

public String getMode() {
return mode;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

обычно еще делают метод получения Enum по строковому значению

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package io.github.com.pages;

import com.epam.jdi.light.angular.elements.common.Button;
import com.epam.jdi.light.angular.elements.common.Checkbox;
import com.epam.jdi.light.angular.elements.complex.radiobuttons.RadioGroup;
import com.epam.jdi.light.angular.elements.composite.MaterialSelectorContainer;
import com.epam.jdi.light.angular.elements.composite.SideNavContainer;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.TextField;
import io.github.com.pages.sections.SideNavSection;

public class SideNavPage extends NewAngularPage {

public static SideNavContainer basicSideNav;
public static SideNavContainer basicDrawer;
public static SideNavContainer sidenavBackdropContainer;
public static SideNavContainer implicitMainContent;
public static SideNavContainer openCloseBehavior;

@UI("#open-close-behavior mat-checkbox")
public static Checkbox sideNavOpened;

@UI("#open-close-behavior button")
public static Button sideNavToggle;

public static SideNavContainer configurableMode;

@UI("#configurable-mode .mat-sidenav button")
public static Button sideToggle;

@UI("#configurable-mode .mat-sidenav-content button")
public static Button contentToggle;

@UI("#configurable-mode .mat-sidenav .mat-mdc-radio-group")
public static RadioGroup sideNavRadioGroup;
@UI("#mat-select-position")
public static MaterialSelectorContainer sideNavPosition;

@UI("#mat-select-focus-on-the-first-item")
public static MaterialSelectorContainer sideNavFocusSelection;

@UI("#configurable-mode .mat-sidenav-content .mat-mdc-radio-group")
public static RadioGroup contentRadioGroup;

public static SideNavContainer customEscapeBackdrop;

@UI("#custom-escape-backdrop .mat-sidenav button")
public static Button toggleSideNav;

@UI("#custom-escape-backdrop .mat-sidenav-content button")
public static Button openSideNav;

public static SideNavContainer autoSizeSideNav;

@UI("#auto-size-side-nav .mat-drawer-content button")
public static Button toggleAutoNav;

@UI("#auto-size-side-nav .mat-drawer button")
public static Button toggleExtraText;

public static SideNavContainer fixedPosition;

@UI("#fixed-position mat-checkbox")
public static Checkbox fixSideNav;

@UI("#fixed-position .mat-sidenav-content button")
public static Button toggleFixedSideNav;

@UI("#fixed-position .mat-sidenav-content mat-form-field input[formcontrolname='top']")
public static TextField topGap;

@UI("#fixed-position .mat-sidenav-content mat-form-field input[formcontrolname='bottom']")
public static TextField bottomGap;

public static SideNavSection sidenavBackdropDrawer;

public static SideNavContainer responsiveContent;

@UI("//*[@id='responsive-content']/preceding-sibling::mat-toolbar/button")
public static Button toolbarToggle;

@UI("#mat-drawer-open-button")
public static Button backDropToggle;

@UI("//button[.//span[contains(@class, 'mdc-button__label') and text()='First Element']]")
public static Button firstElement;

// @UI("//button[.//span[contains(@class, 'mdc-button__label') and text()='First Element'] and contains(@class, 'cdk-focused')]")
@UI("//button[contains(@class, 'cdk-focused') and contains(@class, 'cdk-program-focused') and //span[contains(@class, 'mdc-button__label') and text()='First Element']]")
public static Button firstElementFocused;

@UI("//button[.//span[contains(@class, 'mdc-button__label') and text()='Second Element']]")
public static Button secondElement;
}
Loading