Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Commits
b7ff91dc
Commit
b7ff91dc
authored
2 years ago
by
Egi Brako
Committed by
Jakob Dieterle
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
updated multiple exams test
parent
92955244
No related branches found
Branches containing commit
No related tags found
1 merge request
!244
Resolve "Make exam a many to many field on StudentInfo model"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
functional_tests/multiple_exams_test.py
+36
-29
36 additions, 29 deletions
functional_tests/multiple_exams_test.py
with
36 additions
and
29 deletions
functional_tests/multiple_exams_test.py
+
36
−
29
View file @
b7ff91dc
...
...
@@ -72,7 +72,12 @@ class multipleExamsTest(GradyTestCase):
'
username
'
:
'
student03
'
,
'
password
'
:
'
p
'
,
'
exam
'
:
'
Test Exam 02
'
},
{
'
username
'
:
'
student04
'
,
'
password
'
:
'
p
'
,
'
exam
'
:
'
Test Exam 02
'
}
],
'
tutors
'
:
[
...
...
@@ -143,34 +148,36 @@ class multipleExamsTest(GradyTestCase):
self
.
browser
.
find_element_by_xpath
(
'
//button[@type=
"
submit
"
]
'
).
send_keys
(
Keys
.
ENTER
)
WebDriverWait
(
self
.
browser
,
10
).
until
(
ec
.
url_contains
(
'
/exam_selection
'
))
def
test_select_exam
(
self
):
testBool
=
True
reviewer
=
self
.
test_data
[
'
reviewers
'
][
0
]
self
.
_login
(
reviewer
)
items
=
self
.
browser
.
find_elements_by_id
(
"
listItem
"
)
for
i
in
range
(
len
(
items
)):
itemText
=
items
[
i
].
text
items
[
i
].
click
()
testBool
=
itemText
==
self
.
browser
.
find_element_by_class_name
(
"
title
"
).
text
if
(
testBool
!=
True
):
break
self
.
browser
.
find_element_by_id
(
"
examsButton
"
).
click
()
items
=
self
.
browser
.
find_elements_by_id
(
"
listItem
"
)
self
.
assertTrue
(
testBool
)
def
test_selection_of_exams
(
self
):
testBool
=
True
reviewer
=
self
.
test_data
[
'
reviewers
'
][
0
]
self
.
_login
(
reviewer
)
items
=
self
.
browser
.
find_elements_by_id
(
"
listItem
"
)
for
i
in
range
(
len
(
items
)):
itemText
=
items
[
i
].
text
items
[
i
].
click
()
testBool
=
itemText
==
self
.
browser
.
find_element_by_class_name
(
"
title
"
).
text
if
(
testBool
!=
True
):
break
self
.
browser
.
find_element_by_id
(
"
examsButton
"
).
click
()
items
=
self
.
browser
.
find_elements_by_id
(
"
listItem
"
)
self
.
assertTrue
(
testBool
)
def
test_check_students
(
self
):
students_on_file
=
0
for
student
in
self
.
test_data
[
'
students
'
]:
print
(
student
.
student
.
exams
.
all
()[
0
].
exam
)
if
str
(
student
.
student
.
exams
.
all
()[
0
].
exam
)
==
'
Test Exam 01
'
:
students_on_file
+=
1
print
(
students_on_file
)
reviewer
=
self
.
test_data
[
'
reviewers
'
][
0
]
self
.
_login
(
reviewer
)
self
.
browser
.
find_element_by_id
(
"
listItem
"
).
click
()
self
.
browser
.
find_element_by_xpath
(
'
//*[contains(text(),
"
Participants
"
)]
'
).
click
()
sleep
(
10
)
students
=
self
.
browser
.
find_elements_by_class_name
(
"
participant
"
)
print
(
len
(
students
))
self
.
assertTrue
(
students_on_file
==
students
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment