Skip to content

Commit

Permalink
Rename FailedScreenshot to FailureScreenshot #186
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsc committed Aug 13, 2018
1 parent 5d144b8 commit 55e8df9
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 177 deletions.
2 changes: 1 addition & 1 deletion gauge-proto
Submodule gauge-proto updated 1 files
+2 −2 spec.proto
270 changes: 135 additions & 135 deletions gauge_messages/spec.pb.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions generator/_testdata/dummyReportTheme/views/partials.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@
<div class="exception">
<pre class="stacktrace">{{.StackTrace | escapeHTML | encodeNewLine}}</pre>
</div>
{{if .FailedScreenshot}}
{{if .FailureScreenshot}}
<div class="screenshot-container">
<div class="screenshot">
<a href="data:image/png;base64,{{.FailedScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailedScreenshot}}" class="screenshot-thumbnail" />
<a href="data:image/png;base64,{{.FailureScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailureScreenshot}}" class="screenshot-thumbnail" />
</a>
</div>
</div>
Expand Down Expand Up @@ -397,11 +397,11 @@
</h4>
<pre class="stacktrace">{{.StackTrace | escapeHTML | encodeNewLine}}</pre>
</div>
{{ if .FailedScreenshot}}
{{ if .FailureScreenshot}}
<div class="screenshot-container">
<div class="screenshot">
<a href="data:image/png;base64,{{.FailedScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailedScreenshot}}" class="screenshot-thumbnail" />
<a href="data:image/png;base64,{{.FailureScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailureScreenshot}}" class="screenshot-thumbnail" />
</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions generator/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (s *step) Kind() tokenKind {
type result struct {
Status status `json:"Status"`
StackTrace string `json:"StackTrace"`
FailedScreenshot string `json:"Screenshot"`
FailureScreenshot string `json:"Screenshot"`
ErrorMessage string `json:"ErrorMessage"`
ExecutionTime string `json:"ExecutionTime"`
SkippedReason string `json:"SkippedReason"`
Expand All @@ -193,7 +193,7 @@ type result struct {
type hookFailure struct {
HookName string `json:"HookName"`
ErrMsg string `json:"ErrMsg"`
FailedScreenshot string `json:"Screenshot"`
FailureScreenshot string `json:"Screenshot"`
StackTrace string `json:"StackTrace"`
TableRowIndex int32 `json:"TableRowIndex"`
}
Expand Down
2 changes: 1 addition & 1 deletion generator/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ func newHookFailure(name, errMsg, screenshot, stacktrace string) *hookFailure {
return &hookFailure{
HookName: name,
ErrMsg: errMsg,
FailedScreenshot: screenshot,
FailureScreenshot: screenshot,
StackTrace: stacktrace,
}
}
Expand Down
32 changes: 16 additions & 16 deletions generator/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var scenarioWithAfterHookFail = &gm.ProtoScenario{
PostHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
}

Expand All @@ -159,7 +159,7 @@ var scenarioWithBeforeHookFail = &gm.ProtoScenario{
PreHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
}

Expand All @@ -173,12 +173,12 @@ var scenarioWithBeforeAndAfterHookFail = &gm.ProtoScenario{
PreHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
PostHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
}

Expand Down Expand Up @@ -207,7 +207,7 @@ var stepWithBeforeHookFail = &gm.ProtoItem{
PreHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
},
Fragments: []*gm.Fragment{newTextFragment("This is a failing step")},
Expand All @@ -225,7 +225,7 @@ var stepWithAfterHookFail = &gm.ProtoItem{
PostHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
},
Fragments: []*gm.Fragment{newTextFragment("This is a failing step")},
Expand All @@ -243,12 +243,12 @@ var stepWithBeforeAndAfterHookFail = &gm.ProtoItem{
PreHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
PostHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
},
Fragments: []*gm.Fragment{newTextFragment("This is a failing step")},
Expand All @@ -264,7 +264,7 @@ var failedStep = &gm.ProtoItem{
ExecutionTime: 211316,
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
},
},
Fragments: []*gm.Fragment{newTextFragment("This is a failing step")},
Expand Down Expand Up @@ -568,7 +568,7 @@ var failSpecResWithAfterSpecFailure = &gm.ProtoSpecResult{
PostHookFailures: []*gm.ProtoHookFailure{{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
}},
},
}
Expand Down Expand Up @@ -602,7 +602,7 @@ var failSpecResWithBeforeSpecFailure = &gm.ProtoSpecResult{
PreHookFailures: []*gm.ProtoHookFailure{{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
}},
},
}
Expand Down Expand Up @@ -648,7 +648,7 @@ var failSpecResWithBeforeSpecFailureWithTableDriven = &gm.ProtoSpecResult{
PreHookFailures: []*gm.ProtoHookFailure{
{ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
TableRowIndex: int32(1)},
},
},
Expand Down Expand Up @@ -693,7 +693,7 @@ var failSpecResWithAfterSpecFailureWithTableDriven = &gm.ProtoSpecResult{
},
},
PostHookFailures: []*gm.ProtoHookFailure{
{ErrorMessage: "java.lang.RuntimeException", StackTrace: newStackTrace(), FailedScreenshot: []byte(newScreenshot()), TableRowIndex: int32(0)},
{ErrorMessage: "java.lang.RuntimeException", StackTrace: newStackTrace(), FailureScreenshot: []byte(newScreenshot()), TableRowIndex: int32(0)},
},
},
}
Expand Down Expand Up @@ -726,12 +726,12 @@ var failSpecResWithBeforeAfterSpecFailure = &gm.ProtoSpecResult{
PreHookFailures: []*gm.ProtoHookFailure{{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
}},
PostHookFailures: []*gm.ProtoHookFailure{{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
}},
},
}
Expand Down Expand Up @@ -786,7 +786,7 @@ func newProtoHookFailure() *gm.ProtoHookFailure {
return &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
}
}

