-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5241 from jdi-testing/4941-Test-refactoring-Divid…
…er-element [WIP] 4941 test refactoring divider element
- Loading branch information
Showing
7 changed files
with
130 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
jdi-light-angular-tests/src/main/java/io/github/com/pages/DividerPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.github.com.pages; | ||
|
||
import com.epam.jdi.light.angular.elements.common.Divider; | ||
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("h2.example-h2") | ||
public static Label textWithBasicDivider; | ||
|
||
@UI("#divider-list:first-of-type > mat-divider[role=\"separator\"]") | ||
public static JList<Divider> defaultDividers; | ||
|
||
@UI("#divider-list:nth-of-type(2) > mat-divider[role=\"separator\"]") | ||
public static JList<Divider> insetDivider; | ||
|
||
@UI(".vertical-dividers > mat-divider[role=\"separator\"]") | ||
public static JList<Divider> verticalDivider; | ||
|
||
} |
12 changes: 0 additions & 12 deletions
12
jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/DividerSection.java
This file was deleted.
Oops, something went wrong.
49 changes: 30 additions & 19 deletions
49
...ngular-tests/src/test/java/io/github/epam/angular/tests/elements/common/DividerTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
package io.github.epam.angular.tests.elements.common; | ||
|
||
import io.github.epam.TestsInit; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Ignore; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import static io.github.com.StaticSite.angularPage; | ||
import static io.github.com.pages.AngularPage.dividerSection; | ||
import static io.github.epam.site.steps.States.shouldBeLoggedIn; | ||
import static com.jdiai.tools.Timer.waitCondition; | ||
import static io.github.com.StaticSite.dividerPage; | ||
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; | ||
|
||
// TODO Move to the new page | ||
@Ignore | ||
public class DividerTests extends TestsInit { | ||
|
||
@BeforeMethod(alwaysRun = true) | ||
@BeforeClass(alwaysRun = true) | ||
public void before() { | ||
shouldBeLoggedIn(); | ||
angularPage.shouldBeOpened(); | ||
dividerPage.open(); | ||
waitCondition(() -> dividerPage.isOpened()); | ||
dividerPage.checkOpened(); | ||
textWithBasicDivider.show(); | ||
} | ||
|
||
@Test | ||
public void dividerDisplayTest() { | ||
dividerSection.dividers.has().size(equalTo(2)); | ||
dividerSection.dividers.get(1).is().displayed(); | ||
dividerSection.dividers.get(2).is().displayed(); | ||
@Test(description = "Test checks that default divider has horizontal property") | ||
public void defaultDividersTest() { | ||
defaultDividers.waitFor().displayed(); | ||
defaultDividers.has().size(equalTo(2)); | ||
defaultDividers.get(1).is().horizontal(); | ||
defaultDividers.get(2).is().horizontal(); | ||
} | ||
|
||
@Test | ||
public void dividerHorizontalOrientationTest() { | ||
dividerSection.dividers.get(1).is().horizontal(); | ||
dividerSection.dividers.get(2).is().horizontal(); | ||
@Test(description = "Test checks that inset divider has inset property") | ||
public void insetDividersTest() { | ||
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() { | ||
verticalDivider.has().size(equalTo(2)); | ||
verticalDivider.get(1).is().vertical(); | ||
verticalDivider.get(2).is().vertical(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters