{"id":17254280,"url":"https://github.com/waynevanson/fp-ts-webdriver","last_synced_at":"2025-04-14T05:35:26.569Z","repository":{"id":54399707,"uuid":"303222025","full_name":"waynevanson/fp-ts-webdriver","owner":"waynevanson","description":"fp-ts bindings to the Webdriver W3C specification","archived":false,"fork":false,"pushed_at":"2021-11-09T23:34:57.000Z","size":765,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T03:58:00.760Z","etag":null,"topics":["e2e","fp-ts","functional","jest","test","testing","typescript","webdriver"],"latest_commit_sha":null,"homepage":"https://waynevanson.github.io/fp-ts-webdriver","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waynevanson.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-11T22:13:20.000Z","updated_at":"2021-11-09T23:36:29.000Z","dependencies_parsed_at":"2022-08-13T14:30:57.399Z","dependency_job_id":null,"html_url":"https://github.com/waynevanson/fp-ts-webdriver","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waynevanson%2Ffp-ts-webdriver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waynevanson%2Ffp-ts-webdriver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waynevanson%2Ffp-ts-webdriver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waynevanson%2Ffp-ts-webdriver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waynevanson","download_url":"https://codeload.github.com/waynevanson/fp-ts-webdriver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248829088,"owners_count":21168149,"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":["e2e","fp-ts","functional","jest","test","testing","typescript","webdriver"],"created_at":"2024-10-15T07:08:12.190Z","updated_at":"2025-04-14T05:35:26.548Z","avatar_url":"https://github.com/waynevanson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fp-ts-webdriver\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nW3C Webdriver API, optimized for usage with fp-ts.\n\nThe goal is to be compatible with the [W3C Recommendation](https://www.w3.org/TR/webdriver1)\n\nA webdriver sends requests and returns responses.\nWe send a request to a driver (chromdriver, geckodriver), it opens up an instance of the browser and runs our requests in real time.\n\n## Installation\n\nPlease keep in mind that this is package is experiemental and not enough tests have been written.\n\n```sh\n# yarn\n## peer dependencies\nyarn add fp-ts fp-ts-std io-ts monocle-ts newtype-ts\nyarn add fp-ts-webdriver\n\n# npm\n# peer dependencies\nnpm install fp-ts fp-ts-std io-ts monocle-ts newtype-ts\nnpm install fp-ts-webdriver\n```\n\n## Usage\n\nThere are two types of dependencies: `WebdriverDeps` and `SessionDeps`.\n\n`SessionDeps` extends `WebdriverDeps` with the `sessionId`.\nAll commands that use this as the dependency require a session.\n\n### Example\n\nFor this examples to function, you have to turn on your webdriver.\nWith chromedriver the command is `chromedriver --port=4444`.\nCheckout the tests on how to set this up automatically with jest.\n\n```ts\nimport { webdriver as WD, readerReaderTaskEither as RRTE } from \"fp-ts-webdriver\"\nimport { pipe } from \"fp-ts/lib/function\"\nimport { readerTaskEither as RTE } from \"fp-ts\"\n\nconst searchBar = WD.findElement(\"css selector\", \"input[name=\\\"q\\\"]\")\nconst searchButton = WD.findElement(\"css selector\", \"input[value=\\\"Google Search\\\"]\")\n\n// requires a session\nconst program = pipe(\n  WD.navigateTo(\"https://google.com.au\"),\n  RTE.apSecond(searchBar),\n  RTE.chainFirst(WD.sendKeys(\"dogs\")),\n  RTE.apSecond(searchButton)\n  RTE.chain(WD.elementClick)\n)\n\nconst dependencies: WD.WebdriverDeps =  {\n  url: \"localhost:4444\",\n  capabilities: { alwaysMatch: {} },\n  requestInit: {}\n}\n\n// creates a session and closes it after runnning `program`\nconst main = WD.bracketed(program)\n\nmain(dependencies)().catch(console.error)\n```\n\n### Need Something Now?\n\nDoing commands in an order that makes sense. If there's some you want, make a PR or ask! :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynevanson%2Ffp-ts-webdriver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaynevanson%2Ffp-ts-webdriver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynevanson%2Ffp-ts-webdriver/lists"}