{"id":16003579,"url":"https://github.com/nhatthm/consolesteps","last_synced_at":"2026-01-25T19:01:56.053Z","repository":{"id":59045221,"uuid":"530119666","full_name":"nhatthm/consolesteps","owner":"nhatthm","description":"Terminal Emulator steps for cucumber/godog","archived":false,"fork":false,"pushed_at":"2024-10-31T20:19:50.000Z","size":66,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-05T05:00:00.330Z","etag":null,"topics":["bdd","console","cucumber","emulator","functional-testing","gherkin","go","godog","godog-extension","golang","integration-testing","terminal"],"latest_commit_sha":null,"homepage":"https://go.nhat.io/consolesteps","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/nhatthm.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":"2022-08-29T07:53:13.000Z","updated_at":"2024-06-23T12:42:42.000Z","dependencies_parsed_at":"2024-01-22T11:46:46.987Z","dependency_job_id":"a02ce00c-c6b9-45c6-92aa-f2e6232cd970","html_url":"https://github.com/nhatthm/consolesteps","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nhatthm/consolesteps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Fconsolesteps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Fconsolesteps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Fconsolesteps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Fconsolesteps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhatthm","download_url":"https://codeload.github.com/nhatthm/consolesteps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhatthm%2Fconsolesteps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28757163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: 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":["bdd","console","cucumber","emulator","functional-testing","gherkin","go","godog","godog-extension","golang","integration-testing","terminal"],"created_at":"2024-10-08T10:21:22.258Z","updated_at":"2026-01-25T19:01:56.035Z","avatar_url":"https://github.com/nhatthm.png","language":"Go","funding_links":["https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY"],"categories":[],"sub_categories":[],"readme":"# Terminal Emulator for cucumber/godog\n\n[![GitHub Releases](https://img.shields.io/github/v/release/nhatthm/consolesteps)](https://github.com/nhatthm/consolesteps/releases/latest)\n[![Build Status](https://github.com/nhatthm/consolesteps/actions/workflows/test.yaml/badge.svg)](https://github.com/nhatthm/consolesteps/actions/workflows/test.yaml)\n[![codecov](https://codecov.io/gh/nhatthm/consolesteps/branch/master/graph/badge.svg?token=eTdAgDE2vR)](https://codecov.io/gh/nhatthm/consolesteps)\n[![Go Report Card](https://goreportcard.com/badge/go.nhat.io/consolesteps)](https://goreportcard.com/report/go.nhat.io/consolesteps)\n[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/go.nhat.io/consolesteps)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)\n\n`consolesteps` provides a new [`Console`](https://github.com/netflix/go-expect) for each `cucumber/godog` Scenario.\n\n## Prerequisites\n\n- `Go \u003e= 1.17`\n\n## Install\n\n```bash\ngo get go.nhat.io/consolesteps\n```\n\n## Usage\n\nInitialize a `consolesteps.Manager` with `consolesteps.New()` then add it into the `ScenarioInitializer`. If you wish to add listeners to `Manager.NewConsole` and\n`Manager.CloseConsole` event, use `consolesteps.WithStarter` and `consolesteps.WithCloser` option in the constructor.\n\nFor example:\n\n```go\npackage mypackage\n\nimport (\n    \"math/rand\"\n    \"testing\"\n\n    expect \"github.com/Netflix/go-expect\"\n    \"github.com/cucumber/godog\"\n    \"go.nhat.io/consolesteps\"\n)\n\ntype writer struct {\n    console *expect.Console\n}\n\nfunc (w *writer) registerContext(ctx *godog.ScenarioContext) {\n    ctx.Step(`write to console:`, func(s *godog.DocString) error {\n        _, err := w.console.Write([]byte(s.Content))\n\n        return err\n    })\n}\n\nfunc (w *writer) start(_ *godog.Scenario, console *expect.Console) {\n    w.console = console\n}\n\nfunc (w *writer) close(_ *godog.Scenario) {\n    w.console = nil\n}\n\nfunc TestIntegration(t *testing.T) {\n    t.Parallel()\n\n    w := \u0026writer{}\n    m := consolesteps.New(t,\n        consolesteps.WithStarter(w.start),\n        consolesteps.WithCloser(w.close),\n    )\n\n    suite := godog.TestSuite{\n        Name: \"Integration\",\n        ScenarioInitializer: func(ctx *godog.ScenarioContext) {\n            m.RegisterContext(ctx)\n        },\n        Options: \u0026godog.Options{\n            Strict:    true,\n            Output:    out,\n            Randomize: rand.Int63(),\n        },\n    }\n\n    // Run the suite.\n}\n```\n\nSee more: [#Examples](#Examples)\n\n### Resize\n\nIn case you want to resize the terminal (default is `80x100`) to avoid text wrapping, for example:\n\n```gherkin\n        Then console output is:\n        \"\"\"\n        panic: could not build credentials provider option: unsupported credentials prov\n        ider\n        \"\"\"\n```\n\nUse `consolesteps.WithTermSize(cols, rows)` while initiating with `consolesteps.New()`, for example:\n\n```go\npackage mypackage\n\nimport (\n    \"testing\"\n\n    \"go.nhat.io/consolesteps\"\n)\n\nfunc TestIntegration(t *testing.T) {\n    // ...\n    m := consolesteps.New(t, consolesteps.WithTermSize(100, 100))\n    // ...\n}\n```\n\nThen your step will become:\n\n```gherkin\n        Then console output is:\n        \"\"\"\n        panic: could not build credentials provider option: unsupported credentials provider\n        \"\"\"\n```\n\n## Steps\n\n### `console output is:`\n\nAsserts the output of the console.\n\nFor example:\n\n```gherkin\n    Scenario: Find all transaction in range with invalid format\n        When I run command \"transactions -d --format invalid\"\n\n        Then console output is:\n        \"\"\"\n        panic: unknown output format\n        \"\"\"\n```\n\n## Examples\n\nFull suite: https://github.com/nhatthm/consolesteps/tree/master/features\n\n## Donation\n\nIf this project help you reduce time to develop, you can give me a cup of coffee :)\n\n### Paypal donation\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;or scan this\n\n\u003cimg src=\"https://user-images.githubusercontent.com/1154587/113494222-ad8cb200-94e6-11eb-9ef3-eb883ada222a.png\" width=\"147px\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhatthm%2Fconsolesteps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhatthm%2Fconsolesteps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhatthm%2Fconsolesteps/lists"}