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

Add retry count status for scenario. #258

Merged
merged 1 commit into from
May 6, 2020
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
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}}