Expand Down
4 changes: 2 additions & 2 deletions generator/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func toHookFailure(failure *gm.ProtoHookFailure, hookName string) *hookFailure {
HookName: hookName,
StackTrace: failure.GetStackTrace(),
TableRowIndex: failure.TableRowIndex,
FailedScreenshot: base64.StdEncoding.EncodeToString(failure.GetFailedScreenshot()),
FailureScreenshot: base64.StdEncoding.EncodeToString(failure.GetFailureScreenshot()),
}
return result
}
Expand Down Expand Up @@ -461,7 +461,7 @@ func toStep(protoStep *gm.ProtoStep) *step {
ErrorMessage: res.GetErrorMessage(),
ExecutionTime: formatTime(res.GetExecutionTime()),
Messages: res.GetMessage(),
FailedScreenshot: base64.StdEncoding.EncodeToString(res.GetFailedScreenshot()),
FailureScreenshot: base64.StdEncoding.EncodeToString(res.GetFailureScreenshot()),
}
for _, s := range res.GetScreenshots() {
result.Screenshots = append(result.Screenshots, base64.StdEncoding.EncodeToString(s))
Expand Down
16 changes: 8 additions & 8 deletions generator/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ var specResWithSpecHookFailure = &gm.ProtoSpecResult{
PreHookFailures: []*gm.ProtoHookFailure{{
ErrorMessage: "err",
StackTrace: "Stacktrace",
FailedScreenshot: []byte("Screenshot"),
FailureScreenshot: []byte("Screenshot"),
}},
PostHookFailures: []*gm.ProtoHookFailure{{
ErrorMessage: "err",
StackTrace: "Stacktrace",
FailedScreenshot: []byte("Screenshot"),
FailureScreenshot: []byte("Screenshot"),
}},
},
}
Expand Down Expand Up @@ -365,12 +365,12 @@ var scnWithHookFailure = &gm.ProtoScenario{
PreHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "err",
StackTrace: "Stacktrace",
FailedScreenshot: []byte("Screenshot"),
FailureScreenshot: []byte("Screenshot"),
},
PostHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "err",
StackTrace: "Stacktrace",
FailedScreenshot: []byte("Screenshot"),
FailureScreenshot: []byte("Screenshot"),
},
}

