{"id":13443091,"url":"https://github.com/HashNuke/hound","last_synced_at":"2025-03-20T16:30:25.443Z","repository":{"id":12534450,"uuid":"15204429","full_name":"HashNuke/hound","owner":"HashNuke","description":"Elixir library for writing integration tests and browser automation","archived":false,"fork":false,"pushed_at":"2024-07-09T07:43:58.000Z","size":474,"stargazers_count":1361,"open_issues_count":84,"forks_count":145,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-10-29T23:50:35.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://hexdocs.pm/hound","language":"Elixir","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/HashNuke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2013-12-15T14:01:16.000Z","updated_at":"2024-10-26T22:28:16.000Z","dependencies_parsed_at":"2024-11-14T11:01:00.931Z","dependency_job_id":"1682ab00-6c96-4c6e-9dd7-779c261831c7","html_url":"https://github.com/HashNuke/hound","commit_stats":{"total_commits":509,"total_committers":61,"mean_commits":8.344262295081966,"dds":0.2573673870333988,"last_synced_commit":"1be61d4d4d16aa8d49026d993866a038d5f3b629"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashNuke%2Fhound","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashNuke%2Fhound/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashNuke%2Fhound/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashNuke%2Fhound/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HashNuke","download_url":"https://codeload.github.com/HashNuke/hound/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244649671,"owners_count":20487467,"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":[],"created_at":"2024-07-31T03:01:55.943Z","updated_at":"2025-03-20T16:30:25.075Z","avatar_url":"https://github.com/HashNuke.png","language":"Elixir","funding_links":[],"categories":["Elixir","Testing"],"sub_categories":[],"readme":"# Hound\n\nFor browser automation and writing integration tests in Elixir.\n\n\u003ca href=\"http://github.com/HashNuke/Hound\" target=\"_parent\"\u003eSource\u003c/a\u003e | \u003ca href=\"http://hexdocs.pm/hound\" target=\"_parent\"\u003eDocumentation\u003c/a\u003e\n\n[![Build Status](https://travis-ci.org/HashNuke/hound.png?branch=master)](https://travis-ci.org/HashNuke/hound)\n\n## Features\n\n* Can run __multiple browser sessions__ simultaneously. [See example](https://github.com/HashNuke/hound/blob/master/test/multiple_browser_session_test.exs).\n\n* Supports Selenium (Firefox, Chrome), ChromeDriver and PhantomJs.\n\n* Supports Javascript-heavy apps. Retries a few times before reporting error.\n\n* Implements the WebDriver Wire Protocol.\n\n**Internet Explorer may work under Selenium, but hasn't been tested.**\n\n#### Example\n\n##### ExUnit example\n\n```elixir\ndefmodule HoundTest do\n  use ExUnit.Case\n  use Hound.Helpers\n\n  hound_session()\n\n  test \"the truth\", meta do\n    navigate_to(\"http://example.com/guestbook.html\")\n\n    element = find_element(:name, \"message\")\n    fill_field(element, \"Happy Birthday ~!\")\n    submit_element(element)\n\n    assert page_title() == \"Thank you\"\n  end\n\nend\n```\n\nHere's another [simple browser-automation example](https://github.com/HashNuke/hound/blob/master/notes/simple-browser-automation.md).\n\n## Setup\n\nHound requires Elixir 1.0.4 or higher.\n\n* Add dependency to your mix project\n\n```elixir\n\n{:hound, \"~\u003e 1.0\"}\n```\n\n* Start Hound in your `test/test_helper.exs` file **before** the `ExUnit.start()` line:\n\n```elixir\nApplication.ensure_all_started(:hound)\nExUnit.start()\n```\n\nWhen you run `mix test`, Hound is automatically started. __You'll need a webdriver server__ running, like Selenium Server or Chrome Driver. If you aren't sure what it is, then [read this](https://github.com/HashNuke/hound/wiki/Starting-a-webdriver-server).\n\n#### If you're using Phoenix\nEnsure the server is started when your tests are run. In `config/test.exs` change the `server` option of your endpoint config to `true`:\n\n```elixir\nconfig :hello_world_web, HelloWorldWeb.Endpoint,\n  http: [port: 4001],\n  server: true\n```\n\n## Configure\n\nTo configure Hound, use your `config/config.exs` file or equivalent.\n\nExample:\n\n```config :hound, driver: \"phantomjs\"```\n\n[More examples here](https://github.com/HashNuke/hound/blob/master/notes/configuring-hound.md).\n\n## Usage\n\nAdd the following lines to your ExUnit test files.\n\n```elixir\n# Import helpers\nuse Hound.Helpers\n\n# Start hound session and destroy when tests are run\nhound_session()\n```\n\nIf you prefer to manually start and end sessions, use `Hound.start_session` and `Hound.end_session` in the setup and teardown blocks of your tests.\n\n\n## Helpers\n\nThe documentation pages include examples under each function.\n\n* [Navigation](http://hexdocs.pm/hound/Hound.Helpers.Navigation.html)\n* [Page](http://hexdocs.pm/hound/Hound.Helpers.Page.html)\n* [Element](http://hexdocs.pm/hound/Hound.Helpers.Element.html)\n* [Cookies](http://hexdocs.pm/hound/Hound.Helpers.Cookie.html)\n* [Javascript execution](http://hexdocs.pm/hound/Hound.Helpers.ScriptExecution.html)\n* [Javascript dialogs](http://hexdocs.pm/hound/Hound.Helpers.Dialog.html)\n* [Screenshot](http://hexdocs.pm/hound/Hound.Helpers.Screenshot.html)\n* [Session](http://hexdocs.pm/hound/Hound.Helpers.Session.html)\n* [Window](http://hexdocs.pm/hound/Hound.Helpers.Window.html)\n\nThe docs are at \u003chttp://hexdocs.pm/hound\u003e.\n\n### More examples? [Checkout Hound's own test cases](https://github.com/HashNuke/hound/tree/master/test/helpers)\n\n## FAQ\n\n#### Can I run multiple browser sessions simultaneously\n\nOh yeah ~! [Here is an example](https://github.com/HashNuke/hound/blob/master/test/multiple_browser_session_test.exs).\n\nIf you are running PhantomJs, take a look at the *Caveats* section below.\n\n#### Can I run tests async?\n\nYes.\n\nThe number of tests you can run async at any point in time, depends on the number of sessions that your webdriver can maintain at a time. For Selenium Standalone, there seems to be a default limit of 15 sessions. You can set ExUnit's async option to limit the number of tests to run parallelly.\n\n#### Will Hound guarantee an isolated session per test?\n\nYes. A separate session is started for each test process.\n\n## PhantomJs caveats\n\nPhantomJs is extremely fast, but there are certain caveats. It uses Ghostdriver for its webdriver server, which currently has unimplemented features or open issues.\n\n* Cookie jar isn't separate for sessions - \u003chttps://github.com/ariya/phantomjs/issues/11417\u003e\n  Which means all sessions share the same cookies. Make sure you run `delete_cookies()` at the end of each test.\n* Isolated sessions were added to GhostDriver recently and are yet to land in a PhantomJs release.\n* Javascript alerts aren't yet supported - \u003chttps://github.com/detro/ghostdriver/issues/20\u003e.\n\n## Running tests\n\nYou need a webdriver in order to run tests. We recommend `phantomjs` but any can be used by setting the WEBDRIVER environment variable as shown below:\n\n    $ phantomjs --wd\n    $ WEBDRIVER=phantomjs mix test\n\n## Maintainers\n\n* Akash Manohar ([HashNuke](https://github.com/HashNuke))\n* Daniel Perez ([tuvistavie](https://github.com/tuvistavie))\n\n## Customary proclamation...\n\nCopyright \u0026copy; 2013-2015, Akash Manohar J, under the MIT License (basically, do whatever you want)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashNuke%2Fhound","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHashNuke%2Fhound","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashNuke%2Fhound/lists"}