{"id":16953879,"url":"https://github.com/eliashaeussler/typo3-codeception-helper","last_synced_at":"2025-04-11T21:33:10.592Z","repository":{"id":178876656,"uuid":"662446637","full_name":"eliashaeussler/typo3-codeception-helper","owner":"eliashaeussler","description":"🚴 Helper functions for Codeception tests within TYPO3 extensions","archived":false,"fork":false,"pushed_at":"2025-04-10T18:22:06.000Z","size":689,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T19:51:59.471Z","etag":null,"topics":["codeception","extension","typo3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliashaeussler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["eliashaeussler"],"custom":["https://paypal.me/eliashaeussler"]}},"created_at":"2023-07-05T06:50:18.000Z","updated_at":"2025-04-10T18:20:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"264ab9d9-7ae4-4a2f-ad8f-e8e1baf9dfc4","html_url":"https://github.com/eliashaeussler/typo3-codeception-helper","commit_stats":null,"previous_names":["eliashaeussler/typo3-codeception-helper"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliashaeussler%2Ftypo3-codeception-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliashaeussler%2Ftypo3-codeception-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliashaeussler%2Ftypo3-codeception-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliashaeussler%2Ftypo3-codeception-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliashaeussler","download_url":"https://codeload.github.com/eliashaeussler/typo3-codeception-helper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248483391,"owners_count":21111441,"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":["codeception","extension","typo3"],"created_at":"2024-10-13T22:08:13.515Z","updated_at":"2025-04-11T21:33:10.566Z","avatar_url":"https://github.com/eliashaeussler.png","language":"PHP","funding_links":["https://github.com/sponsors/eliashaeussler","https://paypal.me/eliashaeussler"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# TYPO3 Codeception Helper\n\n[![Coverage](https://img.shields.io/coverallsCoverage/github/eliashaeussler/typo3-codeception-helper?logo=coveralls)](https://coveralls.io/github/eliashaeussler/typo3-codeception-helper)\n[![Maintainability](https://img.shields.io/codeclimate/maintainability/eliashaeussler/typo3-codeception-helper?logo=codeclimate)](https://codeclimate.com/github/eliashaeussler/typo3-codeception-helper/maintainability)\n[![CGL](https://img.shields.io/github/actions/workflow/status/eliashaeussler/typo3-codeception-helper/cgl.yaml?label=cgl\u0026logo=github)](https://github.com/eliashaeussler/typo3-codeception-helper/actions/workflows/cgl.yaml)\n[![Tests](https://img.shields.io/github/actions/workflow/status/eliashaeussler/typo3-codeception-helper/tests.yaml?label=tests\u0026logo=github)](https://github.com/eliashaeussler/typo3-codeception-helper/actions/workflows/tests.yaml)\n[![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/eliashaeussler/typo3-codeception-helper/php?logo=php)](https://packagist.org/packages/eliashaeussler/typo3-codeception-helper)\n\n\u003c/div\u003e\n\nThis library provides some helper functions for [Codeception](https://codeception.com/)\ntests within TYPO3 extensions. In addition, an application entrypoint\nmodifier extension for coverage collection within acceptance tests\nis distributed.\n\n## 🔥 Installation\n\n[![Packagist](https://img.shields.io/packagist/v/eliashaeussler/typo3-codeception-helper?label=version\u0026logo=packagist)](https://packagist.org/packages/eliashaeussler/typo3-codeception-helper)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/eliashaeussler/typo3-codeception-helper?color=brightgreen)](https://packagist.org/packages/eliashaeussler/typo3-codeception-helper)\n\n```bash\ncomposer require --dev eliashaeussler/typo3-codeception-helper\n```\n\n## ⚡ Usage\n\n### `ApplicationEntrypointModifier` extension\n\n\u003e Source: [`Codeception\\Extension\\ApplicationEntrypointModifier`](src/Codeception/Extension/ApplicationEntrypointModifier.php)\n\nA Codeception extension that aims to ease the integration effort\nwhen collecting code coverage with [`codeception/c3`](https://github.com/Codeception/c3).\nIt replaces an existing entrypoint (e.g. `typo3/index.php`) with\na modified entrypoint that includes the distributed `c3.php` file.\n\nEnable this extension in your `codeception.yml` file:\n\n```yaml\n# codeception.yml\n\nextensions:\n  enabled:\n    - EliasHaeussler\\Typo3CodeceptionHelper\\Codeception\\Extension\\ApplicationEntrypointModifier:\n        entrypoints:\n          - web-dir: .Build/web\n            main-entrypoint: index.php\n            app-entrypoint: app.php\n          - web-dir: .Build/web/typo3\n            main-entrypoint: index.php\n            app-entrypoint: app.php\n```\n\nFor each entrypoint, the following config must be provided:\n\n| Config name       | Description                                                                    | Default value |\n|-------------------|--------------------------------------------------------------------------------|---------------|\n| `web-dir`         | Relative path from project root to directory that contains the main entrypoint | –             |\n| `main-entrypoint` | Name of the entrypoint to replace (the file being accessed by the web server)  | `index.php`   |\n| `app-entrypoint`  | Name of the original relocated entrypoint (the renamed main entrypoint)        | `app.php`     |\n\n#### Example\n\nGiven the following directory structure:\n\n```\n.Build\n└── web\n    └── index.php   # main entrypoint provided by framework/application\n```\n\nOnce the extension is enabled and properly configured, the following\ndirectory structure exists after the test suite is started:\n\n```\n.Build\n└── web\n    ├── app.php     # contains the original contents from index.php\n    └── index.php   # generated entrypoint that includes c3.php and app.php\n```\n\n### `Backend` module\n\n\u003e Source: [`Codeception\\Module\\Backend`](src/Codeception/Module/Backend.php)\n\nA Codeception module that allows to perform actions within TYPO3\nbackend. It can for example be used to log into the TYPO3 backend.\n\n\u003e [!NOTE]\n\u003e This module requires the [`WebDriver`](https://codeception.com/docs/modules/WebDriver)\n\u003e module to be installed and enabled.\n\nEnable this module in your `codeception.yml` file:\n\n```yaml\n# codeception.yml\n\nsuites:\n  Acceptance:\n    actor: AcceptanceTester\n    modules:\n      enabled:\n        - EliasHaeussler\\Typo3CodeceptionHelper\\Codeception\\Module\\Backend\n```\n\n#### Available methods\n\n**`login($username, $password): void`**\n\nPerform backend login for the given user. The user is identified\nby the given username and is authenticated by the given password.\n\nExample:\n\n```php\n$I-\u003elogin('admin', 'password');\n```\n\n**`loginAs($username): void`**\n\nPerform backend login for the given user. The user is identified\nby the given username which must be configured in the codeception\nmodule config (see [Configure backend users](#configure-backend-users)).\n\nExample:\n\n```php\n$I-\u003eloginAs('admin');\n```\n\n**`openModule($identifier): void`**\n\nOpen a backend module by clicking on the module link. The module\nlink is identified by a given node identifier. Note that the\nidentifier differs between TYPO3 versions (see example below).\n\nExample:\n\n```php\n// TYPO3 11\n$I-\u003eopenModule('#web_list');\n\n// TYPO3 12\n$I-\u003eopenModule('[data-modulemenu-identifier=\"web_list\"]');\n```\n\n**`scrollToElementInModule($identifier, $offsetX = 0, $offsetY = 0): void`**\n\nScroll to a given element, identified by the given node identifier,\ninside the current backend module. This circumvents issues with\nCodeception's native `WebDriver::scrollTo()` method which does not\nsupport scrolling inside frames.\n\nExample:\n\n```php\n$I-\u003eopenModule('[data-modulemenu-identifier=\"web_list\"]');\n$I-\u003escrollToElementInModule('tr[data-table=\"tt_content\"]');\n```\n\n#### Configure backend users\n\n\u003e [!NOTE]\n\u003e Backend users are not automatically created by this module.\n\u003e You need to take care of that by your own, e.g. by\n\u003e [importing static database fixtures](https://codeception.com/docs/modules/Db#SQL-data-dump)\n\u003e before tests are executed.\n\nIn order to use the `loginAs()` method, existing backend users\nmust be configured in the module config section:\n\n```diff\n suites:\n   Acceptance:\n     actor: AcceptanceTester\n     modules:\n       enabled:\n-        - EliasHaeussler\\Typo3CodeceptionHelper\\Codeception\\Module\\Backend\n+        - EliasHaeussler\\Typo3CodeceptionHelper\\Codeception\\Module\\Backend:\n+            userCredentials:\n+              admin: password\n+              editor: password\n```\n\n## 🧑‍💻 Contributing\n\nPlease have a look at [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\n## ⭐ License\n\nThis project is licensed under [GNU General Public License 2.0 (or later)](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliashaeussler%2Ftypo3-codeception-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliashaeussler%2Ftypo3-codeception-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliashaeussler%2Ftypo3-codeception-helper/lists"}