Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded search among testcases in html report #600
Conversation
| @@ -12,6 +12,10 @@ | |||
|
|
|||
| &__title { | |||
| padding: 0 15px 10px; | |||
| width:100%; | |||
| display: table; | |||
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 21, 2017
Member
Could we use display: flex; here? It would simplify the underlying code.
This comment has been minimized.
This comment has been minimized.
cakeinpanic
Sep 21, 2017
Author
Contributor
of course! i couldn't find information about browser support for report, so did it in oldschool way)
| initialize({onSearch, searchQuery}) { | ||
| this.onSearch = onSearch; | ||
|
|
||
| this.searchQuery = searchQuery; |
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 21, 2017
Member
You could pass a model here instead of searchQuery/onSearch.
@baev do you like it?
This comment has been minimized.
This comment has been minimized.
cakeinpanic
Sep 21, 2017
Author
Contributor
by the way, searchQuery is not needed to be passed, it left from the time I tried to re-rended this componentn on each state change
| if (this.searchQuery) { | ||
| this.$('.node__title').each((i, node) => { | ||
| this.$(node).parent().addClass('node__expanded'); | ||
| }); |
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 21, 2017
Member
Something weird is happening here.
@baev do we have expanded state stored in model?
This comment has been minimized.
This comment has been minimized.
cakeinpanic
Sep 21, 2017
Author
Contributor
yes, when user clicks on a node, its state is stored, but i decided that better way is to force opening all nodes when search is in progress
This comment has been minimized.
This comment has been minimized.
cakeinpanic
Sep 21, 2017
Author
Contributor
when search is finished, i restore previous state.
I already see bug here – if user toggles nodes by click while he is in search mode, this state is saved and then will be restored incorrectly.
| } | ||
|
|
||
| onRender() { | ||
| this.$('input').val(this.searchQuery); |
This comment has been minimized.
This comment has been minimized.
|
Refactored using |
| @@ -7,7 +7,7 @@ | |||
| "build": "webpack --optimize-minimize", | |||
| "start": "webpack-dev-server --inline --hot --env.development", | |||
| "pretest": "eslint --ignore-path=.gitignore .", | |||
| "test": "jest", | |||
| "test": "jest --colors", | |||
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 25, 2017
•
Member
It breaks console output in Jenkins logs.
Would be better not to commit such changes.
This comment has been minimized.
This comment has been minimized.
cakeinpanic
Sep 25, 2017
Author
Contributor
oh wow, couldn't imagine that can break anythig. For local development is a musthave option, otherwise log is not readable(
there probably shuoul be added some gradlew flag or something like this, i'll research this
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 25, 2017
Member
As Gradle is involved here, I have nothing to say. Usually I ran tests via npm test directly out of allure-generator folder.
|
|
||
| close() { | ||
| this.settings.setSearchQuery(''); | ||
| } |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| })); | ||
|
|
||
| this.showChildView('search', new NodeSearchView({ | ||
| settings: this.settings |
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 25, 2017
Member
Instead of settings, the state modal should be used. Then you will not need to introduce an extra saveTemporary method.
This comment has been minimized.
This comment has been minimized.
cakeinpanic
Sep 25, 2017
Author
Contributor
I agree that extending LocalStorageModel is not the best way, but on the other side we store all settings(and searchQuery and filtering options are the same level settings) in one place.
But i'll do as you say.
This comment has been minimized.
This comment has been minimized.
just-boris
Sep 25, 2017
Member
We are doing different separation of concerns here:
- settings is for all data, that should be saved as user preference
- state is a current state of UI (opened tree nodes, selected testcase, now is also search). It will not be saved in LocalStorage, but can be reflected in the URL, for example
|
found and fixed display bug, which caused tree re-render on each node folding |
sskorol
commented
Sep 27, 2017
|
looks cool |
|
@baev looking forward for merge & release) |
|
LGTM in general, we definitely will merge this. But I need more time to get deeper look at this |
| function byText(text) { |
This comment has been minimized.
This comment has been minimized.
|
Okay, waiting! |
|
@cakeinpanic thanks! |
cakeinpanic commentedSep 20, 2017
•
edited
We are using allure at work and suffer from lack of routing or at least search among test cases.
When we want to show someone specific allure report, we need to specify testcase and its parent, which is not very convenient
So i've added simple filtering on frontend, look how it works:

I also need to add some unit tests, but as soon as I decided not to store
searchQueryatsettings(cause it shouldn't be remembered on page refresh), I couldn't write units fast.Maybe you can give me some advice about it?
Looking forward for merge to start using it)