Skip to content

Commit

Permalink
improvments in DividerTests
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Vlasiuk committed Dec 6, 2023
1 parent ac62b1b commit 9dc3884
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package io.github.com.pages;

import com.epam.jdi.light.angular.elements.common.Divider;
import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.common.Label;
import com.epam.jdi.light.elements.complex.JList;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;

public class DividerPage extends NewAngularPage {

@UI("/descendant::h3[1]")
public static UIElement textWithDefaultDividers;
@UI("h2.example-h2")
public static Label textWithBasicDivider;

@UI("#divider-list:first-of-type > mat-divider[role=\"separator\"]")
public static JList<Divider> defaultDividersSeparators;
public static JList<Divider> defaultDividers;

@UI("#divider-list:nth-of-type(2) > mat-divider[role=\"separator\"]")
public static JList<Divider> insetDividerSeparators;
public static JList<Divider> insetDivider;

@UI(".vertical-dividers > mat-divider[role=\"separator\"]")
public static JList<Divider> verticalDividerSeparators;
public static JList<Divider> verticalDivider;

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import static com.jdiai.tools.Timer.waitCondition;
import static io.github.com.StaticSite.dividerPage;
import static io.github.com.pages.DividerPage.defaultDividersSeparators;
import static io.github.com.pages.DividerPage.insetDividerSeparators;
import static io.github.com.pages.DividerPage.textWithDefaultDividers;
import static io.github.com.pages.DividerPage.verticalDividerSeparators;
import static io.github.com.pages.DividerPage.defaultDividers;
import static io.github.com.pages.DividerPage.insetDivider;
import static io.github.com.pages.DividerPage.textWithBasicDivider;
import static io.github.com.pages.DividerPage.verticalDivider;
import static org.hamcrest.Matchers.equalTo;

public class DividerTests extends TestsInit {
Expand All @@ -19,27 +19,27 @@ public void before() {
dividerPage.open();
waitCondition(() -> dividerPage.isOpened());
dividerPage.checkOpened();
textWithDefaultDividers.show();
textWithBasicDivider.show();
}

@Test(description = "Test checks that default divider has horizontal property")
public void defaultDividersTest() {
defaultDividersSeparators.has().size(equalTo(2));
defaultDividersSeparators.get(1).is().horizontal();
defaultDividersSeparators.get(2).is().horizontal();
defaultDividers.has().size(equalTo(2));
defaultDividers.get(1).is().horizontal();
defaultDividers.get(2).is().horizontal();
}

@Test(description = "Test checks that inset divider has inset property")
public void insetDividersTest() {
insetDividerSeparators.has().size(equalTo(2));
insetDividerSeparators.get(1).has().inset();
insetDividerSeparators.get(2).has().inset();
insetDivider.has().size(equalTo(2));
insetDivider.get(1).has().inset();
insetDivider.get(2).has().inset();
}

@Test(description = "Test checks that vertical divider has vertical property")
public void verticalDividerTest() {
verticalDividerSeparators.has().size(equalTo(2));
verticalDividerSeparators.get(1).is().vertical();
verticalDividerSeparators.get(2).is().vertical();
verticalDivider.has().size(equalTo(2));
verticalDivider.get(1).is().vertical();
verticalDivider.get(2).is().vertical();
}
}

0 comments on commit 9dc3884

Please sign in to comment.