Skip to content

Commit

Permalink
Add retry count status for scenario.
Browse files Browse the repository at this point in the history
Signed-off-by: BugDiver <[email protected]>
  • Loading branch information
BugDiver committed Apr 22, 2020
1 parent bf7ccaf commit 2f8bcd0
Show file tree
Hide file tree
Showing 9 changed files with 702 additions and 365 deletions.
529 changes: 366 additions & 163 deletions gauge_messages/messages.pb.go

Large diffs are not rendered by default.

230 changes: 171 additions & 59 deletions gauge_messages/services.pb.go

Large diffs are not rendered by default.

292 changes: 151 additions & 141 deletions gauge_messages/spec.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions generator/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ type scenario struct {
PostHookScreenshotFiles []string `json:"PostHookScreenshotFiles"`
PreHookScreenshots []string `json:"PreHookScreenshots"`
PostHookScreenshots []string `json:"PostHookScreenshots"`
RetriesCount int `json:"RetriesCount"`
}

type step struct {
Expand Down
1 change: 1 addition & 0 deletions generator/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ func toScenario(scn *gm.ProtoScenario, tableRowIndex int) *scenario {
TableRowIndex: tableRowIndex,
PreHookMessages: scn.GetPreHookMessages(),
PostHookMessages: scn.GetPostHookMessages(),
RetriesCount: int(scn.RetriesCount),
}
for _, s := range scn.GetPreHookScreenshotFiles() {
scenario.PreHookScreenshotFiles = append(scenario.PreHookScreenshotFiles, s)
Expand Down
2 changes: 2 additions & 0 deletions generator/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ var scn = &gm.ProtoScenario{
},
PreHookMessages: []string{"Before Scenario Message"},
PostHookMessages: []string{"After Scenario Message"},
RetriesCount: 4,
}

var scnWithHookFailure = &gm.ProtoScenario{
Expand Down Expand Up @@ -1072,6 +1073,7 @@ func TestToScenario(t *testing.T) {
},
},
TableRowIndex: -1,
RetriesCount: 4,
}

got := toScenario(scn, -1)
Expand Down
5 changes: 5 additions & 0 deletions themes/default/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,11 @@ header.top .project {
margin: 0 0 10px 0;
}

.scenario-retry-count {
padding: 5px;
background-color: yellow
}

.step {
list-style-type: none;
margin: 0;
Expand Down
5 changes: 4 additions & 1 deletion themes/default/views/partials.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@
{{define "scenarioHeaderStartDiv"}}
<div class="scenario-head">
<h3 class="head borderBottom">{{.Heading | escapeHTML }}</h3>
{{ if gt .RetriesCount 1}}
<span class="scenario-retry-count">Retried {{ .RetriesCount }} times</span>
{{end}}
<span class="time">{{.ExecutionTime}}</span>
{{end}}

Expand Down Expand Up @@ -883,4 +886,4 @@
</main>
{{template "bodyFooterTag"}}
{{template "htmlPageEndWithJS" $overview}}
{{end}}
{{end}}

0 comments on commit 2f8bcd0

Please sign in to comment.