Skip to content

Commit c039519

Browse files
author
Hilscher, Robert
committed
Fix for firefox there was no posibility to close chart
1 parent b5dc67c commit c039519

File tree

4 files changed

+127
-27
lines changed

4 files changed

+127
-27
lines changed

lib/html_formatter.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,32 +151,34 @@ module.exports = (function() {
151151
stepsNumberInFeature = 0;
152152
passedStepsInFeature = 0;
153153

154-
for (var j = 0; j < testResults[i].elements.length; j++) {
155-
element = testResults[i].elements[j];
156-
if (element.type === 'scenario') {
157-
scenariosNumber++;
158-
scenariosNumberInFeature++;
159-
stepsHtml = '';
160-
isPassed = true;
161-
for (var k = 0; k < testResults[i].elements[j].steps.length; k++) {
162-
step = testResults[i].elements[j].steps[k];
163-
stepsHtml += getStep(step);
164-
stepsNumber++;
165-
stepsNumberInFeature++;
166-
if (step.result.status !== statuses.PASSED) {
167-
isPassed = false;
168-
} else if (step.result.status === statuses.PASSED) {
169-
passedSteps++;
170-
passedStepsInFeature++;
154+
if (testResults[i].elements) {
155+
for (var j = 0; j < testResults[i].elements.length; j++) {
156+
element = testResults[i].elements[j];
157+
if (element.type === 'scenario') {
158+
scenariosNumber++;
159+
scenariosNumberInFeature++;
160+
stepsHtml = '';
161+
isPassed = true;
162+
for (var k = 0; k < testResults[i].elements[j].steps.length; k++) {
163+
step = testResults[i].elements[j].steps[k];
164+
stepsHtml += getStep(step);
165+
stepsNumber++;
166+
stepsNumberInFeature++;
167+
if (step.result.status !== statuses.PASSED) {
168+
isPassed = false;
169+
} else if (step.result.status === statuses.PASSED) {
170+
passedSteps++;
171+
passedStepsInFeature++;
172+
}
171173
}
172-
}
173174

174-
if (isPassed) {
175-
passedScenarios++;
176-
passedScenariosNumberInFeature++;
175+
if (isPassed) {
176+
passedScenarios++;
177+
passedScenariosNumberInFeature++;
178+
}
179+
scenariosHtml += '<div class="scenario-container">' + getScenario(element, isPassed);
180+
scenariosHtml += stepsHtml + '</div>';
177181
}
178-
scenariosHtml += '<div class="scenario-container">' + getScenario(element, isPassed);
179-
scenariosHtml += stepsHtml + '</div>';
180182
}
181183
}
182184
html += getFeature(testResults[i],scenariosNumberInFeature, passedScenariosNumberInFeature, stepsNumberInFeature, passedStepsInFeature);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-protractor-cucumber-html-report",
33
"description": "Generate html report from JSON file returned by cucumber-js json formatter",
4-
"version": "0.0.6",
4+
"version": "0.0.7",
55
"homepage": "https://github.com/robhil/grunt-protractor-cucumber-html-report",
66
"author": {
77
"name": "Hilscher, Robert",

templates/assets/css/style.css

Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ header h1 {
395395
-webkit-animation-name: hide_chart;
396396
-webkit-animation-duration: 0.3s;
397397
-webkit-animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
398-
398+
animation-name: hide_chart;
399+
animation-duration: 0.3s;
400+
animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
399401
}
400402

401403
.scenario-chart {
@@ -423,6 +425,32 @@ header h1 {
423425

424426
}
425427

428+
@-moz-keyframes display_chart {
429+
0% {
430+
opacity: 0;
431+
-webkit-transform: scale(0);
432+
transform: scale(0);
433+
}
434+
100% {
435+
opacity: 1;
436+
-webkit-transform: scale(1);
437+
transform: scale(1);
438+
}
439+
}
440+
441+
@keyframes display_chart {
442+
0% {
443+
opacity: 0;
444+
-webkit-transform: scale(0);
445+
transform: scale(0);
446+
}
447+
100% {
448+
opacity: 1;
449+
-webkit-transform: scale(1);
450+
transform: scale(1);
451+
}
452+
}
453+
426454
@-webkit-keyframes display_chart {
427455
0% {
428456
opacity: 0;
@@ -441,25 +469,62 @@ header h1 {
441469
opacity: 0;
442470
}
443471

472+
100% {
473+
opacity: 0.6;
474+
}
475+
}
476+
477+
@-moz-keyframes display_backdrop {
478+
0% {
479+
opacity: 0;
480+
}
444481

445482
100% {
446483
opacity: 0.6;
484+
}
485+
}
486+
487+
@keyframes display_backdrop {
488+
0% {
489+
opacity: 0;
490+
}
447491

492+
100% {
493+
opacity: 0.6;
448494
}
449495
}
450496

451497
@-webkit-keyframes hide_backdrop {
498+
0% {
499+
opacity: 0.6;
500+
}
501+
502+
100% {
503+
opacity: 0;
504+
}
505+
}
506+
507+
@-moz-keyframes hide_backdrop {
452508
0% {
453509
opacity: 0.6;
454510
}
455511

456-
457512
100% {
458513
opacity: 0;
514+
}
515+
}
459516

517+
@keyframes hide_backdrop {
518+
0% {
519+
opacity: 0.6;
520+
}
521+
522+
100% {
523+
opacity: 0;
460524
}
461525
}
462526

527+
463528
.close_chart {
464529
font-size: 30px;
465530
position: absolute;
@@ -471,6 +536,36 @@ header h1 {
471536
top: 5px;
472537
}
473538

539+
@-moz-keyframes hide_chart {
540+
0% {
541+
opacity: 1;
542+
-webkit-transform: scale(1);
543+
transform: scale(1);
544+
}
545+
546+
100% {
547+
opacity: 0;
548+
-webkit-transform: scale(0);
549+
transform: scale(0);
550+
}
551+
552+
}
553+
554+
@keyframes hide_chart {
555+
0% {
556+
opacity: 1;
557+
-webkit-transform: scale(1);
558+
transform: scale(1);
559+
}
560+
561+
100% {
562+
opacity: 0;
563+
-webkit-transform: scale(0);
564+
transform: scale(0);
565+
}
566+
567+
}
568+
474569
@-webkit-keyframes hide_chart {
475570
0% {
476571
opacity: 1;
@@ -552,6 +647,9 @@ header h1 {
552647
-webkit-animation-name: hide_backdrop;
553648
-webkit-animation-duration: 0.5s;
554649
-webkit-animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
650+
animation-name: hide_backdrop;
651+
animation-duration: 0.5s;
652+
animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
555653
}
556654

557655
.document_container {

templates/assets/js/chart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ app.chart = (function () {
2424
var chartContainer = document.querySelector('.scenario-chart');
2525

2626
chartContainer.addEventListener('webkitAnimationEnd', this.onAnimationEnd, false);
27-
chartContainer.addEventListener('animationEnd', this.onAnimationEnd, false);
27+
chartContainer.addEventListener('animationend', this.onAnimationEnd, false);
2828
chartContainer.addEventListener('oanimationEnd', this.onAnimationEnd, false);
2929
chartContainer.addEventListener('MSAnimationEnd', this.onAnimationEnd, false);
3030

0 commit comments

Comments
 (0)