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
ae8b2c88
Commit
ae8b2c88
authored
Aug 06, 2013
by
Vasyl Nakvasiuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Word Cloud acceptance tests
parent
16b5b951
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
lms/djangoapps/courseware/features/word_cloud.feature
+16
-0
lms/djangoapps/courseware/features/word_cloud.py
+66
-0
No files found.
lms/djangoapps/courseware/features/word_cloud.feature
0 → 100644
View file @
ae8b2c88
Feature
:
World Cloud component
As a student, I want to view Word Cloud component in LMS.
Scenario
:
Word Cloud component in LMS is rendered with empty result
Given
the course has a Word Cloud component
Then
I view the word cloud and it has rendered
When
I press the Save button
Then
I see the empty result
Scenario
:
Word Cloud component in LMS is rendered with result
Given
the course has a Word Cloud component
Then
I view the word cloud and it has rendered
When
I fill inputs
And
I press the Save button
Then
I see the result with words count
\ No newline at end of file
lms/djangoapps/courseware/features/word_cloud.py
0 → 100644
View file @
ae8b2c88
#pylint: disable=C0111
from
time
import
sleep
from
lettuce
import
world
,
step
from
lettuce.django
import
django_url
from
common
import
i_am_registered_for_the_course
,
section_location
@step
(
'I view the word cloud and it has rendered'
)
def
word_cloud_is_rendered
(
_step
):
assert
world
.
is_css_present
(
'.word_cloud'
)
@step
(
'the course has a Word Cloud component'
)
def
view_word_cloud
(
_step
):
coursenum
=
'test_course'
i_am_registered_for_the_course
(
_step
,
coursenum
)
add_word_cloud_to_course
(
coursenum
)
chapter_name
=
world
.
scenario_dict
[
'SECTION'
]
.
display_name
.
replace
(
" "
,
"_"
)
section_name
=
chapter_name
url
=
django_url
(
'/courses/
%
s/
%
s/
%
s/courseware/
%
s/
%
s'
%
(
world
.
scenario_dict
[
'COURSE'
]
.
org
,
world
.
scenario_dict
[
'COURSE'
]
.
number
,
world
.
scenario_dict
[
'COURSE'
]
.
display_name
.
replace
(
' '
,
'_'
),
chapter_name
,
section_name
,)
)
world
.
browser
.
visit
(
url
)
@step
(
'I press the Save button'
)
def
press_the_save_button
(
_step
):
button_css
=
'.input_cloud_section input.save'
elem
=
world
.
css_find
(
button_css
)
.
first
world
.
css_has_text
(
button_css
,
elem
)
world
.
css_click
(
button_css
)
@step
(
'I see the empty result'
)
def
see_empty_result
(
_step
):
assert
(
world
.
css_text
(
'.your_words'
,
0
)
==
''
)
@step
(
'I fill inputs'
)
def
fill_inputs
(
_step
):
input_css
=
'.input_cloud_section .input-cloud'
world
.
css_fill
(
input_css
,
'text1'
,
0
)
for
index
in
range
(
1
,
4
):
world
.
css_fill
(
'.input_cloud_section .input-cloud'
,
'text2'
,
index
)
@step
(
'I see the result with words count'
)
def
see_result
(
_step
):
strong_css
=
'.your_words strong'
target_text
=
set
([
world
.
css_text
(
strong_css
,
i
)
for
i
in
range
(
2
)])
assert
set
([
'text1'
,
'text2'
])
==
target_text
def
add_word_cloud_to_course
(
course
):
category
=
'word_cloud'
world
.
ItemFactory
.
create
(
parent_location
=
section_location
(
course
),
category
=
category
,
display_name
=
'Word Cloud'
)
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