{"id":27344475,"url":"https://github.com/mirego/html_test_identifiers","last_synced_at":"2025-04-12T17:06:48.116Z","repository":{"id":37894568,"uuid":"233066058","full_name":"mirego/html_test_identifiers","owner":"mirego","description":"HTMLTestIdentifiers provides the basic functionality to add data-testid attribute depending on configuration.","archived":false,"fork":false,"pushed_at":"2022-10-12T19:52:08.000Z","size":29,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-04-29T20:21:50.428Z","etag":null,"topics":["eex","elixir","html"],"latest_commit_sha":null,"homepage":"https://open.mirego.com","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirego.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-10T14:39:09.000Z","updated_at":"2022-11-03T18:29:46.000Z","dependencies_parsed_at":"2022-08-19T23:40:31.757Z","dependency_job_id":null,"html_url":"https://github.com/mirego/html_test_identifiers","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fhtml_test_identifiers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fhtml_test_identifiers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fhtml_test_identifiers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fhtml_test_identifiers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirego","download_url":"https://codeload.github.com/mirego/html_test_identifiers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465323,"owners_count":21108243,"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":["eex","elixir","html"],"created_at":"2025-04-12T17:06:11.485Z","updated_at":"2025-04-12T17:06:48.100Z","avatar_url":"https://github.com/mirego.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/11348/73123813-10d59880-3f62-11ea-87b5-74fe7138f85c.png\" width=\"600\" /\u003e\n  \u003cbr /\u003e\u003cbr /\u003e\n  \u003ccode\u003eHTMLTestIdentifiers\u003c/code\u003e provides the basic functionality to add \u003ccode\u003edata-testid\u003c/code\u003e\u003cbr /\u003e attribute depending on configuration.\n  \u003cbr /\u003e\u003cbr /\u003e\n  \u003ca href=\"https://github.com/mirego/html_test_identifiers/actions\"\u003e\u003cimg src=\"https://github.com/mirego/html_test_identifiers/workflows/CI/badge.svg?branch%3Amaster\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://hex.pm/packages/html_test_identifiers\"\u003e\u003cimg src=\"https://img.shields.io/hexpm/v/html_test_identifiers.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nThe package can be installed by adding `html_test_identifiers` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:html_test_identifiers, github: \"mirego/html_test_identifiers\", tag: \"v0.1.1\"}\n  ]\nend\n```\n\n## Configuration\n\nAdd the following to your config files if you want `data-testid` included in your release :\n\n```elixir\nconfig :html_test_identifiers, provider: HTMLTestIdentifiers.TestID\n```\n\nAdd the following to your config files if you don't want `data_testid` attribute to be included in your release :\n\n```elixir\nconfig :html_test_identifiers, provider: HTMLTestIdentifiers.NoTestID\n```\n\nIf there is no configuration, `HTMLTestIdentifiers.NoTestID` will be used by default\n\n## Usage\n\n```elixir\n# With `config :html_test_identifiers, provider: HTMLTestIdentifiers.TestID`\n\nHTMLTestIdentifiers.testid_attribute(\"hello\")\n# =\u003e \"data-testid=\\\"hello\\\"\n\nHTMLTestIdentifiers.testid_key(\"hello\")\n# =\u003e \"hello\"\n\n# With `config :html_test_identifiers, provider: HTMLTestIdentifiers.NoTestID`\n\nHTMLTestIdentifiers.testid_attribute(\"hello\")\n# =\u003e nil\n\nHTMLTestIdentifiers.testid_key(\"hello\")\n# =\u003e nil\n```\n\nYou can also import the module in a view helpers module:\n\n```elixir\ndefmodule MyView do\n  import HTMLTestIdentifiers\nend\n```\n\nConsidering `.eex` file content\n\n```elixir\n\u003ch1 \u003c%= testid_attribute(\"title-id\") %\u003e\u003eTitle\u003c/h1\u003e\n\u003c%= content_tag :p, \"paragraph text content\", data_testid: testid_key(\"paragraph-id\") %\u003e\n```\n\nwith `config :html_test_identifiers, provider: HTMLTestIdentifiers.TestID`, resulting HTML will be\n\n```html\n\u003ch1 data-testid=\"title-id\"\u003eTitle\u003c/h1\u003e\n\u003cp data-testid=\"paragraph-id\"\u003eparagraph text content\u003c/p\u003e\n```\n\nwith `config :html_test_identifiers, provider: HTMLTestIdentifiers.NoTestID`, resulting HTML will be\n\n```html\n\u003ch1\u003eTitle\u003c/h1\u003e\n\u003cp\u003eparagraph text content\u003c/p\u003e\n```\n\n## Contributors\n\n- @romarickb\n\n## License\n\n`html_test_identifiers` is © 2019 [Mirego](https://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/html_test_identifiers/blob/master/LICENSE.md) file.\n\n## About Mirego\n\n[Mirego](https://www.mirego.com) is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of [talented people](https://life.mirego.com) who imagine and build beautiful Web and mobile applications. We come together to share ideas and [change the world](http://www.mirego.org).\n\nWe also [love open-source software](https://open.mirego.com) and we try to give back to the community as much as we can.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirego%2Fhtml_test_identifiers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirego%2Fhtml_test_identifiers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirego%2Fhtml_test_identifiers/lists"}