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
19513e41
Commit
19513e41
authored
Jul 03, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored all clicks to use the css_click method
parent
9a5326bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
cms/djangoapps/contentstore/features/checklists.py
+2
-2
cms/djangoapps/contentstore/features/static-pages.py
+6
-6
cms/djangoapps/contentstore/features/upload.py
+5
-5
common/djangoapps/terrain/ui_helpers.py
+3
-3
No files found.
cms/djangoapps/contentstore/features/checklists.py
View file @
19513e41
...
...
@@ -115,7 +115,7 @@ def clickActionLink(checklist, task, actionText):
# text will be empty initially, wait for it to populate
def
verify_action_link_text
(
driver
):
return
action_link
.
text
==
actionText
return
world
.
css_text
(
'#course-checklist'
+
str
(
checklist
)
+
' a'
,
index
=
task
)
==
actionText
world
.
wait_for
(
verify_action_link_text
)
action_link
.
click
(
)
world
.
css_click
(
'#course-checklist'
+
str
(
checklist
)
+
' a'
,
index
=
task
)
cms/djangoapps/contentstore/features/static-pages.py
View file @
19513e41
...
...
@@ -9,14 +9,14 @@ from selenium.webdriver.common.keys import Keys
def
go_to_static
(
_step
):
menu_css
=
'li.nav-course-courseware'
static_css
=
'li.nav-course-courseware-pages'
world
.
css_
find
(
menu_css
)
.
click
(
)
world
.
css_
find
(
static_css
)
.
click
(
)
world
.
css_
click
(
menu_css
)
world
.
css_
click
(
static_css
)
@step
(
u'I add a new page'
)
def
add_page
(
_step
):
button_css
=
'a.new-button'
world
.
css_
find
(
button_css
)
.
click
(
)
world
.
css_
click
(
button_css
)
@step
(
u'I should( not)? see a "([^"]*)" static page$'
)
...
...
@@ -33,13 +33,13 @@ def click_edit_delete(_step, edit_delete, page):
button_css
=
'a.
%
s-button'
%
edit_delete
index
=
get_index
(
page
)
assert
index
!=
-
1
world
.
css_
find
(
button_css
)[
index
]
.
click
(
)
world
.
css_
click
(
button_css
,
index
=
index
)
@step
(
u'I change the name to "([^"]*)"$'
)
def
change_name
(
_step
,
new_name
):
settings_css
=
'#settings-mode'
world
.
css_
find
(
settings_css
)
.
click
(
)
world
.
css_
click
(
settings_css
)
input_css
=
'input.setting-input'
name_input
=
world
.
css_find
(
input_css
)
old_name
=
name_input
.
value
...
...
@@ -47,7 +47,7 @@ def change_name(_step, new_name):
name_input
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
name_input
.
_element
.
send_keys
(
new_name
)
save_button
=
'a.save-button'
world
.
css_
find
(
save_button
)
.
click
(
)
world
.
css_
click
(
save_button
)
def
get_index
(
name
):
...
...
cms/djangoapps/contentstore/features/upload.py
View file @
19513e41
...
...
@@ -16,23 +16,23 @@ HTTP_PREFIX = "http://localhost:8001"
def
go_to_uploads
(
_step
):
menu_css
=
'li.nav-course-courseware'
uploads_css
=
'li.nav-course-courseware-uploads'
world
.
css_
find
(
menu_css
)
.
click
(
)
world
.
css_
find
(
uploads_css
)
.
click
(
)
world
.
css_
click
(
menu_css
)
world
.
css_
click
(
uploads_css
)
@step
(
u'I upload the file "([^"]*)"$'
)
def
upload_file
(
_step
,
file_name
):
upload_css
=
'a.upload-button'
world
.
css_
find
(
upload_css
)
.
click
(
)
world
.
css_
click
(
upload_css
)
file_css
=
'input.file-input'
upload
=
world
.
css_
find
(
file_css
)
upload
=
world
.
css_
click
(
file_css
)
#uploading the file itself
path
=
os
.
path
.
join
(
TEST_ROOT
,
'uploads/'
,
file_name
)
upload
.
_element
.
send_keys
(
os
.
path
.
abspath
(
path
))
close_css
=
'a.close-button'
world
.
css_
find
(
close_css
)
.
click
(
)
world
.
css_
click
(
close_css
)
@step
(
u'I should( not)? see the file "([^"]*)" was uploaded$'
)
...
...
common/djangoapps/terrain/ui_helpers.py
View file @
19513e41
...
...
@@ -153,16 +153,16 @@ def click_link(partial_text):
@world.absorb
def
css_text
(
css_selector
):
def
css_text
(
css_selector
,
index
=
0
):
# Wait for the css selector to appear
if
world
.
is_css_present
(
css_selector
):
try
:
return
world
.
browser
.
find_by_css
(
css_selector
)
.
first
.
text
return
world
.
browser
.
find_by_css
(
css_selector
)
[
index
]
.
text
except
StaleElementReferenceException
:
# The DOM was still redrawing. Wait a second and try again.
world
.
wait
(
1
)
return
world
.
browser
.
find_by_css
(
css_selector
)
.
first
.
text
return
world
.
browser
.
find_by_css
(
css_selector
)
[
index
]
.
text
else
:
return
""
...
...
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