Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Changelog

## 0.2 - 2021-09-13
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## v0.2.0 - 2021-09-13

* Increases minimum elixir version to 1.8.
* Relaxes tesla version requirement to ~> 1.3.

## 0.1 - 2020-04-15
## v0.1.0 - 2020-04-15

Initial release.
* Initial release.
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
# The MIT License

Copyright (c) 2020 Aaron Renner

Expand Down
45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# WebDriverClient
[![codecov](https://codecov.io/gh/aaronrenner/web_driver_client/branch/master/graph/badge.svg)](https://codecov.io/gh/aaronrenner/web_driver_client)

[![CI](https://github.com/elixir-wallaby/web_driver_client/actions/workflows/test.yml/badge.svg)](https://github.com/elixir-wallaby/web_driver_client/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/elixir-wallaby/web_driver_client/branch/master/graph/badge.svg)](https://codecov.io/gh/elixir-wallaby/web_driver_client)
[![Module Version](https://img.shields.io/hexpm/v/web_driver_client.svg)](https://hex.pm/packages/web_driver_client)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/web_driver_client/)
[![Total Download](https://img.shields.io/hexpm/dt/web_driver_client.svg)](https://hex.pm/packages/web_driver_client)
[![License](https://img.shields.io/hexpm/l/web_driver_client.svg)](https://github.com/elixir-wallaby/web_driver_client/blob/master/LICENSE.md)
[![Last Updated](https://img.shields.io/github/last-commit/elixir-wallaby/web_driver_client.svg)](https://github.com/elixir-wallaby/web_driver_client/commits/master)



A low-level [WebDriver] client for Elixir. This library is still a work in progress.

Expand Down Expand Up @@ -167,23 +176,24 @@ $ mix test --only integration_test_driver:selenium_2
Sometimes it's nice to be able to run against a remote webdriver server.
Here's an example that runs the tests against a docker container.

1. Start the docker container for the webdriver server
Start the docker container for the webdriver server:

```
$ docker run -p 4446:4444 --shm-size=2g selenium/standalone-chrome:3
```
```
$ docker run -p 4446:4444 --shm-size=2g selenium/standalone-chrome:3
```

2. Run the tests
Run the tests:

```
$ SELENIUM_3_BASE_URL="http://localhost:4446/wd/hub" TEST_SERVER_HOSTAME="host.docker.internal" mix test --only integration_test_driver_browser:selenium_3-chrome
```
```
$ SELENIUM_3_BASE_URL="http://localhost:4446/wd/hub" \
TEST_SERVER_HOSTAME="host.docker.internal" mix test --only integration_test_driver_browser:selenium_3-chrome
```

The environment variables work like this:
The environment variables work like this:

* `<DRIVER_NAME>_BASE_URL` - The base url for the webdriver server to run
* `<DRIVER_NAME>_BASE_URL` - The base url for the webdriver server to run
against. Can also use `WEBDRIVER_BASE_URL` to set this across all scenarios.
* ` TEST_SERVER_HOSTNAME` - The hostname the webdriver server should use to access
* ` TEST_SERVER_HOSTNAME` - The hostname the webdriver server should use to access
the machine that's running the test suite.

The test suite starts up a test HTTP server, but when using a remote webdriver
Expand All @@ -194,8 +204,8 @@ Here's an example that runs the tests against a docker container.

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `web_driver_client` to your list of dependencies in `mix.exs`:
The package can be installed by adding `:web_driver_client` to your list of
dependencies in `mix.exs`:

```elixir
def deps do
Expand Down Expand Up @@ -232,3 +242,10 @@ may change at any time.
[W3C]: https://w3c.github.io/webdriver/
[Wallaby]: https://github.com/elixir-wallaby/wallaby
[Hound]: https://github.com/HashNuke/hound

## Copyright and License

Copyright (c) 2020 Aaron Renner

This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.
2 changes: 1 addition & 1 deletion lib/web_driver_client/json_wire_protocol_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ defmodule WebDriverClient.JSONWireProtocolClient do
end

@doc """
Fetchs the attribute value of an element
Fetches the attribute value of an element

Specification: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidelementidattributename
"""
Expand Down
22 changes: 16 additions & 6 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule WebDriverClient.MixProject do
use Mix.Project

@source_url "https://github.com/elixir-wallaby/web_driver_client"
@version "0.2.0"

def project do
Expand Down Expand Up @@ -47,7 +48,7 @@ defmodule WebDriverClient.MixProject do
{:excoveralls, "~> 0.10", only: :test},
{:credo, "~> 1.4.0", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.1.0", only: [:dev], runtime: false},
{:ex_doc, "~> 0.20", only: [:docs, :docs_prerelease]}
{:ex_doc, ">= 0.0.0", only: [:docs, :docs_prerelease]}
]
end

Expand All @@ -63,7 +64,15 @@ defmodule WebDriverClient.MixProject do

defp docs do
[
main: "WebDriverClient",
extras: [
"CHANGELOG.md": [],
"LICENSE.md": [title: "License"],
"README.md": [title: "Overview"]
],
main: "readme",
source_url: @source_url,
source_ref: "v#{@version}",
formatters: ["html"],
groups_for_modules: [
"Main API": [
WebDriverClient,
Expand Down Expand Up @@ -99,17 +108,18 @@ defmodule WebDriverClient.MixProject do
Elements: &(&1[:subject] == :elements),
Alerts: &(&1[:subject] == :alerts),
Logging: &(&1[:subject] == :logging)
],
source_ref: "v#{@version}",
source_url: "https://github.com/aaronrenner/web_driver_client"
]
]
end

defp package do
[
maintainers: ["Aaron Renner", "Michał Łępicki"],
licenses: ["MIT"],
links: %{github: "https://github.com/aaronrenner/web_driver_client"}
links: %{
Changelog: "https://hexdocs.pm/web_driver_client/changelog.html",
GitHub: @source_url
}
]
end
end
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"credo": {:hex, :credo, "1.4.0", "92339d4cbadd1e88b5ee43d427b639b68a11071b6f73854e33638e30a0ea11f5", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1fd3b70dce216574ce3c18bdf510b57e7c4c85c2ec9cad4bff854abaf7e58658"},
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
"earmark_parser": {:hex, :earmark_parser, "1.4.16", "607709303e1d4e3e02f1444df0c821529af1c03b8578dfc81bb9cf64553d02b9", [:mix], [], "hexpm", "69fcf696168f5a274dd012e3e305027010658b2d1630cef68421d6baaeaccead"},
"earmark_parser": {:hex, :earmark_parser, "1.4.18", "e1b2be73eb08a49fb032a0208bf647380682374a725dfb5b9e510def8397f6f2", [:mix], [], "hexpm", "114a0e85ec3cf9e04b811009e73c206394ffecfcc313e0b346de0d557774ee97"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.25.3", "3edf6a0d70a39d2eafde030b8895501b1c93692effcbd21347296c18e47618ce", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "9ebebc2169ec732a38e9e779fd0418c9189b3ca93f4a676c961be6c1527913f5"},
"ex_doc": {:hex, :ex_doc, "0.26.0", "1922164bac0b18b02f84d6f69cab1b93bc3e870e2ad18d5dacb50a9e06b542a3", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2775d66e494a9a48355db7867478ffd997864c61c65a47d31c4949459281c78d"},
"excoveralls": {:hex, :excoveralls, "0.14.3", "d17dc249ad32e469afd2bc656b58e810109d4367ec6bd467bed57a84dc4a3e02", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "b5aecdfdcf48e9d5e1c210841589b30981a5e7e66055cb8691a6f90b1601c108"},
"hackney": {:hex, :hackney, "1.18.0", "c4443d960bb9fba6d01161d01cd81173089686717d9490e5d3606644c48d121f", [:rebar3], [{:certifi, "~>2.8.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "9afcda620704d720db8c6a3123e9848d09c87586dc1c10479c42627b905b5c5e"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
Expand All @@ -20,7 +20,7 @@
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"plug": {:hex, :plug, "1.8.3", "12d5f9796dc72e8ac9614e94bda5e51c4c028d0d428e9297650d09e15a684478", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "164baaeb382d19beee0ec484492aa82a9c8685770aee33b24ec727a0971b34d0"},
"plug_cowboy": {:hex, :plug_cowboy, "2.1.0", "b75768153c3a8a9e8039d4b25bb9b14efbc58e9c4a6e6a270abff1cd30cbe320", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "6cd8ddd1bd1fbfa54d3fc61d4719c2057dae67615395d58d40437a919a46f132"},
Expand Down
2 changes: 1 addition & 1 deletion test/web_driver_client/w3c_wire_protocol_client_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ defmodule WebDriverClient.W3CWireProtocolClientTest do
end

defp build_start_session_payload do
%{"capablities" => %{"browserName" => "firefox"}}
%{"capabilities" => %{"browserName" => "firefox"}}
end

defp string_to_type do
Expand Down
2 changes: 1 addition & 1 deletion test/web_driver_client_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ defmodule WebDriverClientTest do
end

defp build_start_session_payload do
%{"capablities" => %{"browserName" => "firefox"}}
%{"capabilities" => %{"browserName" => "firefox"}}
end

defp stub_bypass_response(bypass, response) do
Expand Down