{"id":20560143,"url":"https://github.com/Badisi/wdio-harness","last_synced_at":"2025-05-09T17:33:02.257Z","repository":{"id":40798294,"uuid":"428432470","full_name":"Badisi/wdio-harness","owner":"Badisi","description":"🔬 WebdriverIO support for Angular component test harnesses","archived":false,"fork":false,"pushed_at":"2025-04-25T18:01:08.000Z","size":2627,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T18:15:39.995Z","etag":null,"topics":["angular","cdk","components","harness","harnesses","test","test-harnesses","testing","wdio","webdriver","webdriverio"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Badisi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-11-15T21:52:35.000Z","updated_at":"2025-04-25T18:01:03.000Z","dependencies_parsed_at":"2023-02-15T15:46:27.509Z","dependency_job_id":"ed6adc9e-8a30-412b-9f83-459e9a37ac8c","html_url":"https://github.com/Badisi/wdio-harness","commit_stats":{"total_commits":139,"total_committers":2,"mean_commits":69.5,"dds":0.03597122302158273,"last_synced_commit":"fb21282728bccc8363abea06aa2ba55b06818ce5"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fwdio-harness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fwdio-harness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fwdio-harness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Fwdio-harness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Badisi","download_url":"https://codeload.github.com/Badisi/wdio-harness/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253295797,"owners_count":21885696,"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":["angular","cdk","components","harness","harnesses","test","test-harnesses","testing","wdio","webdriver","webdriverio"],"created_at":"2024-11-16T03:53:14.411Z","updated_at":"2025-05-09T17:33:01.696Z","avatar_url":"https://github.com/Badisi.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Miscellaneous"],"readme":"\u003ch1 align=\"center\"\u003e\n    @badisi/wdio-harness\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ci\u003e🔬 \u003ca href=\"https://webdriver.io\" alt=\"wdio\"\u003eWebdriverIO\u003c/a\u003e support for Angular component test harnesses.\u003c/i\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@badisi/wdio-harness\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/v/@badisi/wdio-harness.svg?color=blue\u0026logo=npm\" alt=\"npm version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://npmcharts.com/compare/@badisi/wdio-harness?minimal=true\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/dw/@badisi/wdio-harness.svg?color=7986CB\u0026logo=npm\" alt=\"npm donwloads\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/badisi/wdio-harness/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/l/@badisi/wdio-harness.svg?color=ff69b4\" alt=\"license\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Badisi/wdio-harness/actions/workflows/ci_tests.yml\"\u003e\n        \u003cimg src=\"https://github.com/Badisi/wdio-harness/actions/workflows/ci_tests.yml/badge.svg\" alt=\"build status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/badisi/wdio-harness/blob/main/CONTRIBUTING.md#-submitting-a-pull-request-pr\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n#### Component test harnesses\n\n\u003e A component harness is a class that lets a test interact with a component via a supported API. Each harness's API interacts with a component the same way a user would. By using the harness API, a test insulates itself against updates to the internals of a component, such as changing its DOM structure. The idea for component harnesses comes from the [PageObject](https://martinfowler.com/bliki/PageObject.html) pattern commonly used for integration testing.\n\n[More info](https://material.angular.io/cdk/test-harnesses/overview)\n\n\u003chr/\u003e\n\n## Installation\n\n```sh\nnpm install @badisi/wdio-harness --save-dev\n```\n\n```sh\nyarn add @badisi/wdio-harness --dev\n```\n\n\n## Usage\n\n__Methods__\n\n- `createHarnessEnvironment(rootElement)` - gets a HarnessLoader instance from a given element (defaults to body)\n- `getHarness(harnessType, element)` - searches for an harness instance from a given ComponentHarness class and element\n- `getHarness(harnessType)` - searches for an harness instance from a given ComponentHarness class\n- `getHarness(query)` - searches for an harness instance from a given HarnessPredicate\n- `getAllHarnesses(query)` - acts like getHarness, but returns an array of harness instances\n- `waitForAngular()` - waits for Angular to finish bootstrapping\n\n__Example__\n\n```ts\nimport { MatDatepickerInputHarness } from '@angular/material/datepicker/testing';\nimport { getHarness } from '@badisi/wdio-harness';\n\ndescribe('Angular Material Harness', () =\u003e {\n    beforeEach(async () =\u003e {\n        await browser.url('http://localhost:4200');\n    });\n\n    it('MatDatePicker', async () =\u003e {\n        const datepicker = await getHarness(MatDatepickerInputHarness.with({ selector: '#demo-datepicker-input' }));\n\n        await datepicker.setValue('9/27/1954');\n        expect(await datepicker.getValue()).withContext('Date should be 9/27/1954').toBe('9/27/1954');\n\n        await datepicker.openCalendar();\n        const calendar = await datepicker.getCalendar();\n        await calendar.next();\n        await calendar.selectCell({ text: '20' });\n        expect(await datepicker.getValue()).withContext('Date should be 10/20/1954').toBe('10/20/1954');\n    });\n});\n```\n\nMore examples [here][examples].\n\n\n## Development\n\nSee the [developer docs][developer].\n\n\n## Contributing\n\n#### \u003e Want to Help ?\n\nWant to file a bug, contribute some code or improve documentation ? Excellent!\n\nBut please read up first on the guidelines for [contributing][contributing], and learn about submission process, coding rules and more.\n\n#### \u003e Code of Conduct\n\nPlease read and follow the [Code of Conduct][codeofconduct] and help me keep this project open and inclusive.\n\n\n\n\n[developer]: https://github.com/badisi/wdio-harness/blob/main/DEVELOPER.md\n[contributing]: https://github.com/badisi/wdio-harness/blob/main/CONTRIBUTING.md\n[codeofconduct]: https://github.com/badisi/wdio-harness/blob/main/CODE_OF_CONDUCT.md\n[examples]: https://github.com/badisi/wdio-harness/blob/main/projects/tests-e2e/harness.e2e.ts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBadisi%2Fwdio-harness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBadisi%2Fwdio-harness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBadisi%2Fwdio-harness/lists"}