Skip to content

Commit

Permalink
#0.7; fixes in selenium tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Sep 13, 2016
1 parent 4a63a38 commit 5245fe1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/requirements_django_1_10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ py==1.4.30
Pygments==2.0.2
pytz==2015.6
requests==2.8.1
selenium==2.48.0
selenium==2.53.6
simple-timer==0.2
simplegeneric==0.8.1
simplejson==3.8.0
Expand Down
3 changes: 3 additions & 0 deletions examples/simple/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@

LOGIN_REDIRECT_URL = '/fobi/' # Important for passing the selenium tests

if DJANGO_GTE_1_8:
LOGIN_REDIRECT_URL = '/en/fobi/' # Important for passing the selenium tests

#LOGIN_URL = '/accounts/login/'
#LOGIN_ERROR_URL = '/accounts/login/'
#LOGOUT_URL = '/accounts/logout/'
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_django_1_10.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
reset
./scripts/uninstall.sh
./scripts/install_django_1_10.sh
python examples/simple/manage.py test fobi --settings=settings_bootstrap3_theme_django_1_10 --traceback -v 3
python examples/simple/manage.py test fobi --settings=settings_bootstrap3_theme_django_1_10 --traceback -v 3 --liveserver=localhost:8081
10 changes: 7 additions & 3 deletions src/fobi/tests/test_browser_build_dynamic_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

from time import sleep

from selenium.webdriver.firefox.webdriver import WebDriver
# from selenium.webdriver.firefox.webdriver import WebDriver
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait

from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -51,7 +52,8 @@ class FobiBrowserBuldDynamicFormsTest(LiveServerTestCase):

@classmethod
def setUpClass(cls):
cls.selenium = WebDriver()
# cls.selenium = WebDriver()
cls.selenium = webdriver.Firefox()

setup_fobi(fobi_sync_plugins=True)
#user = get_or_create_admin_user()
Expand Down Expand Up @@ -93,7 +95,9 @@ def __authenticate(self):
# Make sure the user exists
user = get_or_create_admin_user()

self.selenium.get('{0}{1}'.format(self.__get_live_server_url(), settings.LOGIN_URL))
self.selenium.get(
'{0}{1}'.format(self.__get_live_server_url(), reverse('auth_login'))
)
self.selenium.maximize_window()
username_input = self.selenium.find_element_by_name("username")
username_input.send_keys(constants.FOBI_TEST_USER_USERNAME)
Expand Down

0 comments on commit 5245fe1

Please sign in to comment.