Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
7ac0cd44
Kaydet (Commit)
7ac0cd44
authored
Agu 20, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25323 -- Fixed selenium test failures with chromedriver 2.18.
üst
01b2b0b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
14 deletions
+22
-14
tests.py
django/contrib/admin/tests.py
+7
-0
tests.py
tests/admin_views/tests.py
+8
-2
tests.py
tests/admin_widgets/tests.py
+7
-12
No files found.
django/contrib/admin/tests.py
Dosyayı görüntüle @
7ac0cd44
...
...
@@ -45,6 +45,13 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
from
selenium.webdriver.support.wait
import
WebDriverWait
WebDriverWait
(
self
.
selenium
,
timeout
)
.
until
(
callback
)
def
wait_for_popup
(
self
,
num_windows
=
2
,
timeout
=
10
):
"""
Block until `num_windows` are present (usually 2, but can be
overridden in the case of pop-ups opening other pop-ups).
"""
self
.
wait_until
(
lambda
d
:
len
(
d
.
window_handles
)
==
num_windows
,
timeout
)
def
wait_loaded_tag
(
self
,
tag_name
,
timeout
=
10
):
"""
Helper function that blocks until the element with the given tag name
...
...
tests/admin_views/tests.py
Dosyayı görüntüle @
7ac0cd44
...
...
@@ -4607,8 +4607,11 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
self
.
admin_login
(
username
=
'super'
,
password
=
'secret'
,
login_url
=
reverse
(
'admin:index'
))
self
.
selenium
.
get
(
full_url
)
self
.
selenium
.
find_element_by_class_name
(
'deletelink'
)
.
click
()
# Wait until we're on the delete page.
self
.
wait_for
(
'.cancel-link'
)
self
.
selenium
.
find_element_by_class_name
(
'cancel-link'
)
.
click
()
self
.
wait_page_loaded
()
# Wait until we're back on the change page.
self
.
wait_for_text
(
'#content h1'
,
'Change pizza'
)
self
.
assertEqual
(
self
.
selenium
.
current_url
,
full_url
)
self
.
assertEqual
(
Pizza
.
objects
.
count
(),
1
)
...
...
@@ -4626,8 +4629,11 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
self
.
admin_login
(
username
=
'super'
,
password
=
'secret'
,
login_url
=
reverse
(
'admin:index'
))
self
.
selenium
.
get
(
full_url
)
self
.
selenium
.
find_element_by_class_name
(
'deletelink'
)
.
click
()
# Wait until we're on the delete page.
self
.
wait_for
(
'.cancel-link'
)
self
.
selenium
.
find_element_by_class_name
(
'cancel-link'
)
.
click
()
self
.
wait_page_loaded
()
# Wait until we're back on the change page.
self
.
wait_for_text
(
'#content h1'
,
'Change pizza'
)
self
.
assertEqual
(
self
.
selenium
.
current_url
,
full_url
)
self
.
assertEqual
(
Pizza
.
objects
.
count
(),
1
)
self
.
assertEqual
(
Topping
.
objects
.
count
(),
2
)
...
...
tests/admin_widgets/tests.py
Dosyayı görüntüle @
7ac0cd44
...
...
@@ -766,13 +766,8 @@ class DateTimePickerSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDriv
# Click on the calendar icon
self
.
selenium
.
find_element_by_id
(
'calendarlink0'
)
.
click
()
# Get the calendar caption
calendar0
=
self
.
selenium
.
find_element_by_id
(
'calendarin0'
)
caption
=
calendar0
.
find_element_by_tag_name
(
'caption'
)
# Make sure that the right month and year are displayed
self
.
assertEqual
(
caption
.
text
,
expected_caption
)
self
.
wait_for_text
(
'#calendarin0 caption'
,
expected_caption
)
class
DateTimePickerSeleniumChromeTests
(
DateTimePickerSeleniumFirefoxTests
):
...
...
@@ -1130,8 +1125,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Open the popup window and click on a band
self
.
selenium
.
find_element_by_id
(
'lookup_id_main_band'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
'id_main_band'
)
self
.
wait_page_loaded
()
link
=
self
.
selenium
.
find_element_by_link_text
(
'Bogey Blues'
)
self
.
assertIn
(
'/band/42/'
,
link
.
get_attribute
(
'href'
))
link
.
click
()
...
...
@@ -1142,8 +1137,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Reopen the popup window and click on another band
self
.
selenium
.
find_element_by_id
(
'lookup_id_main_band'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
'id_main_band'
)
self
.
wait_page_loaded
()
link
=
self
.
selenium
.
find_element_by_link_text
(
'Green Potatoes'
)
self
.
assertIn
(
'/band/98/'
,
link
.
get_attribute
(
'href'
))
link
.
click
()
...
...
@@ -1165,8 +1160,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Open the popup window and click on a band
self
.
selenium
.
find_element_by_id
(
'lookup_id_supporting_bands'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
'id_supporting_bands'
)
self
.
wait_page_loaded
()
link
=
self
.
selenium
.
find_element_by_link_text
(
'Bogey Blues'
)
self
.
assertIn
(
'/band/42/'
,
link
.
get_attribute
(
'href'
))
link
.
click
()
...
...
@@ -1177,8 +1172,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Reopen the popup window and click on another band
self
.
selenium
.
find_element_by_id
(
'lookup_id_supporting_bands'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
'id_supporting_bands'
)
self
.
wait_page_loaded
()
link
=
self
.
selenium
.
find_element_by_link_text
(
'Green Potatoes'
)
self
.
assertIn
(
'/band/98/'
,
link
.
get_attribute
(
'href'
))
link
.
click
()
...
...
@@ -1211,8 +1206,8 @@ class RelatedFieldWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWeb
main_window
=
self
.
selenium
.
current_window_handle
# Click the Add User button to add new
self
.
selenium
.
find_element_by_id
(
'add_id_user'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
'id_user'
)
self
.
wait_for
(
'#id_password'
)
password_field
=
self
.
selenium
.
find_element_by_id
(
'id_password'
)
password_field
.
send_keys
(
'password'
)
...
...
@@ -1228,8 +1223,8 @@ class RelatedFieldWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWeb
# Click the Change User button to change it
self
.
selenium
.
find_element_by_id
(
'change_id_user'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
'id_user'
)
self
.
wait_page_loaded
()
username_field
=
self
.
selenium
.
find_element_by_id
(
'id_username'
)
username_value
=
'changednewuser'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment