-
Notifications
You must be signed in to change notification settings - Fork 47
4935 test refactoring element sidenav #5375
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
base: angular_rework_development
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| package io.github.com.pages; | ||
|
|
||
| import com.epam.jdi.light.angular.elements.common.Checkbox; | ||
| import com.epam.jdi.light.angular.elements.complex.SideNav; | ||
| import com.epam.jdi.light.angular.elements.complex.radiobuttons.RadioGroup; | ||
| import com.epam.jdi.light.elements.common.UIElement; | ||
| import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI; | ||
| import com.epam.jdi.light.ui.html.elements.common.Button; | ||
| import io.github.com.pages.sections.SideNavSection; | ||
|
|
||
| public class SideNavPage extends NewAngularPage { | ||
|
|
||
| public static SideNav basicSideNav; | ||
| public static SideNav basicDrawer; | ||
| public static SideNav sidenavBackdropContainer; | ||
| public static SideNav implicitMainContent; | ||
| public static SideNav openCloseBehavior; | ||
|
|
||
| @UI("#open-close-behavior mat-checkbox") | ||
| public static Checkbox sideNavOpened; | ||
|
|
||
| @UI("#open-close-behavior button") | ||
| public static Button sideNavToggle; | ||
|
|
||
| public static SideNav 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 UIElement sideNavPosition; | ||
|
|
||
| @UI("#mat-select-focus-on-the-first-item") | ||
| public static UIElement sideNavFocusSelection; | ||
|
|
||
| @UI("#configurable-mode .mat-sidenav-content .mat-mdc-radio-group") | ||
| public static RadioGroup contentRadioGroup; | ||
|
|
||
| public static SideNav 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 SideNav 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 SideNav 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 UIElement topGap; | ||
|
|
||
| @UI("#fixed-position .mat-sidenav-content mat-form-field input[formcontrolname='bottom']") | ||
| public static UIElement bottomGap; | ||
|
|
||
| public static SideNavSection sidenavBackdropDrawer; | ||
|
|
||
| public static SideNav 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')]") | ||
| public static Button firstElementFocused; | ||
|
|
||
| @UI("//button[.//span[contains(@class, 'mdc-button__label') and text()='Second Element']]") | ||
| public static Button secondElement; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,20 +1,49 @@ | ||||||
| package io.github.epam.angular.tests.elements.complex; | ||||||
|
|
||||||
| import com.epam.jdi.light.angular.elements.composite.MaterialSelectorContainer; | ||||||
| import com.epam.jdi.light.elements.common.UIElement; | ||||||
| import io.github.epam.TestsInit; | ||||||
| import org.testng.annotations.BeforeMethod; | ||||||
| import org.testng.annotations.Ignore; | ||||||
| import org.testng.annotations.Test; | ||||||
|
|
||||||
| import static com.epam.jdi.light.elements.composite.WebPage.refresh; | ||||||
| import static com.jdiai.tools.StringUtils.format; | ||||||
| import static io.github.com.StaticSite.angularPage; | ||||||
| import static io.github.com.pages.sections.SideNavSection.*; | ||||||
| import static io.github.epam.site.steps.States.shouldBeLoggedIn; | ||||||
| import static com.jdiai.tools.Timer.waitCondition; | ||||||
| import static io.github.com.StaticSite.sideNavPage; | ||||||
| import static io.github.com.pages.SideNavPage.autoSizeSideNav; | ||||||
| import static io.github.com.pages.SideNavPage.backDropToggle; | ||||||
| import static io.github.com.pages.SideNavPage.basicDrawer; | ||||||
| import static io.github.com.pages.SideNavPage.basicSideNav; | ||||||
| import static io.github.com.pages.SideNavPage.bottomGap; | ||||||
| import static io.github.com.pages.SideNavPage.configurableMode; | ||||||
| import static io.github.com.pages.SideNavPage.contentRadioGroup; | ||||||
| import static io.github.com.pages.SideNavPage.contentToggle; | ||||||
| import static io.github.com.pages.SideNavPage.customEscapeBackdrop; | ||||||
| import static io.github.com.pages.SideNavPage.firstElement; | ||||||
| import static io.github.com.pages.SideNavPage.firstElementFocused; | ||||||
| import static io.github.com.pages.SideNavPage.fixSideNav; | ||||||
| import static io.github.com.pages.SideNavPage.fixedPosition; | ||||||
| import static io.github.com.pages.SideNavPage.implicitMainContent; | ||||||
| import static io.github.com.pages.SideNavPage.openCloseBehavior; | ||||||
| import static io.github.com.pages.SideNavPage.openSideNav; | ||||||
| import static io.github.com.pages.SideNavPage.responsiveContent; | ||||||
| import static io.github.com.pages.SideNavPage.sideNavFocusSelection; | ||||||
| import static io.github.com.pages.SideNavPage.sideNavOpened; | ||||||
| import static io.github.com.pages.SideNavPage.sideNavPosition; | ||||||
| import static io.github.com.pages.SideNavPage.sideNavRadioGroup; | ||||||
| import static io.github.com.pages.SideNavPage.sideNavToggle; | ||||||
| import static io.github.com.pages.SideNavPage.sideToggle; | ||||||
| import static io.github.com.pages.SideNavPage.sidenavBackdropContainer; | ||||||
| import static io.github.com.pages.SideNavPage.sidenavBackdropDrawer; | ||||||
| import static io.github.com.pages.SideNavPage.toggleAutoNav; | ||||||
| import static io.github.com.pages.SideNavPage.toggleExtraText; | ||||||
| import static io.github.com.pages.SideNavPage.toggleFixedSideNav; | ||||||
| import static io.github.com.pages.SideNavPage.toggleSideNav; | ||||||
| import static io.github.com.pages.SideNavPage.toolbarToggle; | ||||||
| import static io.github.com.pages.SideNavPage.topGap; | ||||||
| import static org.hamcrest.Matchers.containsString; | ||||||
|
|
||||||
| // TODO Move to the new page | ||||||
| @Ignore | ||||||
|
|
||||||
| public class SideNavTests extends TestsInit { | ||||||
|
|
||||||
| public static final String SIDE_NAV_CONTENT = "Sidenav content"; | ||||||
|
|
@@ -28,11 +57,12 @@ public class SideNavTests extends TestsInit { | |||||
|
|
||||||
| @BeforeMethod(alwaysRun = true) | ||||||
|
||||||
| @BeforeMethod(alwaysRun = true) | |
| @BeforeClass(alwaysRun = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
заменил
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не нужно проверять наличие css классов, этот функционал прекрасно работает
если класс что-то значит - должен быть в описании класса
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
очень плохо, что нам нужно использовать классы в тестах, значит, что не сделан метод
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправил
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не надо проверять style, это не стабильно и базовый функционал, который проверяется в html пакете
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрал
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
все еще на месте
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не должно быть UIElement на странице
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убрал все UIElment