Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
e6e6962e
Commit
e6e6962e
authored
Jan 03, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tests for <mentoring-table> elements
parent
3fd36070
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
tests/test_table.py
+37
-0
tests/xml/table_1.xml
+6
-0
tests/xml/table_2.xml
+13
-0
No files found.
tests/test_table.py
0 → 100644
View file @
e6e6962e
# Imports ###########################################################
from
mentoring.test_base
import
MentoringBaseTest
# Classes ###########################################################
class
MentoringTableBlockTest
(
MentoringBaseTest
):
def
test_mentoring_table
(
self
):
# Initially, the table should be blank, with just the titles
table
=
self
.
go_to_page
(
'Table 2'
,
css_selector
=
'.mentoring-table'
)
headers
=
table
.
find_elements_by_css_selector
(
'th'
)
self
.
assertEqual
(
len
(
headers
),
2
)
self
.
assertEqual
(
headers
[
0
]
.
text
,
'Header Test 1'
)
self
.
assertEqual
(
headers
[
1
]
.
text
,
'Header Test 2'
)
rows
=
table
.
find_elements_by_css_selector
(
'td'
)
self
.
assertEqual
(
len
(
rows
),
2
)
self
.
assertEqual
(
rows
[
0
]
.
text
,
''
)
self
.
assertEqual
(
rows
[
1
]
.
text
,
''
)
# Fill the answers - they should appear in the table
mentoring
=
self
.
go_to_page
(
'Table 1'
)
answers
=
mentoring
.
find_elements_by_css_selector
(
'textarea'
)
answers
[
0
]
.
send_keys
(
'This is the answer #1'
)
answers
[
1
]
.
send_keys
(
'This is the answer #2'
)
submit
=
mentoring
.
find_element_by_css_selector
(
'input.submit'
)
submit
.
click
()
table
=
self
.
go_to_page
(
'Table 2'
,
css_selector
=
'.mentoring-table'
)
rows
=
table
.
find_elements_by_css_selector
(
'td'
)
self
.
assertEqual
(
len
(
rows
),
2
)
self
.
assertEqual
(
rows
[
0
]
.
text
,
'This is the answer #1'
)
self
.
assertEqual
(
rows
[
1
]
.
text
,
'This is the answer #2'
)
tests/xml/table_1.xml
0 → 100644
View file @
e6e6962e
<vertical>
<mentoring
url_name=
"table_1"
enforce_dependency=
"false"
>
<answer
name=
"table_1_answer_1"
/>
<answer
name=
"table_1_answer_2"
/>
</mentoring>
</vertical>
tests/xml/table_2.xml
0 → 100644
View file @
e6e6962e
<vertical>
<mentoring-table
type=
"table_test"
url_name=
"table_2"
>
<column>
<header>
Header Test 1
</header>
<answer
name=
"table_1_answer_1"
/>
</column>
<column>
<header>
Header Test 2
</header>
<answer
name=
"table_1_answer_2"
/>
</column>
</mentoring-table>
</vertical>
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