Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix empty categories tree (fixes #400) #402

Merged
merged 1 commit into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<div class="{{b 'status-toggle' 'items'}}">
{{t 'component.tree.filter'}}:
{{#each statuses}}
{{#if count}}
<div class="{{b 'status-toggle' 'item'}}">
{{#if active}}
<span class="y-label y-label_status_{{status}}" data-status="{{status}}"
data-tooltip="{{t 'component.statusToggle.hideCases' status=statusName}}">{{count}}</span>
{{else}}
<span class="n-label n-label_status_{{status}}" data-status="{{status}}"
data-tooltip="{{t 'component.statusToggle.showCases' status=statusName}}">{{count}}</span>
{{/if}}
</div>
<div class="{{b 'status-toggle' 'item'}}">
{{#if active}}
<span class="y-label y-label_status_{{status}}" data-status="{{status}}"
data-tooltip="{{t 'component.statusToggle.hideCases' status=statusName}}">{{count}}</span>
{{else}}
<span class="n-label n-label_status_{{status}}" data-status="{{status}}"
data-tooltip="{{t 'component.statusToggle.showCases' status=statusName}}">{{count}}</span>
{{/if}}
</div>
{{/each}}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class TreeView extends View {
const showGroupInfo = settings.get('showGroupInfo');
const shownCases = this.collection.testcases.length;
const totalCases = this.collection.allTestcases.length;

return {
baseUrl: this.baseUrl,
showGroupInfo: showGroupInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export default class TreeCollection extends Collection {
}

parse({time, statistic, children}) {
this.allTestcases = this.getFlattenTestcases(children);
this.allNodes = children;
const items = children || [];
this.allTestcases = this.getFlattenTestcases(items);
this.allNodes = items;
this.time = time;
this.statistic = statistic;
return children;
return items;
}

applyFilterAndSorting(statuses, sortSettings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import io.qameta.allure.context.RandomUidContext;
import io.qameta.allure.core.Configuration;
import io.qameta.allure.core.LaunchResults;
import io.qameta.allure.entity.GroupTime;
import io.qameta.allure.entity.Statistic;
import io.qameta.allure.entity.StatusDetails;
import io.qameta.allure.entity.TestResult;

Expand Down Expand Up @@ -39,7 +41,11 @@ public void aggregate(final Configuration configuration,

protected TreeData getData(final Supplier<String> uidGenerator,
final List<LaunchResults> launches) {
final TreeData tree = new TreeData();
final TreeData tree = new TreeData()
.withTime(new GroupTime())
.withStatistic(new Statistic())
.withChildren(new ArrayList<>());

launches.stream()
.flatMap(launch -> launch.getResults().stream())
.forEach(result -> addResultToTree(uidGenerator, tree, result));
Expand Down