{"id":29541169,"url":"https://github.com/corolla-johnson/gogotte","last_synced_at":"2025-07-17T09:02:30.474Z","repository":{"id":303952285,"uuid":"1017248121","full_name":"corolla-johnson/gogotte","owner":"corolla-johnson","description":"Gherkin BDD framework for Gut (Godot Unit Test)","archived":false,"fork":false,"pushed_at":"2025-07-10T09:28:24.000Z","size":253,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T17:43:01.636Z","etag":null,"topics":["behavior-driven-development","gherkin","godot-engine"],"latest_commit_sha":null,"homepage":"","language":"GDScript","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/corolla-johnson.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,"zenodo":null}},"created_at":"2025-07-10T08:45:28.000Z","updated_at":"2025-07-10T09:28:27.000Z","dependencies_parsed_at":"2025-07-10T17:48:16.286Z","dependency_job_id":"53c8617e-762e-4692-9ee5-2ad6c81fbb1d","html_url":"https://github.com/corolla-johnson/gogotte","commit_stats":null,"previous_names":["corolla-johnson/gogotte"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/corolla-johnson/gogotte","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corolla-johnson%2Fgogotte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corolla-johnson%2Fgogotte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corolla-johnson%2Fgogotte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corolla-johnson%2Fgogotte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corolla-johnson","download_url":"https://codeload.github.com/corolla-johnson/gogotte/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corolla-johnson%2Fgogotte/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265587532,"owners_count":23793142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["behavior-driven-development","gherkin","godot-engine"],"created_at":"2025-07-17T09:01:44.559Z","updated_at":"2025-07-17T09:02:30.462Z","avatar_url":"https://github.com/corolla-johnson.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gogotte\ngogotte is a Gherkin framework for Gut (Godot Unit Test).\n\nIt allows you to create executable specifications for [Behaviour-Driven Development](https://cucumber.io/docs/bdd/) and run them using Gut.\n\n## Dependencies\ngogotte requires Python and the gherkin-official package.\n\n```\npip install gherkin-official\n```\n\nIt also requires Gut and Godot 4.x.\n\n## Quick Start Guide\nIf you are unfamiliar with Gherkin, please read the [Gherkin reference](https://cucumber.io/docs/gherkin/reference/) and [step definition guide](https://cucumber.io/docs/gherkin/step-organization/) before continuing.\n\n### Folder Structure\nHere is a suggested folder structure for use with gogotte.\n```\nproject_root/\n├── .gogotteConfig               # The gogotte config file\n└── test/\n    ├── testdata/                # Contains test data such as scenes\n    │   ├── enemy01.tscn\n    │   └── ...\n    ├── steps/                   # Contains your steps\n    │   ├── collision_steps.gd   # You can have any number of step files\n    │   ├── graphics_steps.gd    # as long as steps are globally unambiguous\n    │   └── ...\n    └── features/                # Contains your features\n        ├── xxx_feature.feature\n        └── ...\n```\n### Configuring Gogotte\nA JSON file named `./.gogotteConfig` is placed in the project root to configure Gogotte. Here is an example corresponding to the above folder structure:\n```json\n{\n    \"step_dirs\": [\n        \"res://test/steps/\"\n    ],\n    \"save_ast\": false\n}\n```\n'step_dirs' tells gogotte where to find your steps. It is mandatory.\n\n'save_ast' saves a Gherkin abstract syntax tree and is only useful for developers.\n\n### Running Gogotte\nWhen using Gut from the Godot Editor, point the \"Pre-Run Hook\" field to `res://addons/gogotte/gogotte_hook.gd` as shown below.\n\n![](images/hook.png)\n\nPut your feature directories under the Test Directories heading as shown below.\n\n![](images/dirs.png)\n\nFinally click Run All.\n\ngogotte will place files with the extension `.out.gd` inside of your feature directories, which Gut will execute. It may be a good idea to put `*.out.gd` in your gitignore.\n\n### Step Definition\nSee `./gogotte_examples/steps/example_steps.gd.`\n\nEach step class should have a Dictionary `steps`, which maps step patterns to Callables.\n```gdscript\nvar steps: Dictionary = {\n    \"x is equal to {}\":\n    func (t: GogotteTest, number: String) -\u003e void:\n        t.ctx['x'] = int(number),\n\n    \"we add {} to x\":\n    func (t: GogotteTest, number: String) -\u003e void:\n        t.ctx['x'] = t.ctx['x'] + int(number),\n\n    \"variable {} should be {}\":\n    func (t: GogotteTest, name: String, number: String) -\u003e void:\n        t.assert_eq(t.ctx[name], int(number), \"x was not correct\")\n        t.p(\"OK\"),\n        # Don't forget the comma on the final line!\n}\n```\nA pattern may contain placeholders marked with `{}`, which allow arguments to be passed in. The placeholder may also contain a name e.g. `{number}`, but a limitation of gogotte is that the **placeholder name doesn't map it to an argument, only its order in the pattern does**. So it is recommended to leave placeholders anonymous, as above.\n\ngogotte does not currently distinguish between Given/When/Then/And steps.\n\n### Scenario Context\nAs shown above, a step may use `t.ctx` as the context scratchpad for the scenario. `t.datatable` contains the current step's datatable if present (null otherwise), ditto for `t.docstring` and the docstring.\n\nExample of docstring usage:\n```Gherkin\nScenario: Adding items from a wishlist\n    When I import my wishlist with the following items:\n        \"\"\"\n        [\n            {\"name\": \"Apple\", \"quantity\": 3},\n            {\"name\": \"Banana\", \"quantity\": 2},\n            {\"name\": \"Orange\", \"quantity\": 1}\n        ]\n        \"\"\"\n```\n```gdscript\n\"I import my wishlist with the following items:\":\nfunc (t: GogotteTest) -\u003e void:\n    # Parse the JSON from the docstring\n    var json: Array = JSON.parse_string(t.docstring)\n    t.assert_not_null(json, \"JSON should be valid\")\n```\n\n### Built-in Tags\ngogotte supports the tag `@skip` for Features and Scenarios, which skips compilation of the scenario.\n\n## Known Limitations\n- Due to a Gdscript Callable limitation, placeholder names do not matter. Their order in the pattern determines which step argument they map to.\n- gut.p() output may not appear when there is a runtime error (same as plain Gut). Use print() statements in your step definitions if you need debugging.\n\n## Why should I choose BDD?\nI won't try to gas BDD too much. Other people are better at it.\n\nGames are full of *features*. I think beginner and intermediate devs are better at specifying what a feature should do than writing tests for it. Doing so with a formal language like Gherkin provides one of the strongest forms of documentation. Nevertheless, you might still want to test it.\n\nGodot Unit Test lets you write in-engine integration tests, but there's an impedance mismatch between specification and testing, and the two can go out of sync quite easily.\n\nWith a BDD framework like gogotte, the specification *becomes* the test. You write these specification-tests in a domain-specific language called Gherkin. Functions (called 'steps') are named and called in plain English but implemented in gdscript, making it easy for even non-technical personnel to tell what behaviour is being exercised. It also harder to desynchronize the test from its specification.\n\nBDD is powerful not only for team projects but for solo devs who test extensively.\n\n## Developing Gogotte\nAfter cloning this repository, use AssetLib to add Gut to the project.\n\nPython and gherkin-official are also needed.\n\nAdd `res://addons/gogotte/selftest/gut` as a directory in the Gut GUI in order to run the self tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorolla-johnson%2Fgogotte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorolla-johnson%2Fgogotte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorolla-johnson%2Fgogotte/lists"}