Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
222fdec5
Commit
222fdec5
authored
Aug 21, 2015
by
raeeschachar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test_new_textbook_uplaod test that was failing on Chrome
parent
73722c47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
common/test/acceptance/pages/studio/textbooks.py
+4
-12
common/test/acceptance/tests/studio/test_studio_textbooks.py
+1
-1
No files found.
common/test/acceptance/pages/studio/textbooks.py
View file @
222fdec5
...
@@ -49,23 +49,15 @@ class TextbooksPage(CoursePage):
...
@@ -49,23 +49,15 @@ class TextbooksPage(CoursePage):
file_input
=
self
.
q
(
css
=
".upload-dialog input"
)
.
results
[
0
]
file_input
=
self
.
q
(
css
=
".upload-dialog input"
)
.
results
[
0
]
file_input
.
send_keys
(
file_path
)
file_input
.
send_keys
(
file_path
)
click_css
(
self
,
".wrapper-modal-window-assetupload .action-upload"
,
require_notification
=
False
)
click_css
(
self
,
".wrapper-modal-window-assetupload .action-upload"
,
require_notification
=
False
)
self
.
wait_for_element_absence
(
".
upload dialog
"
,
"Upload modal closed"
)
self
.
wait_for_element_absence
(
".
modal-window-overlay
"
,
"Upload modal closed"
)
def
click_textbook_submit_button
(
self
):
def
click_textbook_submit_button
(
self
):
"""
"""
Submit the new textbook form and check if it is rendered properly.
Submit the new textbook form and check if it is rendered properly.
"""
"""
def
click_save
():
self
.
wait_for_element_visibility
(
'#edit_textbook_form button[type="submit"]'
,
'Save button visibility'
)
"""
self
.
q
(
css
=
'#edit_textbook_form button[type="submit"]'
)
.
first
.
click
()
Continue to click the save button until the form is no longer present. Without this,
self
.
wait_for_element_absence
(
".wrapper-form"
,
"Add/Edit form closed"
)
the test sporadically fails because the click is too early.
"""
save_button
=
self
.
q
(
css
=
'#edit_textbook_form button[type="submit"]'
)
.
results
if
len
(
save_button
)
>
0
:
save_button
[
0
]
.
click
()
return
not
self
.
q
(
css
=
"#edit_textbook_form"
)
.
present
self
.
wait_for
(
click_save
,
"Editing form should close."
)
def
is_view_live_link_worked
(
self
):
def
is_view_live_link_worked
(
self
):
"""
"""
...
...
common/test/acceptance/tests/studio/test_studio_textbooks.py
View file @
222fdec5
...
@@ -46,6 +46,6 @@ class TextbooksTest(StudioCourseTest):
...
@@ -46,6 +46,6 @@ class TextbooksTest(StudioCourseTest):
self
.
textbook_page
.
open_add_textbook_form
()
self
.
textbook_page
.
open_add_textbook_form
()
self
.
textbook_page
.
upload_pdf_file
(
'textbook.pdf'
)
self
.
textbook_page
.
upload_pdf_file
(
'textbook.pdf'
)
self
.
textbook_page
.
set_input_field_value
(
'.edit-textbook #textbook-name-input'
,
'book_1'
)
self
.
textbook_page
.
set_input_field_value
(
'.edit-textbook #textbook-name-input'
,
'book_1'
)
self
.
textbook_page
.
set_input_field_value
(
'.edit-textbook #chapter1-name'
,
'chap
ter
_1'
)
self
.
textbook_page
.
set_input_field_value
(
'.edit-textbook #chapter1-name'
,
'chap_1'
)
self
.
textbook_page
.
click_textbook_submit_button
()
self
.
textbook_page
.
click_textbook_submit_button
()
self
.
assertTrue
(
self
.
textbook_page
.
is_view_live_link_worked
())
self
.
assertTrue
(
self
.
textbook_page
.
is_view_live_link_worked
())
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