{"id":20774070,"url":"https://github.com/indoorvivants/weaver-playwright","last_synced_at":"2025-04-30T15:14:00.206Z","repository":{"id":103990836,"uuid":"542454246","full_name":"indoorvivants/weaver-playwright","owner":"indoorvivants","description":"Thin integration between Weaver testing framework (https://disneystreaming.github.io/weaver-test/) and Playwright (https://playwright.dev/) for frontend testing","archived":false,"fork":false,"pushed_at":"2024-02-19T20:25:22.000Z","size":80,"stargazers_count":5,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-19T21:39:21.722Z","etag":null,"topics":["playwright","scala","testing"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/indoorvivants.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-28T07:05:51.000Z","updated_at":"2024-01-12T18:39:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a98d1681-4e7f-4458-a400-7a72f280987a","html_url":"https://github.com/indoorvivants/weaver-playwright","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":"indoorvivants/scala-library-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fweaver-playwright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fweaver-playwright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fweaver-playwright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indoorvivants%2Fweaver-playwright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indoorvivants","download_url":"https://codeload.github.com/indoorvivants/weaver-playwright/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225037036,"owners_count":17410980,"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":["playwright","scala","testing"],"created_at":"2024-11-17T12:28:17.774Z","updated_at":"2024-11-17T12:28:18.279Z","avatar_url":"https://github.com/indoorvivants.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Weaver](https://disneystreaming.github.io/weaver-test/) + [Playwright](https://playwright.dev/java/docs/intro)\n[![core Scala version support](https://index.scala-lang.org/indoorvivants/weaver-playwright/core/latest-by-scala-version.svg?platform=jvm)](https://index.scala-lang.org/indoorvivants/weaver-playwright/core)\n\nLove Weaver? Like Playwright? Forced to write tests?\n\nVery small integration between Playwright and Weaver to facilitate browser testing of applications.\n\nHere's an example of usage which is also a [Scala CLI](https://scala-cli.virtuslab.org/) script!\n\n**test.scala**\n```scala mdoc\n//\u003e using lib \"com.indoorvivants.playwright::weaver:0.0.4\"\n//\u003e using lib \"com.disneystreaming::weaver-cats:0.8.0\"\n\nimport com.indoorvivants.weaver.playwright._\nimport cats.effect._\n\nobject Example extends weaver.IOSuite with PlaywrightSpec {\n  def sharedResource: Resource[IO, Res] = PlaywrightRuntime.create()\n\n  pageTest(\"hello playwright!\") { pc =\u003e\n    for {\n      _ \u003c- pc.page(_.navigate(\"https://playwright.dev\"))\n\n      _ \u003c- pc.locator(\"text=Get Started\").map(_.first().click())\n\n      _ \u003c- eventually(pc.page(_.url())) { url =\u003e\n        expect(url.contains(\"intro\"))\n      }\n    } yield success\n  }\n}\n```\n\nRun it with `scala-cli test test.scala`.\n\nFor more common build tools:\n\n**SBT**\n```scala\n\"com.indoorvivants.weaver\" %% \"playwright\" % \"\u003cversion\u003e\" % Test\n```\n\n**Mill**\n```scala\nivy\"com.indoorvivants.weaver::playwright:\u003cversion\u003e\"\n```\n\n\n## What does it do?\n\n1. Wraps Playwright and browser instantiation into a `Resource`\n\n   - And also handles bonkers exceptions it throws when the drivers are created concurrently\n\n2. Does _minimal_ wrapping of the side-effectful, non-RT APIs that Playwright exposes \n\n   - As I learn more about frontend testing, the number of wrapped APIs should increase,\n       but the goal is to mainly access them via the `.page(...)` combinator\n\n3. Puts semaphores in place to abide by Playwright's [recommendation](https://playwright.dev/java/docs/test-runners#running-tests-in-parallel)\n\n4. Provides a `eventually` combinator for retrying assertions\n\nAs you can see, it's intentionally minimal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findoorvivants%2Fweaver-playwright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findoorvivants%2Fweaver-playwright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findoorvivants%2Fweaver-playwright/lists"}