★ wanayoo — archive 1999 https://github.com/allure-framework/allure2/pull/600Nouvelle recherche | Portail wanayoo
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

Added search among testcases in html report #600

Merged
merged 12 commits into from Oct 8, 2017

Conversation

@cakeinpanic
Copy link
Contributor

cakeinpanic commented Sep 20, 2017 •

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:
preview

I also need to add some unit tests, but as soon as I decided not to storesearchQuery at settings(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)

@@ -12,6 +12,10 @@

&__title {
padding: 0 15px 10px;
width:100%;
display: table;

This comment has been minimized.

@just-boris

just-boris Sep 21, 2017

Member

Could we use display: flex; here? It would simplify the underlying code.

This comment has been minimized.

@cakeinpanic

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.

@just-boris

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.

@cakeinpanic

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.

@just-boris

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.

@cakeinpanic

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.

@cakeinpanic

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.

@cakeinpanic

cakeinpanic Sep 21, 2017

Author Contributor

this should be gone, useless now

@baev baev requested a review from sseliverstov Sep 21, 2017
@cakeinpanic
Copy link
Contributor Author

cakeinpanic commented Sep 24, 2017

Refactored using settings model, added unit test
We are really waiting for this feature, I'm interested in merging it)

@just-boris @baev @sseliverstov

@@ -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.

@just-boris

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.

@cakeinpanic

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.

@just-boris

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.

@just-boris

just-boris Sep 25, 2017

Member

Is this used?

This comment has been minimized.

@cakeinpanic

cakeinpanic Sep 25, 2017

Author Contributor

not now, added just in case

}));

this.showChildView('search', new NodeSearchView({
settings: this.settings

This comment has been minimized.

@just-boris

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.

@cakeinpanic

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.

@just-boris

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
@cakeinpanic cakeinpanic force-pushed the cakeinpanic:master branch from 5c5c925 to cd4fad0 Sep 26, 2017
@cakeinpanic
Copy link
Contributor Author

cakeinpanic commented Sep 26, 2017

found and fixed display bug, which caused tree re-render on each node folding

@sskorol
Copy link

sskorol commented Sep 27, 2017

looks cool 👍

@cakeinpanic
Copy link
Contributor Author

cakeinpanic commented Sep 27, 2017

@baev looking forward for merge & release)

@baev
baev approved these changes Sep 28, 2017
Copy link
Member

baev left a comment

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.

@baev

baev Sep 28, 2017

Member

byName

@cakeinpanic
Copy link
Contributor Author

cakeinpanic commented Oct 5, 2017

Okay, waiting!
Our testers literally cant work with allure reports because of this(

@baev baev merged commit 68ac944 into allure-framework:master Oct 8, 2017
2 checks passed
2 checks passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details
@baev
Copy link
Member

baev commented Oct 8, 2017

@cakeinpanic thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.