{"id":17645351,"url":"https://github.com/pawelwritescode/gdutils","last_synced_at":"2026-01-19T09:01:27.233Z","repository":{"id":37857011,"uuid":"350630596","full_name":"pawelWritesCode/gdutils","owner":"pawelWritesCode","description":"Library with methods for testing HTTP(s) API","archived":false,"fork":false,"pushed_at":"2023-10-01T14:34:34.000Z","size":310,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-14T14:51:18.311Z","etag":null,"topics":["e2e","e2e-tests","gdutils","godog","http","json","testing","xml","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pawelWritesCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-23T08:14:38.000Z","updated_at":"2023-03-01T16:50:39.000Z","dependencies_parsed_at":"2023-10-01T15:51:21.351Z","dependency_job_id":null,"html_url":"https://github.com/pawelWritesCode/gdutils","commit_stats":{"total_commits":150,"total_committers":8,"mean_commits":18.75,"dds":0.4733333333333334,"last_synced_commit":"d0b93b1820e434e3faf70ae8c7ad4daeb8041092"},"previous_names":["testing-toolkits/gdutils","pawelwritescode/godog-utils"],"tags_count":86,"template":false,"template_full_name":null,"purl":"pkg:github/pawelWritesCode/gdutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelWritesCode%2Fgdutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelWritesCode%2Fgdutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelWritesCode%2Fgdutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelWritesCode%2Fgdutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawelWritesCode","download_url":"https://codeload.github.com/pawelWritesCode/gdutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelWritesCode%2Fgdutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["e2e","e2e-tests","gdutils","godog","http","json","testing","xml","yaml"],"created_at":"2024-10-23T10:55:08.134Z","updated_at":"2026-01-19T09:01:27.209Z","avatar_url":"https://github.com/pawelWritesCode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![gdutils](https://github.com/pawelWritesCode/gdutils/workflows/gdutils/badge.svg)](https://github.com/pawelWritesCode/gdutils/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/pawelWritesCode/gdutils.svg)](https://pkg.go.dev/github.com/pawelWritesCode/gdutils) ![Coverage](https://img.shields.io/badge/Coverage-66%25-brightgreen)\n\n# GDUTILS\n\n## Simple library with methods useful for e2e testing of HTTP(s) API using JSON/YAML/XML.\n\n### Downloading\n\n`go get github.com/pawelWritesCode/gdutils`\n\n### Related project:\n\nSkeleton that allows to write E2E tests covering any HTTP API using *godog \u0026 gdutils* almost instantly with minimal configuration.\nhttps://github.com/pawelWritesCode/godog-http-api\n\n### Simple usage:\n```go\nac := gdutils.NewDefaultAPIContext(false, \"\")\n\nif err := ac.RequestPrepare(\"GET\", \"https://random-d.uk/api/v2/list\", \"DUCK_GIFS_LIST\"); err != nil {\n\treturn err\n}\n\nif err := ac.RequestSend(\"DUCK_GIFS_LIST\"); err != nil {\n    return err\n}\n\nif err := ac.AssertStatusCodeIs(200); err != nil {\n    return err\n}\n\nif err := ac.AssertResponseFormatIs(format.JSON); err != nil {\n    return err\n}\n\nif err := ac.AssertNodeIsType(format.JSON, \"$.gifs\", types.Array); err != nil {\n    return err\n}\n\n```\n\n### Available methods:\n\n| NAME                                      |                                       DESCRIPTION                                        |\n|-------------------------------------------|:----------------------------------------------------------------------------------------:|\n|                                           |                                                                                          |\n| **Sending HTTP(s) requests:**             |                                                                                          |\n|                                           |                                                                                          |\n| RequestSendWithBodyAndHeaders             |                  Sends HTTP(s) request with provided body and headers.                   |\n| RequestPrepare                            |                                 Prepare HTTP(s) request                                  |\n| RequestSetHeaders                         |                  Sets provided headers for previously prepared request                   |\n| RequestSetForm                            |                    Sets provided form for previously prepared request                    |\n| RequestSetCookies                         |                  Sets provided cookies for previously prepared request                   |\n| RequestSetBody                            |                        Sets body for previously prepared request                         |\n| RequestSend                               |                        Sends previously prepared HTTP(s) request                         |\n|                                           |                                                                                          |\n| **Random data generation:**               |                                                                                          |\n|                                           |                                                                                          |\n| GenerateRandomInt                         |    Generates random integer from provided range and save it under provided cache key     |\n| GenerateFloat64                           |     Generates random float from provided range and save it under provided cache key      |\n| GeneratorRandomRunes                      |       Creates generator for random strings from provided charset in provided range       |\n| GeneratorRandomSentence                   |      Creates generator for random sentence from provided charset in provided range       |\n| GetTimeAndTravel                          |               Accepts time object and move in time by given time interval                |\n| GenerateTimeAndTravel                     |           Creates current time object and move in time by given time interval            |\n|                                           |                                                                                          |\n| **Preserving data:**                      |                                                                                          |\n|                                           |                                                                                          |\n| SaveNode                                  |             Saves from last response body JSON node under given cacheKey key             |\n| SaveHeader                                |                           Saves into cache given header value                            |\n| Save                                      |                         Saves into cache arbitrary passed value                          |\n|                                           |                                                                                          |\n| **Debugging:**                            |                                                                                          |\n|                                           |                                                                                          |\n| DebugPrintResponseBody                    |                            Prints last response from request                             |\n| DebugStart                                |                                  Starts debugging mode                                   |\n| DebugStop                                 |                                   Stops debugging mode                                   |\n|                                           |                                                                                          |\n| **Flow control:**                         |                                                                                          |\n|                                           |                                                                                          |\n| Wait                                      |                     Stops test execution for provided amount of time                     |\n|                                           |                                                                                          |\n| **Assertions:**                           |                                                                                          |\n|                                           |                                                                                          |\n| AssertResponseHeaderExists                |                  Checks whether last HTTP(s) response has given header                   |\n| AssertResponseHeaderNotExists             |              Checks whether last HTTP(s) response doesn't have given header              |\n| AssertResponseHeaderValueIs               |        Checks whether last HTTP(s) response has given header with provided value         |\n| AssertStatusCodeIs                        |                         Checks last HTTP(s) response status code                         |\n| AssertStatusCodeIsNot                     |           Checks if last HTTP(s) response status code is not of provided value           |\n| AssertResponseFormatIs                    |             Checks whether last HTTP(s) response body has given data format              |\n| AssertResponseFormatIsNot                 |         Checks whether last HTTP(s) response body doesn't have given data format         |\n| AssertNodeExists                          |                   Checks whether last response body contains given key                   |\n| AssertNodeNotExists                       |               Checks whether last response body doesn't contain given key                |\n| AssertNodesExist                          |              Checks whether last HTTP(s) response body JSON has given nodes              |\n| AssertNodeIsTypeAndValue                  |               Compares json node value from expression to expected by user               |\n| AssertNodeIsTypeAndHasOneOfValues         |          Compares node value from expression to expected by user set of values           |\n| AssertNodeContainsSubString               |            Checks whether node value from expression contains given substring            |\n| AssertNodeNotContainsSubString            |        Checks whether node value from expression doesn't contain given substring         |\n| AssertNodeIsType                          |         Checks whether node from last HTTP(s) response body is of provided type          |\n| AssertNodeIsNotType                       |       Checks whether node from last HTTP(s) response body is not of provided type        |\n| AssertNodeMatchesRegExp                   |            Checks whether last HTTP(s) response body JSON node matches regExp            |\n| AssertNodeNotMatchesRegExp                |         Checks whether last HTTP(s) response body JSON node doesn't match regExp         |\n| AssertNodeSliceLengthIs                   |                  checks whether given key is slice and has given length                  |\n| AssertNodeSliceLengthIsNot                |             checks whether given key is slice and doesn't have given length              |\n| AssertResponseMatchesSchemaByReference    |      Validates last HTTP(s) response body against provided in reference JSON schema      |\n| AssertResponseMatchesSchemaByString       |            Validates last HTTP(s) response body against provided JSON schema             |\n| AssertNodeMatchesSchemaByString           |       Validates last HTTP(s) response body JSON node against provided JSON schema        |\n| AssertNodeMatchesSchemaByReference        | Validates last HTTP(s) response body JSON node against provided in reference JSON schema |\n| AssertTimeBetweenRequestAndResponseIs     |           Asserts that last HTTP(s) request-response time is \u003c= than expected            |\n| AssertResponseCookieExists                |                  Checks whether last HTTP(s) response has given cookie                   |\n| AssertResponseCookieNotExists             |              Checks whether last HTTP(s) response doesn't have given cookie              |\n| AssertResponseCookieValueIs               |           Checks whether last HTTP(s) response has given cookie of given value           |\n| AssertResponseCookieValueMatchesRegExp    |      Checks whether last HTTP(s) response has given cookie matching provided regExp      |\n| AssertResponseCookieValueNotMatchesRegExp |  Checks whether last HTTP(s) response has given cookie is not matching provided regExp   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawelwritescode%2Fgdutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawelwritescode%2Fgdutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawelwritescode%2Fgdutils/lists"}