Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Add selenium integration test for login
💚 Fix travis script permissions
- Loading branch information
Showing
13 changed files
with
62 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ coverage.xml | |
env/ | ||
bin/ | ||
tmp/ | ||
ghostdriver.log |
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
Empty file.
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,5 +1,5 @@ | ||
import json | ||
from .fixtures import client | ||
from tests.fixtures import client | ||
|
||
|
||
def test_api_response(client): | ||
|
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
Empty file.
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
python run.py --test & | ||
|
||
sleep 1 | ||
|
||
py.test -v -s --driver PhantomJS tests/selenium | ||
exit_code=$? | ||
|
||
pkill -9 -f run.py && exit ${exit_code} |
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,18 @@ | ||
from tests.fixtures import TEST_USER | ||
|
||
|
||
def test_login(selenium): | ||
selenium.implicitly_wait(10) | ||
selenium.set_window_size(1124, 850) | ||
selenium.get('http://127.0.0.1:8000') | ||
selenium.find_element_by_id("navbar-login").click() | ||
assert selenium.title == "StarterWeppy | Account" | ||
email_input = selenium.find_element_by_id("email") | ||
email_input.clear() | ||
email_input.send_keys(TEST_USER.email) | ||
password_input = selenium.find_element_by_id("password") | ||
password_input.send_keys(TEST_USER.password) | ||
login_btn = selenium.find_element_by_css_selector("form > div:nth-child(4) > input") | ||
login_btn.click() | ||
loggedin_header = selenium.find_element_by_id("loggedin-header") | ||
assert loggedin_header.text == "Profile" |