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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 from 2004c9e to 56957c0 Compare February 14, 2025 17:17
@vkepin vkepin force-pushed the add_comparison_rules branch 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("<=")

?

@@ -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(">=")

?

@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.72%. Comparing base (1072d4a) to head (ed69dc5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5726      +/-   ##
============================================
- Coverage     97.73%   97.72%   -0.01%     
  Complexity     7177     7177              
============================================
  Files           993      993              
  Lines         20823    20827       +4     
  Branches       1365     1365              
============================================
+ Hits          20351    20354       +3     
- Misses          362      363       +1     
  Partials        110      110              

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

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