Skip to content
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

Add 'at most' and 'at least' aliases for comparison rules #5726

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

vkepin
Copy link
Contributor

@vkepin vkepin commented Feb 14, 2025

No description provided.

@vkepin vkepin requested a review from a team as a code owner February 14, 2025 17:03
@vkepin vkepin linked an issue Feb 14, 2025 that may be closed by this pull request
@vkepin vkepin force-pushed the add_comparison_rules branch 2 times, most recently from 56957c0 to ed69dc5 Compare February 14, 2025 17:45
@@ -40,6 +40,14 @@ public <T extends Comparable<T>> Matcher<T> getComparisonRule(T variable)
return Matchers.lessThanOrEqualTo(variable);
}
},
AT_MOST("at most")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AT_MOST("at most")
AT_MOST("<=")

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was done to return LESS_THAN_OR_EQUAL_TO value in fromString method for '<=' sign regardless of the order of declaration of elements in enum

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, then just add null alias, and add processing of null-s

@@ -56,6 +64,14 @@ public <T extends Comparable<T>> Matcher<T> getComparisonRule(T variable)
return Matchers.greaterThanOrEqualTo(variable);
}
},
AT_LEAST("at least")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AT_LEAST("at least")
AT_LEAST(">=")

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Override
public <T extends Comparable<T>> Matcher<T> getComparisonRule(T variable)
{
return Matchers.lessThanOrEqualTo(variable);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Matchers.lessThanOrEqualTo(variable);
return ComparisonRule.LESS_THAN_OR_EQUAL_TO.getComparisonRule(variable);

@Override
public <T extends Comparable<T>> Matcher<T> getComparisonRule(T variable)
{
return Matchers.greaterThanOrEqualTo(variable);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Matchers.greaterThanOrEqualTo(variable);
return ComparisonRule.GREATER_THAN_OR_EQUAL_TO.getComparisonRule(variable);

Comment on lines 51 to 58
Then `${details.networkState}` is at least `1`
Then `${details.src}` matches `.+/video/countdown\.mp4`
When I play video in video player located by `<videoLocator>`
Then element located by `<videoLocator>` exists for `PT1S` duration
When I save info from video player located by `<videoLocator>` to SCENARIO variable `details`
Then `${details.currentTime}` is > `${rewindTime}`
Then `${details.duration}` is > `8`
Then `${details.networkState}` is >= `1`
Then `${details.networkState}` is at least `1`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't have much sense logically, it's better to change some tests from DynamicVariablesTests.story

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.73%. Comparing base (1072d4a) to head (435c88c).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5726   +/-   ##
=========================================
  Coverage     97.73%   97.73%           
- Complexity     7177     7179    +2     
=========================================
  Files           993      993           
  Lines         20823    20825    +2     
  Branches       1365     1366    +1     
=========================================
+ Hits          20351    20353    +2     
  Misses          362      362           
  Partials        110      110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vkepin vkepin force-pushed the add_comparison_rules branch from ed69dc5 to f198d8b Compare February 17, 2025 14:11
@vkepin vkepin force-pushed the add_comparison_rules branch from 6262469 to 435c88c Compare February 18, 2025 11:10
@valfirst valfirst merged commit 24fe395 into vividus-framework:master Feb 19, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add aliases for comparison rules
2 participants