Skip to content

Commit a541038

Browse files
Fix GUI tests
1 parent 1d5c4ff commit a541038

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

web/server/vue-cli/e2e/pages/runs.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const commands = {
2-
backToRunsPage() {
2+
pageBack() {
33
this.api.back();
44

55
return this
@@ -22,8 +22,8 @@ const commands = {
2222
};
2323

2424
module.exports = {
25-
url: function() {
26-
return this.api.launchUrl + '/e2e/runs';
25+
url: function() {
26+
return this.api.launchUrl + '/e2e/runs';
2727
},
2828
commands: [ commands ],
2929
elements: {
@@ -34,6 +34,7 @@ module.exports = {
3434
showDescriptionBtn: "button.description",
3535
showHistoryBtn: "a.show-history",
3636
showStatisticsBtn: "a.show-statistics",
37+
showComponentStatisticsBtn: "a.component-statistics-tab",
3738
showAnalysisInfoBtn: "button.show-analysis-info",
3839
openDetectionStatus: "a.detection-status-count",
3940
descriptionMenu:

web/server/vue-cli/e2e/specs/runs.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ module.exports = {
179179
.assert.urlContains("detection-status=Reopened")
180180
.assert.urlContains("detection-status=Unresolved")
181181
.waitForElementVisible("@page")
182-
.backToRunsPage();
182+
.pageBack();
183183
},
184184

185185
"open run statistics"(browser) {
@@ -188,14 +188,17 @@ module.exports = {
188188

189189
runsPage
190190
.click("@showStatisticsBtn")
191+
.pause(100)
192+
.click("@showComponentStatisticsBtn")
191193
.assert.urlContains("/statistics")
192194
.assert.urlContains(`run=${runName}`)
193195
.assert.urlContains("is-unique=on")
194196
.assert.urlContains("detection-status=New")
195197
.assert.urlContains("detection-status=Reopened")
196198
.assert.urlContains("detection-status=Unresolved")
197199
.waitForElementVisible("@page")
198-
.backToRunsPage();
200+
.pageBack()
201+
.pageBack();
199202
},
200203

201204
"open run detection status"(browser) {
@@ -208,7 +211,7 @@ module.exports = {
208211
.assert.urlContains(`run=${runName}`)
209212
.assert.urlContains("detection-status=")
210213
.waitForElementVisible("@page")
211-
.backToRunsPage();
214+
.pageBack();
212215
},
213216

214217
"diff two runs" (browser) {
@@ -234,7 +237,7 @@ module.exports = {
234237
.assert.urlContains("/reports")
235238
.assert.urlContains("run=")
236239
.assert.urlContains("newcheck=")
237-
.backToRunsPage();
240+
.pageBack();
238241
},
239242

240243
"show run history" (browser) {
@@ -317,7 +320,7 @@ module.exports = {
317320
runsPage
318321
.assert.urlContains("/reports")
319322
.assert.urlContains("run-tag=")
320-
.backToRunsPage();
323+
.pageBack();
321324
},
322325

323326
"open statistics of a run history event" (browser) {
@@ -328,6 +331,7 @@ module.exports = {
328331
timelineSection.click("@showStatisticsBtn");
329332

330333
runsPage
334+
.click("@showComponentStatisticsBtn")
331335
.assert.urlContains("/statistics")
332336
.assert.urlContains("run=")
333337
.assert.urlContains("run-tag=")
@@ -336,7 +340,8 @@ module.exports = {
336340
.assert.urlContains("detection-status=Reopened")
337341
.assert.urlContains("detection-status=Unresolved")
338342
.waitForElementVisible("@page")
339-
.backToRunsPage();
343+
.pageBack()
344+
.pageBack();
340345
},
341346

342347
"show check command of a run history event" (browser) {
@@ -382,7 +387,7 @@ module.exports = {
382387
.assert.urlContains("/reports")
383388
.assert.urlContains("run-tag=")
384389
.assert.urlContains("run-tag-newcheck=")
385-
.backToRunsPage();
390+
.pageBack();
386391
},
387392

388393
"diff a run and a run history event" (browser) {
@@ -405,7 +410,7 @@ module.exports = {
405410
.assert.urlContains("run=")
406411
.assert.not.urlContains("run-tag=")
407412
.assert.urlContains("run-tag-newcheck=")
408-
.backToRunsPage();
413+
.pageBack();
409414
},
410415

411416
"remove a run" (browser) {

web/server/vue-cli/src/views/Statistics.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
...$router.currentRoute.query
2626
}}"
2727
exact
28+
:class="t.class"
2829
>
2930
<v-icon class="mr-2">
3031
{{ t.icon }}
@@ -69,36 +70,42 @@ export default {
6970
const tabs = [
7071
{
7172
name: "Product Overview",
73+
class: "product-overview-tab",
7274
icon: "mdi-briefcase-outline",
7375
to: { name: "product-overview" },
7476
showCompareTo: true
7577
},
7678
{
7779
name: "Checker Statistics",
80+
class: "checker-statistics-tab",
7881
icon: "mdi-card-account-details",
7982
to: { name: "checker-statistics" },
8083
showCompareTo: true
8184
},
8285
{
8386
name: "Severity Statistics",
87+
class: "severity-statistics-tab",
8488
icon: "mdi-speedometer",
8589
to: { name: "severity-statistics" },
8690
showCompareTo: true
8791
},
8892
{
8993
name: "Component Statistics",
94+
class: "component-statistics-tab",
9095
icon: "mdi-puzzle-outline",
9196
to: { name: "component-statistics" },
9297
showCompareTo: true
9398
},
9499
{
95100
name: "Checker Coverage",
101+
class: "checker-coverage-tab",
96102
icon: "mdi-clipboard-check-outline",
97103
to: { name: "checker-coverage-statistics" },
98104
showCompareTo: false
99105
},
100106
{
101107
name: "Guideline Statistics",
108+
class: "guideline-statistics-tab",
102109
icon: "mdi-clipboard-text-outline",
103110
to: { name: "guideline-statistics" },
104111
showCompareTo: false

0 commit comments

Comments
 (0)