test(GODT-2746): Integration tests for reporting a problem

- Add function for checking header in form-data request

Bug reports are sent with multipart/form-data, and the function parses this,
then compares the needed field with the wanted
Also, added the step definition.

- Add functions for reporting a bug with changes

Be able to report a bug by changing the value of a single field, or multiple fields through a JSON format

- Add integration tests for reporting a problem
This commit is contained in:
Gjorgji Slamkov
2023-08-30 13:42:48 +02:00
parent 44e103edd5
commit c57b52ef23
4 changed files with 138 additions and 0 deletions

View File

@ -28,6 +28,7 @@ func (s *scenario) steps(ctx *godog.ScenarioContext) {
ctx.Step(`^the internet is turned on$`, s.internetIsTurnedOn)
ctx.Step(`^the user agent is "([^"]*)"$`, s.theUserAgentIs)
ctx.Step(`^the header in the "([^"]*)" request to "([^"]*)" has "([^"]*)" set to "([^"]*)"$`, s.theHeaderInTheRequestToHasSetTo)
ctx.Step(`^the header in the "([^"]*)" multipart request to "([^"]*)" has "([^"]*)" set to "([^"]*)"$`, s.theHeaderInTheMultipartRequestToHasSetTo)
ctx.Step(`^the body in the "([^"]*)" request to "([^"]*)" is:$`, s.theBodyInTheRequestToIs)
ctx.Step(`^the body in the "([^"]*)" response to "([^"]*)" is:$`, s.theBodyInTheResponseToIs)
ctx.Step(`^the API requires bridge version at least "([^"]*)"$`, s.theAPIRequiresBridgeVersion)
@ -71,6 +72,8 @@ func (s *scenario) steps(ctx *godog.ScenarioContext) {
ctx.Step(`^the user deletes the gluon files$`, s.theUserDeletesTheGluonFiles)
ctx.Step(`^the user deletes the gluon cache$`, s.theUserDeletesTheGluonCache)
ctx.Step(`^the user reports a bug$`, s.theUserReportsABug)
ctx.Step(`^the user reports a bug with field "([^"]*)" set to "([^"]*)"$`, s.theUserReportsABugWithSingleHeaderChange)
ctx.Step(`^the user reports a bug with details:$`, s.theUserReportsABugWithDetails)
ctx.Step(`^the user hides All Mail$`, s.theUserHidesAllMail)
ctx.Step(`^the user shows All Mail$`, s.theUserShowsAllMail)
ctx.Step(`^the user disables telemetry in bridge settings$`, s.theUserDisablesTelemetryInBridgeSettings)