-
Notifications
You must be signed in to change notification settings - Fork 48
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
Validation if status codes comparators parameters were provided #296
Validation if status codes comparators parameters were provided #296
Conversation
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.
Actually, it looks that this filter works a little different than docs says.
If user does not provide filterRange
or filterCodes
the default range is checked, which is 0 - 600
.
We would like to keep this behavior.
Instead of making validation here, please update Status Codes Comparator docs and describe how it works, that parameters are optional and what's the behavior if none of parameters is defined.
Bonus: what happens if user define both: filterRange
and filterCodes
?
As discussed with @Skejven - the default range should be changed to 400-600, because |
…resion in status code filter
fd9caf4
to
e34670c
Compare
| `showExcluded` | boolean (default: `true`) | true | Flag that says if excluded codes (see [[Status Codes Data Filters | StatusCodesDataFilters]]) should be displayed in report. By default set to `true`. | no | | ||
If you provide `filterRange` and `filterCodes`, it will be used as logical sum. It means that `filterRange="400,500"` `filterCodes=501,502` is equivalent to `filterRange="400,502"` but for `filterRange="300,400"` `filterCodes=404` all codes between `401-403` won`t be checked. |
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.
Please leave a blank line between the table and that sentence. There is something wrong with layout without it.
Please change this sentence to:
If you provide both
filterRange
andfilterCodes
, it will be used as logical sum. It means that:
<status-codes filterRange="400,500" filterCodes="501,502" />
is equivalent to<status-codes filterRange="400,502" />
<status-codes filterRange="300,400" filterCodes="404" />
won't check401-403
codes.
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.
Please update CHANGELOG according to AET Contributing rules
<url href="comparators/statuscodes/noneexistingPage.jsp"/> | ||
</urls> | ||
</test> | ||
|
||
<test name="F-comparator-StatusCodes-200-success" useProxy="rest"> |
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.
We have new test added here.
Please update also our integration tests (functional).
…sCodesComparators_parameters_were_provided
CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ All notable changes to AET will be documented in this file. | |||
## Unreleased | |||
**List of changes that are finished but not yet released in any final version.** | |||
|
|||
- [PR-296](https://github.com/Cognifide/aet/pull/296) The behavior of StatusCodesComparator was changed |
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.
Could you please add more information here?
E.g.
Status Code Comparator check now range
400-600
by default, parameters validation added
@@ -96,7 +96,7 @@ public void setUp() { | |||
@Test |
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.
There are some issues with this test. Could we resolve them in this pull request?
It looks like dataResult
mock is never used (or am I wrong?).
Also: it looks strange when whe change from failed to passed. Why is that?
Currently we are not testing much here. It might be a good time to improve this test.
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.
I added some tests. The change from failed to passed is the result of changed logic expression when we have both filterCodes and filterRange - before, we had AND between range and codes, now we have OR ;)
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.
Thank you! That is great! I had some more ideas (pull request #305). Maybe you would like to get some of them into your feature branch?
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.
Definitely! Thank you so much for your help :D
@@ -55,8 +55,8 @@ Feature: Tests Results Filtering | |||
Scenario: Filtering Tests Results: status-codes | |||
Given I have opened sample tests report page | |||
When I search for tests containing "status" | |||
Then There are 20 tiles visible | |||
And Statistics text contains "20 ( 8 / 0 / 12 / 0 )" | |||
Then There are 21 tiles visible |
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.
Thank you for this! :)
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.
Your welcome ;)
@@ -1,5 +1,7 @@ | |||
#### Status Codes Data Filters | |||
|
|||
Data filters will be apply only for codes contained in the `filterange`. If the `filterRange` isn't provided, default range will be used. |
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.
Please fix the filterange
typo.
What about codes contained in the filterCodes
parameter - will data filters be applied for them?
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.
Updated
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.
Before merging to master
please merge #305 to this branch first.
Ideas for pull request #296
…eters_were_provided
I created validation for StatusCodesComparator`s parameters
Description
I added validation and changed test to be consistent with documentation
Motivation and Context
This change provide validation if mandatory arguments were provided
Screenshots (if appropriate):
Types of changes
Checklist:
I hereby agree to the terms of the AET Contributor License Agreement.