-
Notifications
You must be signed in to change notification settings - Fork 47
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
4903: tests refactoring BADGE #5023
Merged
pnatashap
merged 11 commits into
angular_rework_development
from
4903_Tests_refactoring_BADGE_element
Sep 13, 2023
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
01e3ac0
4903: tests refactoring BADGE
Kate-Semenova 7ca902f
4903: tests refactoring BADGE. fix 4
Kate-Semenova 7dd0cf8
Merge branch 'angular_rework_development' into 4903_Tests_refactoring…
pnatashap 2ef5254
Delete unit's
pnatashap d1f969d
Merge branch 'angular_rework_development' into 4903_Tests_refactoring…
pnatashap f45cc02
Fix of interface
pnatashap cd2ec33
Remove unused imports
pnatashap f8da2a3
Fix style
pnatashap 2c339f6
Badge tests
vklonin e5197e5
fixed error
vklonin 7c61990
refactored icon and button
vklonin 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 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
17 changes: 17 additions & 0 deletions
17
jdi-light-angular-tests/src/main/java/io/github/com/pages/BadgePage.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,17 @@ | ||
package io.github.com.pages; | ||
|
||
import com.epam.jdi.light.angular.elements.common.Badge; | ||
|
||
public class BadgePage extends NewAngularPage { | ||
|
||
public static Badge textWithBadge; | ||
public static Badge buttonWithBadge; | ||
public static Badge iconWithBadge; | ||
public static Badge largeBadge; | ||
public static Badge smallBadge; | ||
public static Badge customSizeBadge; | ||
public static Badge bellowPositionBadge; | ||
public static Badge toggleVisibilityBadge; | ||
public static Badge toggleDisabledBadge; | ||
|
||
} |
10 changes: 0 additions & 10 deletions
10
jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/BadgeSection.java
This file was deleted.
Oops, something went wrong.
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
68 changes: 65 additions & 3 deletions
68
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/BadgeAssert.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,17 +1,79 @@ | ||
package com.epam.jdi.light.angular.asserts; | ||
|
||
import com.epam.jdi.light.angular.elements.common.Badge; | ||
import com.epam.jdi.light.angular.elements.enums.BadgePosition; | ||
import com.epam.jdi.light.angular.elements.enums.BadgeSize; | ||
import com.epam.jdi.light.asserts.generic.UIAssert; | ||
import com.epam.jdi.light.common.JDIAction; | ||
import org.hamcrest.Matchers; | ||
|
||
import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; | ||
import static java.lang.String.format; | ||
|
||
public class BadgeAssert extends UIAssert<BadgeAssert, Badge> { | ||
public class BadgeAssert extends UIAssert<BadgeAssert, Badge> { | ||
|
||
@JDIAction("'{name}' has '{0}' color") | ||
@JDIAction("Assert that '{name}' has '{0}' color") | ||
public BadgeAssert color(String value) { | ||
jdiAssert(element().color(value), Matchers.is(true)); | ||
String actualColor = element().color(); | ||
jdiAssert(actualColor, Matchers.equalTo(value), format("%s is not equal to %s", actualColor, value)); | ||
return this; | ||
} | ||
|
||
@JDIAction("Assert that '{name}' has '{0}' size") | ||
public BadgeAssert size(BadgeSize size) { | ||
final BadgeSize actualBadgeSize = element().size(); | ||
jdiAssert(actualBadgeSize, Matchers.is(size), format("%s is not equal to %s", actualBadgeSize, size)); | ||
return this; | ||
|
||
} | ||
|
||
@JDIAction("Assert that '{name}' has '{0}' position (vertical)") | ||
public BadgeAssert positionVertical(BadgePosition value) { | ||
final BadgePosition actualPosition = element().positionVertical(); | ||
jdiAssert(actualPosition, Matchers.is(value), format("%s is not equal to %s", actualPosition, value)); | ||
return this; | ||
|
||
} | ||
|
||
@JDIAction("Assert that '{name}' has '{0}' position (horizontal)") | ||
public BadgeAssert positionHorizontal(BadgePosition value) { | ||
final BadgePosition actualPosition = element().positionHorizontal(); | ||
jdiAssert(actualPosition, Matchers.is(value), format("%s is not equal to %s", actualPosition, value)); | ||
return this; | ||
|
||
} | ||
|
||
@JDIAction("Assert that '{name}' is overlap: {0}") | ||
public BadgeAssert overlap(boolean value) { | ||
jdiAssert(element().isOverlap(), Matchers.is(value), value ? "should be overlap" : "should NOT be overlap"); | ||
return this; | ||
} | ||
|
||
@Override | ||
@JDIAction("Assert that '{name}' is displayed") | ||
public BadgeAssert displayed() { | ||
jdiAssert(element().isDisplayed(), Matchers.is(true), "should be displayed"); | ||
return super.displayed(); | ||
} | ||
|
||
@Override | ||
@JDIAction("Assert that '{name}' is enabled") | ||
public BadgeAssert enabled() { | ||
jdiAssert(element().isEnabled(), Matchers.is(true), "should be enabled"); | ||
return super.enabled(); | ||
} | ||
|
||
@Override | ||
@JDIAction("Assert that '{name}' is disabled") | ||
public BadgeAssert disabled() { | ||
jdiAssert(element().isDisabled(), Matchers.is(true), "should be disabled"); | ||
return this; | ||
} | ||
|
||
@JDIAction("Assert that '{name}' has text {0}") | ||
public BadgeAssert text(String value) { | ||
final String actualText = element().getText(); | ||
jdiAssert(actualText, Matchers.is(value), format("%s is not equal to %s", actualText, value)); | ||
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.
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.
if this is icon badge, we should have a validation for icon, if not, there is no difference with buttonWithBadge and should be removed