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
152ba723
Commit
152ba723
authored
Oct 03, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract SeleniumBaseTest to xblock-utils
parent
00880fcb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
83 deletions
+34
-83
mentoring/test_base.py
+0
-78
tests/integration/base_test.py
+29
-0
tests/integration/test_answer.py
+1
-1
tests/integration/test_assessment.py
+1
-1
tests/integration/test_mcq.py
+1
-1
tests/integration/test_progression.py
+1
-1
tests/integration/test_table.py
+1
-1
No files found.
mentoring/test_base.py
deleted
100644 → 0
View file @
00880fcb
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Harvard
#
# Authors:
# Xavier Antoviaque <xavier@antoviaque.org>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) as published by the Free
# Software Foundation (FSF), either version 3 of the License, or (at your
# option) any later version of the AGPL published by the FSF.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program in a file in the toplevel directory called
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
#
# Imports ###########################################################
import
time
from
selenium.webdriver.support.ui
import
WebDriverWait
from
workbench
import
scenarios
from
workbench.test.selenium_test
import
SeleniumTest
from
.utils
import
load_scenarios_from_path
# Classes ###########################################################
class
MentoringBaseTest
(
SeleniumTest
):
def
setUp
(
self
):
super
(
MentoringBaseTest
,
self
)
.
setUp
()
# Use test scenarios
self
.
browser
.
get
(
self
.
live_server_url
)
# Needed to load tests once
scenarios
.
SCENARIOS
.
clear
()
scenarios_list
=
load_scenarios_from_path
(
'../tests/integration/xml'
)
for
identifier
,
title
,
xml
in
scenarios_list
:
scenarios
.
add_xml_scenario
(
identifier
,
title
,
xml
)
self
.
addCleanup
(
scenarios
.
remove_scenario
,
identifier
)
# Suzy opens the browser to visit the workbench
self
.
browser
.
get
(
self
.
live_server_url
)
# She knows it's the site by the header
header1
=
self
.
browser
.
find_element_by_css_selector
(
'h1'
)
self
.
assertEqual
(
header1
.
text
,
'XBlock scenarios'
)
def
wait_until_disabled
(
self
,
submit
):
wait
=
WebDriverWait
(
submit
,
10
)
wait
.
until
(
lambda
s
:
not
s
.
is_enabled
(),
"{} should be disabled"
.
format
(
submit
.
text
))
def
wait_until_clickable
(
self
,
submit
):
wait
=
WebDriverWait
(
submit
,
10
)
wait
.
until
(
lambda
s
:
s
.
is_displayed
()
and
s
.
is_enabled
(),
"{} should be cliclable"
.
format
(
submit
.
text
))
def
wait_until_text_in
(
self
,
text
,
elem
):
wait
=
WebDriverWait
(
elem
,
10
)
wait
.
until
(
lambda
elem
:
text
in
elem
.
text
,
"{} should be in {}"
.
format
(
text
,
elem
.
text
))
def
go_to_page
(
self
,
page_name
,
css_selector
=
'div.mentoring'
):
"""
Navigate to the page `page_name`, as listed on the workbench home
Returns the DOM element on the visited page located by the `css_selector`
"""
self
.
browser
.
get
(
self
.
live_server_url
)
self
.
browser
.
find_element_by_link_text
(
page_name
)
.
click
()
time
.
sleep
(
1
)
mentoring
=
self
.
browser
.
find_element_by_css_selector
(
css_selector
)
return
mentoring
tests/integration/base_test.py
0 → 100644
View file @
152ba723
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Harvard
#
# Authors:
# Xavier Antoviaque <xavier@antoviaque.org>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) as published by the Free
# Software Foundation (FSF), either version 3 of the License, or (at your
# option) any later version of the AGPL published by the FSF.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program in a file in the toplevel directory called
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
#
from
xblockutils.base_test
import
SeleniumBaseTest
class
MentoringBaseTest
(
SeleniumBaseTest
):
module_name
=
__name__
default_css_selector
=
'div.mentoring'
tests/integration/test_answer.py
View file @
152ba723
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
# Imports ###########################################################
# Imports ###########################################################
from
mentoring.test_base
import
MentoringBaseTest
from
.base_test
import
MentoringBaseTest
# Classes ###########################################################
# Classes ###########################################################
...
...
tests/integration/test_assessment.py
View file @
152ba723
from
mentoring.test_base
import
MentoringBaseTest
from
.base_test
import
MentoringBaseTest
class
MentoringAssessmentTest
(
MentoringBaseTest
):
class
MentoringAssessmentTest
(
MentoringBaseTest
):
...
...
tests/integration/test_mcq.py
View file @
152ba723
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
# Imports ###########################################################
# Imports ###########################################################
from
mentoring.test_base
import
MentoringBaseTest
from
.base_test
import
MentoringBaseTest
# Classes ###########################################################
# Classes ###########################################################
...
...
tests/integration/test_progression.py
View file @
152ba723
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
# Imports ###########################################################
# Imports ###########################################################
from
mentoring.test_base
import
MentoringBaseTest
from
.base_test
import
MentoringBaseTest
# Classes ###########################################################
# Classes ###########################################################
...
...
tests/integration/test_table.py
View file @
152ba723
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
# Imports ###########################################################
# Imports ###########################################################
from
mentoring.test_base
import
MentoringBaseTest
from
.base_test
import
MentoringBaseTest
# Classes ###########################################################
# Classes ###########################################################
...
...
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