-
Notifications
You must be signed in to change notification settings - Fork 48
4952 + 4964: Angular grid list class implementation and refactoring tests #5085
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
Open
b14ckster
wants to merge
37
commits into
angular_rework_development
Choose a base branch
from
angular_grid_list_class_implementation
base: angular_rework_development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
a18ae08
add grid list implementation and refactor tests
b14ckster 95a1554
add grid list implementation and add tests
b14ckster e32700e
refactor code
b14ckster eac88c8
refactor code and implement using new page
b14ckster 854d3a2
implement grid list class and refactor tests
b14ckster 4478d36
refactor imports and enum
b14ckster 260fab6
refactor unit tests
b14ckster dc4d9c9
refactor tests and Element Object
b14ckster e407e9b
hot fix Colors
b14ckster dd6abf5
grid list tests refactoring
b14ckster f2f26c5
refactor asserts
b14ckster b2d62cd
4952-64-refactoringGridListAfterRebase
MayaElf b2f8717
4952-64-refactoringGridListAfterRebase
MayaElf 5be7585
Merge branch 'angular_rework_development' into angular_grid_list_clas…
AlinaLysenko 32ebfa6
Merge branch 'angular_rework_development' into angular_grid_list_clas…
AlinaLysenko d1f6926
gridTile implemented with header, footer and avatar
AlinaLysenko 13595b0
changed cell to tile in naming
AlinaLysenko fe09856
Merge branch 'angular_rework_development' into angular_grid_list_clas…
AlinaLysenko c42148a
fixed comments
AlinaLysenko fa15251
removed unused imports
AlinaLysenko 34b2f5e
Merge branch 'angular_rework_development' into angular_grid_list_clas…
AlinaLysenko c20c5d8
added background colors
AlinaLysenko 763b7b9
text method updated
AlinaLysenko 473ff98
Merge branch 'angular_rework_development' into angular_grid_list_clas…
AlinaLysenko 7125245
option to implement extending UIListBase
AlinaLysenko 1aa6a2d
removed creating variables for actual values for asserts
AlinaLysenko 42db430
added getting footer and header as uiElement. No extra asserts added
AlinaLysenko f219d10
fixed text colors and added names for tiles
AlinaLysenko 2aab439
Merge branch 'angular_rework_development' into angular_grid_list_clas…
AlinaLysenko 7720301
added get content option, removed "in pixels" and changed tileByIngex…
AlinaLysenko bb6f030
removed content option, and separated getting tiles in stream and list
AlinaLysenko b67c3ba
added assertions for grid list and test examples for it
AlinaLysenko 1f0dd27
removed methods itemsWithTexts and textsInItems
AlinaLysenko 9eb0550
Update jdi-light-angular/src/main/java/com/epam/jdi/light/angular/ass…
vklonin eae91ea
Update jdi-light-angular-tests/src/test/java/io/github/epam/angular/t…
vklonin 969e802
added custom tile, fixed empty matcher, removed mismatch message
AlinaLysenko 50a42ae
Merge remote-tracking branch 'origin/angular_grid_list_class_implemen…
AlinaLysenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
jdi-light-angular-tests/src/main/java/io/github/com/pages/GridListPage.java
This file contains hidden or 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,10 @@ | ||
| package io.github.com.pages; | ||
|
|
||
| import com.epam.jdi.light.angular.elements.complex.gridlist.GridList; | ||
| import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI; | ||
|
|
||
| public class GridListPage extends NewAngularPage { | ||
|
|
||
| @UI("#dynamic-grid-list") | ||
| public static GridList dynamicGridList; | ||
| } |
14 changes: 0 additions & 14 deletions
14
jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/GridListSection.java
This file was deleted.
Oops, something went wrong.
95 changes: 49 additions & 46 deletions
95
...ular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/GridListTests.java
This file contains hidden or 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,59 +1,62 @@ | ||
| package io.github.epam.angular.tests.elements.complex; | ||
|
|
||
| import com.epam.jdi.light.angular.elements.enums.AngularColors; | ||
| 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.gridListSection; | ||
| import static io.github.epam.site.steps.States.shouldBeLoggedIn; | ||
| import static io.github.com.enums.Colors.LIGHT_GREEN_2; | ||
| import static io.github.com.enums.Colors.LIGHT_LILAC; | ||
| import static com.jdiai.tools.Timer.waitCondition; | ||
| import static io.github.com.StaticSite.gridListPage; | ||
|
|
||
| import static io.github.com.enums.Colors.LIGHT_PINK; | ||
| import static io.github.com.enums.Colors.WHITE_TRANSPARENT_038; | ||
| import static io.github.com.pages.GridListPage.dynamicGridList; | ||
|
|
||
| // TODO Move to the new page | ||
| @Ignore | ||
| public class GridListTests extends TestsInit { | ||
|
|
||
| @BeforeMethod | ||
| @BeforeClass | ||
| public void before() { | ||
| shouldBeLoggedIn(); | ||
| angularPage.shouldBeOpened(); | ||
| } | ||
|
|
||
| @Test | ||
| public void basicGridListBasicTest() { | ||
| gridListSection.basicGridList.is().displayed(); | ||
| } | ||
|
|
||
| @Test | ||
| public void basicGridListTextTest() { | ||
| gridListSection.basicGridList.get(1).is().text("1"); | ||
| } | ||
|
|
||
| @Test | ||
| public void basicGridListColorTest() { | ||
| gridListSection.basicGridList.get(1) | ||
| .has().css("background-color", "rgba(" + 173 + ", " + 216 + ", " + 230 + ", 1)"); | ||
| } | ||
|
|
||
| @Test | ||
| public void dynamicGridListBasicTest() { | ||
| gridListSection.dynamicGridList.is().displayed(); | ||
| } | ||
|
|
||
| @Test | ||
| public void dynamicGridListTextTest() { | ||
| gridListSection.dynamicGridList.get(1).is().text("One"); | ||
| gridListPage.open(); | ||
| waitCondition(() -> gridListPage.isOpened()); | ||
| gridListPage.checkOpened(); | ||
| } | ||
|
|
||
| @Test | ||
| public void dynamicGridListColorTest() { | ||
| gridListSection.dynamicGridList.get(1) | ||
| .has().css("background-color", "rgba(" + 173 + ", " + 216 + ", " + 230 + ", 1)"); | ||
| gridListSection.dynamicGridList.get(2) | ||
| .has().css("background-color", "rgba(" + 144 + ", " + 238 + ", " + 144 + ", 1)"); | ||
| gridListSection.dynamicGridList.get(3) | ||
| .has().css("background-color", "rgba(" + 255 + ", " + 182 + ", " + 193 + ", 1)"); | ||
| gridListSection.dynamicGridList.get(4) | ||
| .has().css("background-color", "rgba(" + 221 + ", " + 189 + ", " + 241 + ", 1)"); | ||
| @Test(description = "Test checks dynamic grid list attributes") | ||
| public void dynamicGridListTest() { | ||
| dynamicGridList.shouldBe().displayed(); | ||
| dynamicGridList.show(); | ||
| dynamicGridList.shouldBe().visible(); | ||
|
|
||
| dynamicGridList.has().cols(4) | ||
| .and().rowHeight("100px") | ||
| .and().gutterSize("10px") | ||
|
|
||
| .and().tileText(1, "One") | ||
| .and().tileText(4, "Four") | ||
|
|
||
| .and().tileColor(2, AngularColors.fromColor(LIGHT_GREEN_2.value())) | ||
| .and().tileColor(4, AngularColors.fromColor(LIGHT_LILAC.value())) | ||
|
|
||
| .and().tileColspan(1, 3) | ||
| .and().tileColspan(2, 1) | ||
| .and().tileColspan(4, 2) | ||
|
|
||
| .and().tileRowspan(1, 1) | ||
| .and().tileRowspan(2, 2) | ||
|
|
||
| .and().tileHasAvatar(2) | ||
| .and().tileAvatarUrl(2,"https://material.angular.io/assets/img/examples/shiba2.jpg"); | ||
|
|
||
| dynamicGridList.tileByIndex(3) | ||
| .is().colspan(1) | ||
| .and().rowspan(1) | ||
| .and().color(AngularColors.fromColor(LIGHT_PINK.value())) | ||
| .and().footerColor(AngularColors.fromColor(WHITE_TRANSPARENT_038.value())) | ||
| .and().headerColor(AngularColors.fromColor(WHITE_TRANSPARENT_038.value())) | ||
| .and().text("Three") | ||
| .and().footerText("Mat Grid Footer") | ||
| .and().headerText("Mat Grid Header"); | ||
| } | ||
| } |
122 changes: 122 additions & 0 deletions
122
...ght-angular/src/main/java/com/epam/jdi/light/angular/asserts/gridlist/GridListAssert.java
This file contains hidden or 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,122 @@ | ||
| package com.epam.jdi.light.angular.asserts.gridlist; | ||
|
|
||
| import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; | ||
|
|
||
| import com.epam.jdi.light.angular.elements.complex.gridlist.GridList; | ||
| import com.epam.jdi.light.angular.elements.enums.AngularColors; | ||
| import com.epam.jdi.light.asserts.generic.UIAssert; | ||
| import com.epam.jdi.light.common.JDIAction; | ||
| import org.hamcrest.Matchers; | ||
|
|
||
| public class GridListAssert extends UIAssert<GridListAssert, GridList> { | ||
|
|
||
| @JDIAction("Assert that '{name}' has number of columns '{0}'") | ||
|
vklonin marked this conversation as resolved.
Outdated
|
||
| public GridListAssert cols(int expectedCols) { | ||
| int actualNumberOfColumns = element().cols(); | ||
| jdiAssert(actualNumberOfColumns, Matchers.is(expectedCols), | ||
| String.format("\nActual number of columns in Grid List: '%s'\n" + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. стандартное сообщение матчера нормальное, к нему все привыкли |
||
| "is not equal to expected: '%s'", actualNumberOfColumns, expectedCols)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that '{name}' has row's height '{0}'") | ||
| public GridListAssert rowHeight(String expectedRowHeight) { | ||
| String actualRowHeight = element().rowHeight(); | ||
| jdiAssert(actualRowHeight, Matchers.is(expectedRowHeight)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that '{name}' has gutter size '{0}'") | ||
| public GridListAssert gutterSize(String expectedGutterSize) { | ||
| String actualGutterSize = element().gutterSize(); | ||
| jdiAssert(actualGutterSize, Matchers.is(expectedGutterSize)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has number of columns '{1}'") | ||
|
vklonin marked this conversation as resolved.
Outdated
|
||
| public GridListAssert tileColspan(int tileIndex, int expectedColspan) { | ||
| int actualNumberOfColumns = element().tileByIndex(tileIndex).getColspan(); | ||
| jdiAssert(actualNumberOfColumns, Matchers.is(expectedColspan)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has number of rows '{1}'") | ||
| public GridListAssert tileRowspan(int tileIndex, int expectedRowspan) { | ||
| int actualNumberOfRows = element().tileByIndex(tileIndex).getRowspan(); | ||
| jdiAssert(actualNumberOfRows, Matchers.is(expectedRowspan)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has text '{1}'") | ||
| public GridListAssert tileText(int tileIndex, String expectedText) { | ||
| String actualText = element().tileByIndex(tileIndex).getText(); | ||
| jdiAssert(actualText, Matchers.is(expectedText)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has background color '{1}'") | ||
| public GridListAssert tileColor(int tileIndex, String expectedColor) { | ||
| String actualColor = element().tileByIndex(tileIndex).color(); | ||
| jdiAssert(actualColor, Matchers.is(expectedColor)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has background color '{1}'") | ||
| public GridListAssert tileColor(int tileIndex, AngularColors expectedColor) { | ||
| AngularColors actualColor = element().tileByIndex(tileIndex).angularColor(); | ||
| jdiAssert(actualColor, Matchers.is(expectedColor)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has header color '{1}'") | ||
| public GridListAssert headerColor(int tileIndex, String expectedColor) { | ||
| String actualColor = element().tileByIndex(tileIndex).headerColor(); | ||
| jdiAssert(actualColor, Matchers.is(expectedColor)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has header color '{1}'") | ||
| public GridListAssert headerColor(int tileIndex, AngularColors expectedColor) { | ||
| AngularColors actualColor = element().tileByIndex(tileIndex).headerAngularColor(); | ||
| jdiAssert(actualColor, Matchers.is(expectedColor)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has footer color '{1}'") | ||
| public GridListAssert footerColor(int tileIndex, String expectedColor) { | ||
| String actualColor = element().tileByIndex(tileIndex).footerColor(); | ||
| jdiAssert(actualColor, Matchers.is(expectedColor)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has footer color '{1}'") | ||
| public GridListAssert footerColor(int tileIndex, AngularColors expectedColor) { | ||
| AngularColors actualColor = element().tileByIndex(tileIndex).footerAngularColor(); | ||
| jdiAssert(actualColor, Matchers.is(expectedColor)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} header text is '{1}'") | ||
| public GridListAssert tileHeaderText(int tileIndex, String expectedText) { | ||
| jdiAssert(element().tileByIndex(tileIndex).headerText(), Matchers.is(expectedText)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} footer text is '{1}'") | ||
| public GridListAssert tileFooterText(int tileIndex, String expectedText) { | ||
| jdiAssert(element().tileByIndex(tileIndex).footerText(), Matchers.is(expectedText)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} has avatar") | ||
| public GridListAssert tileHasAvatar(int tileIndex) { | ||
| jdiAssert(element().tileByIndex(tileIndex).hasAvatar(), Matchers.is(true)); | ||
| return this; | ||
| } | ||
|
|
||
| @JDIAction("Assert that in '{name}' tile#{0} avatar url is {1}") | ||
| public GridListAssert tileAvatarUrl(int tileIndex, String url) { | ||
| jdiAssert(element().tileByIndex(tileIndex).avatarUrl(), Matchers.is(url)); | ||
| return this; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.