-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental selenium driver #198
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7b61584
Experimental Selenium driver
aaronrenner 4fa09d1
Handle 204 response from webdriver api
aaronrenner 150f583
Fix integration tests for selenium
aaronrenner 554c8f7
Fix test failure on a small screen
aaronrenner 80f2889
Fixes issues with click_button test
aaronrenner a7efab2
Fixing integration test on Selenium 2
aaronrenner 946e96b
Renamed PageObjects to Pages
aaronrenner 36a4b4e
Set default Session.server to :none
aaronrenner 7820dbe
Retry if can't start test session
aaronrenner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use Mix.Config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use Mix.Config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
use Mix.Config | ||
|
||
# Prevents timeouts in ExUnit | ||
config :wallaby, hackney_options: [timeout: 10_000, recv_timeout: 10_000] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
Code.require_file "../tests.exs", __DIR__ | ||
|
||
# Additional test cases supported by phantom | ||
Code.require_file "../cases/browser/dialog_test.exs", __DIR__ | ||
Code.require_file "../cases/browser/file_test.exs", __DIR__ | ||
Code.require_file "../cases/browser/screenshot_test.exs", __DIR__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Wallaby.Integration.Phantom.SendKeys do | ||
use Wallaby.Integration.SessionCase, async: true | ||
|
||
alias Wallaby.Phantom.Driver | ||
|
||
test "navigating with key presses", %{session: session} do | ||
session | ||
|> IndexPage.visit | ||
|> send_keys([:tab, :enter]) | ||
|> Page1.ensure_page_loaded | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Code.require_file "../tests.exs", __DIR__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ExUnit.configure(max_cases: 2, exclude: [pending: true]) | ||
ExUnit.start() | ||
|
||
# Load support files | ||
Code.require_file "../support/test_server.ex", __DIR__ | ||
Code.require_file "../support/pages/index_page.ex", __DIR__ | ||
Code.require_file "../support/pages/page_1.ex", __DIR__ | ||
Code.require_file "../support/session_case.ex", __DIR__ | ||
|
||
{:ok, server} = Wallaby.Integration.TestServer.start | ||
Application.put_env(:wallaby, :base_url, server.base_url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
defmodule Wallaby.Integration.Pages.IndexPage do | ||
use Wallaby.DSL | ||
|
||
def visit(session) do | ||
session | ||
|> visit("") | ||
end | ||
|
||
def click_page_1_link(session) do | ||
session | ||
|> click(Query.link("Page 1")) | ||
end | ||
|
||
def ensure_page_loaded(session) do | ||
session | ||
|> Browser.find(Query.css(".index-page")) | ||
|
||
session | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Wallaby.Integration.Pages.Page1 do | ||
use Wallaby.DSL | ||
|
||
def visit(session) do | ||
session | ||
|> visit("page_1.html") | ||
end | ||
|
||
def ensure_page_loaded(session) do | ||
session | ||
|> Browser.find(Query.css(".page-1-page")) | ||
|
||
session | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love seeing all of these! Using best practices in our own tests is awesome!