Expand Down Expand Up @@ -510,15 +510,15 @@ var protoStepWithAfterHookFailure = &gm.ProtoStep{
PostHookFailure: &gm.ProtoHookFailure{
ErrorMessage: "err",
StackTrace: "Stacktrace",
FailedScreenshot: []byte("Screenshot"),
FailureScreenshot: []byte("Screenshot"),
},
},
}

var failedHookFailure = &gm.ProtoHookFailure{
ErrorMessage: "java.lang.RuntimeException",
StackTrace: newStackTrace(),
FailedScreenshot: []byte(newScreenshot()),
FailureScreenshot: []byte(newScreenshot()),
}

func TestToOverview(t *testing.T) {
Expand Down Expand Up @@ -847,14 +847,14 @@ func TestToSpecWithDataTableExecutionStatusFail(t *testing.T) {
}

func TestToSpecWithBeforeHookFailure(t *testing.T) {
want := []*hookFailure{{ErrMsg: "err", HookName: "Before Spec", FailedScreenshot: "U2NyZWVuc2hvdA==", StackTrace: "Stacktrace"}}
want := []*hookFailure{{ErrMsg: "err", HookName: "Before Spec", FailureScreenshot: "U2NyZWVuc2hvdA==", StackTrace: "Stacktrace"}}
got := toSpec(specResWithSpecHookFailure).BeforeSpecHookFailures

checkEqual(t, "", want, got)
}

func TestToSpecWithAfterHookFailure(t *testing.T) {
want := []*hookFailure{{ErrMsg: "err", HookName: "After Spec", FailedScreenshot: "U2NyZWVuc2hvdA==", StackTrace: "Stacktrace", TableRowIndex: 0}}
want := []*hookFailure{{ErrMsg: "err", HookName: "After Spec", FailureScreenshot: "U2NyZWVuc2hvdA==", StackTrace: "Stacktrace", TableRowIndex: 0}}
got := toSpec(specResWithSpecHookFailure).AfterSpecHookFailures

checkEqual(t, "", want, got)
Expand Down
1 change: 1 addition & 0 deletions themes/default/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ footer p {
flex-wrap: wrap;
width: 100%;
margin-top: 10px;
margin-left: 10px;
}

.scenario-container .screenshot {
Expand Down
12 changes: 6 additions & 6 deletions themes/default/views/partials.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@
<div class="exception">
<pre class="stacktrace">{{.StackTrace | escapeHTML | encodeNewLine}}</pre>
</div>
{{if .FailedScreenshot}}
{{if .FailureScreenshot}}
<div class="screenshot-container">
<div class="screenshot">
<a href="data:image/png;base64,{{.FailedScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailedScreenshot}}" class="screenshot-thumbnail" />
<a href="data:image/png;base64,{{.FailureScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailureScreenshot}}" class="screenshot-thumbnail" />
</a>
</div>
</div>
Expand Down Expand Up @@ -397,11 +397,11 @@
</h4>
<pre class="stacktrace">{{.StackTrace | escapeHTML | encodeNewLine}}</pre>
</div>
{{ if .FailedScreenshot}}
{{ if .FailureScreenshot}}
<div class="screenshot-container">
<div class="screenshot">
<a href="data:image/png;base64,{{.FailedScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailedScreenshot}}" class="screenshot-thumbnail" />
<a href="data:image/png;base64,{{.FailureScreenshot}}" rel="lightbox">
<img src="data:image/png;base64,{{.FailureScreenshot}}" class="screenshot-thumbnail" />
</a>
</div>
</div>
Expand Down

0 comments on commit 55e8df9

Please sign in to comment.