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
0c5b7ab3
Commit
0c5b7ab3
authored
Nov 07, 2016
by
Andy Armstrong
Committed by
GitHub
Nov 07, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13883 from edx/andya/long-error-messages
Introduce a new AcceptanceTest base class
parents
8ffc9197
5b0c60e9
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
64 additions
and
56 deletions
+64
-56
common/test/acceptance/performance/test_studio_performance.py
+6
-3
common/test/acceptance/tests/helpers.py
+16
-4
common/test/acceptance/tests/lms/test_account_settings.py
+5
-7
common/test/acceptance/tests/lms/test_learner_profile.py
+4
-5
common/test/acceptance/tests/lms/test_lms_course_discovery.py
+2
-3
common/test/acceptance/tests/lms/test_lms_dashboard_search.py
+2
-3
common/test/acceptance/tests/lms/test_lms_index.py
+2
-2
common/test/acceptance/tests/lms/test_oauth2.py
+5
-4
common/test/acceptance/tests/studio/base_studio_test.py
+2
-3
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
+2
-3
common/test/acceptance/tests/studio/test_studio_course_create.py
+3
-2
common/test/acceptance/tests/studio/test_studio_general.py
+3
-5
common/test/acceptance/tests/studio/test_studio_help.py
+8
-8
common/test/acceptance/tests/studio/test_studio_home.py
+4
-4
No files found.
common/test/acceptance/performance/test_studio_performance.py
View file @
0c5b7ab3
"""
Single page performance tests for Studio.
"""
from
bok_choy.web_app_test
import
WebAppTest
,
with_cache
from
bok_choy.web_app_test
import
with_cache
from
nose.plugins.attrib
import
attr
from
..tests.helpers
import
AcceptanceTest
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.studio.overview
import
CourseOutlinePage
from
nose.plugins.attrib
import
attr
@attr
(
har_mode
=
'explicit'
)
class
StudioPagePerformanceTest
(
WebApp
Test
):
class
StudioPagePerformanceTest
(
Acceptance
Test
):
"""
Base class to capture studio performance with HTTP Archives.
...
...
common/test/acceptance/tests/helpers.py
View file @
0c5b7ab3
...
...
@@ -415,7 +415,7 @@ def assert_opened_help_link_is_correct(test, url):
"""
Asserts that url of browser when help link is clicked is correct.
Arguments:
test (
WebApp
Test): test calling this method.
test (
Acceptance
Test): test calling this method.
url (str): url to verify.
"""
test
.
browser
.
switch_to_window
(
test
.
browser
.
window_handles
[
-
1
])
...
...
@@ -697,7 +697,19 @@ class CollectedEventsDescription(object):
return
'
\n\n
'
.
join
(
message_lines
)
class
UniqueCourseTest
(
WebAppTest
):
class
AcceptanceTest
(
WebAppTest
):
"""
The base class of all acceptance tests.
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
AcceptanceTest
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
# Use long messages so that failures show actual and expected values
self
.
longMessage
=
True
# pylint: disable=invalid-name
class
UniqueCourseTest
(
AcceptanceTest
):
"""
Test that provides a unique course ID.
"""
...
...
@@ -825,7 +837,7 @@ def assert_nav_help_link(test, page, href, signed_in=True):
then clicks to ensure that help opens correctly.
Arguments:
test (
WebApp
Test): Test object
test (
Acceptance
Test): Test object
page (PageObject): Page object to perform tests on.
href (str): The help link which we expect to see when it is opened.
signed_in (bool): Specifies whether user is logged in or not. (It effects the css)
...
...
@@ -850,7 +862,7 @@ def assert_side_bar_help_link(test, page, href, help_text, as_list_item=False, i
then clicks to ensure that help opens correctly.
Arguments:
test (
WebApp
Test): Test object
test (
Acceptance
Test): Test object
page (PageObject): Page object to perform tests on.
href (str): The help link which we expect to see when it is opened.
as_list_item (bool): Specifies whether help element is in one of the
...
...
common/test/acceptance/tests/lms/test_account_settings.py
View file @
0c5b7ab3
...
...
@@ -5,19 +5,17 @@ End-to-end tests for the Account Settings page.
from
datetime
import
datetime
from
unittest
import
skip
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.page_object
import
XSS_INJECTION
from
flaky
import
flaky
from
nose.plugins.attrib
import
attr
from
pytz
import
timezone
,
utc
from
common.test.acceptance.pages.lms.account_settings
import
AccountSettingsPage
from
common.test.acceptance.pages.lms.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.lms.dashboard
import
DashboardPage
from
common.test.acceptance.tests.helpers
import
EventsTestMixin
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
,
EventsTestMixin
class
AccountSettingsTestMixin
(
EventsTestMixin
,
WebApp
Test
):
class
AccountSettingsTestMixin
(
EventsTestMixin
,
Acceptance
Test
):
"""
Mixin with helper methods to test the account settings page.
"""
...
...
@@ -91,7 +89,7 @@ class AccountSettingsTestMixin(EventsTestMixin, WebAppTest):
@attr
(
shard
=
8
)
class
DashboardMenuTest
(
AccountSettingsTestMixin
,
WebApp
Test
):
class
DashboardMenuTest
(
AccountSettingsTestMixin
,
Acceptance
Test
):
"""
Tests that the dashboard menu works correctly with the account settings page.
"""
...
...
@@ -114,7 +112,7 @@ class DashboardMenuTest(AccountSettingsTestMixin, WebAppTest):
@attr
(
shard
=
8
)
class
AccountSettingsPageTest
(
AccountSettingsTestMixin
,
WebApp
Test
):
class
AccountSettingsPageTest
(
AccountSettingsTestMixin
,
Acceptance
Test
):
"""
Tests that verify behaviour of the Account Settings page.
"""
...
...
@@ -503,7 +501,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest):
@attr
(
'a11y'
)
class
AccountSettingsA11yTest
(
AccountSettingsTestMixin
,
WebApp
Test
):
class
AccountSettingsA11yTest
(
AccountSettingsTestMixin
,
Acceptance
Test
):
"""
Class to test account settings accessibility.
"""
...
...
common/test/acceptance/tests/lms/test_learner_profile.py
View file @
0c5b7ab3
...
...
@@ -4,7 +4,6 @@ End-to-end tests for Student's Profile Page.
"""
from
contextlib
import
contextmanager
from
bok_choy.web_app_test
import
WebAppTest
from
datetime
import
datetime
from
nose.plugins.attrib
import
attr
...
...
@@ -14,7 +13,7 @@ from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage
from
common.test.acceptance.pages.lms.learner_profile
import
LearnerProfilePage
from
common.test.acceptance.pages.lms.dashboard
import
DashboardPage
from
common.test.acceptance.tests.helpers
import
EventsTestMixin
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
,
EventsTestMixin
class
LearnerProfileTestMixin
(
EventsTestMixin
):
...
...
@@ -181,7 +180,7 @@ class LearnerProfileTestMixin(EventsTestMixin):
@attr
(
shard
=
4
)
class
OwnLearnerProfilePageTest
(
LearnerProfileTestMixin
,
WebApp
Test
):
class
OwnLearnerProfilePageTest
(
LearnerProfileTestMixin
,
Acceptance
Test
):
"""
Tests that verify a student's own profile page.
"""
...
...
@@ -696,7 +695,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
@attr
(
shard
=
4
)
class
DifferentUserLearnerProfilePageTest
(
LearnerProfileTestMixin
,
WebApp
Test
):
class
DifferentUserLearnerProfilePageTest
(
LearnerProfileTestMixin
,
Acceptance
Test
):
"""
Tests that verify viewing the profile page of a different user.
"""
...
...
@@ -763,7 +762,7 @@ class DifferentUserLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
@attr
(
'a11y'
)
class
LearnerProfileA11yTest
(
LearnerProfileTestMixin
,
WebApp
Test
):
class
LearnerProfileA11yTest
(
LearnerProfileTestMixin
,
Acceptance
Test
):
"""
Class to test learner profile accessibility.
"""
...
...
common/test/acceptance/tests/lms/test_lms_course_discovery.py
View file @
0c5b7ab3
...
...
@@ -5,15 +5,14 @@ import datetime
import
json
import
uuid
from
bok_choy.web_app_test
import
WebAppTest
from
common.test.acceptance.tests.helpers
import
remove_file
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
,
remove_file
from
common.test.acceptance.pages.common.logout
import
LogoutPage
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.lms.discovery
import
CourseDiscoveryPage
from
common.test.acceptance.fixtures.course
import
CourseFixture
class
CourseDiscoveryTest
(
WebApp
Test
):
class
CourseDiscoveryTest
(
Acceptance
Test
):
"""
Test searching for courses.
"""
...
...
common/test/acceptance/tests/lms/test_lms_dashboard_search.py
View file @
0c5b7ab3
...
...
@@ -4,8 +4,7 @@ Test dashboard search
import
os
import
json
from
bok_choy.web_app_test
import
WebAppTest
from
common.test.acceptance.tests.helpers
import
generate_course_key
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
,
generate_course_key
from
common.test.acceptance.pages.common.logout
import
LogoutPage
from
common.test.acceptance.pages.common.utils
import
click_css
from
common.test.acceptance.pages.studio.utils
import
add_html_component
,
type_in_codemirror
...
...
@@ -16,7 +15,7 @@ from common.test.acceptance.pages.lms.dashboard_search import DashboardSearchPag
from
common.test.acceptance.fixtures.course
import
CourseFixture
,
XBlockFixtureDesc
class
DashboardSearchTest
(
WebApp
Test
):
class
DashboardSearchTest
(
Acceptance
Test
):
"""
Test dashboard search.
"""
...
...
common/test/acceptance/tests/lms/test_lms_index.py
View file @
0c5b7ab3
...
...
@@ -5,11 +5,11 @@ what students see @ edx.org because we redirect requests to a separate web appli
"""
import
datetime
from
bok_choy.web_app_test
import
WebAppTest
from
common.test.acceptance.pages.lms.index
import
IndexPage
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
class
BaseLmsIndexTest
(
WebApp
Test
):
class
BaseLmsIndexTest
(
Acceptance
Test
):
""" Base test suite for the LMS Index (Home) page """
def
setUp
(
self
):
...
...
common/test/acceptance/tests/lms/test_oauth2.py
View file @
0c5b7ab3
# -*- coding: utf-8 -*-
"""Tests for OAuth2 permission delegation."""
from
common.test.acceptance.pages.lms.oauth2_confirmation
import
OAuth2Confirmation
from
common.test.acceptance.pages.lms.auto_auth
import
AutoAuthPage
from
bok_choy.web_app_test
import
WebAppTest
from
urlparse
import
urlparse
,
parse_qsl
from
common.test.acceptance.pages.lms.oauth2_confirmation
import
OAuth2Confirmation
from
common.test.acceptance.pages.lms.auto_auth
import
AutoAuthPage
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
class
OAuth2PermissionDelegationTests
(
WebApp
Test
):
class
OAuth2PermissionDelegationTests
(
Acceptance
Test
):
"""
Tests for acceptance/denial of permission delegation requests.
"""
...
...
common/test/acceptance/tests/studio/base_studio_test.py
View file @
0c5b7ab3
"""
Base classes used by studio tests.
"""
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.page_object
import
XSS_INJECTION
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
from
common.test.acceptance.fixtures.course
import
CourseFixture
from
common.test.acceptance.fixtures.library
import
LibraryFixture
from
common.test.acceptance.tests.helpers
import
UniqueCourseTest
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
,
UniqueCourseTest
from
common.test.acceptance.pages.studio.overview
import
CourseOutlinePage
from
common.test.acceptance.pages.studio.utils
import
verify_ordering
...
...
@@ -130,7 +129,7 @@ class ContainerBase(StudioCourseTest):
verify_ordering
(
self
,
container
,
expected_ordering
)
class
StudioLibraryTest
(
WebApp
Test
):
class
StudioLibraryTest
(
Acceptance
Test
):
"""
Base class for all Studio library tests.
"""
...
...
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
View file @
0c5b7ab3
"""
Acceptance tests for Studio related to the acid xblock.
"""
from
bok_choy.web_app_test
import
WebAppTest
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.studio.overview
import
CourseOutlinePage
from
common.test.acceptance.pages.xblock.acid
import
AcidView
from
common.test.acceptance.fixtures.course
import
CourseFixture
,
XBlockFixtureDesc
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
class
XBlockAcidBase
(
WebApp
Test
):
class
XBlockAcidBase
(
Acceptance
Test
):
"""
Base class for tests that verify that XBlock integration is working correctly
"""
...
...
common/test/acceptance/tests/studio/test_studio_course_create.py
View file @
0c5b7ab3
...
...
@@ -2,16 +2,17 @@
Acceptance tests for course creation.
"""
import
uuid
from
bok_choy.web_app_test
import
WebAppTest
from
nose.plugins.attrib
import
attr
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.studio.index
import
DashboardPage
from
common.test.acceptance.pages.studio.overview
import
CourseOutlinePage
@attr
(
shard
=
8
)
class
CreateCourseTest
(
WebApp
Test
):
class
CreateCourseTest
(
Acceptance
Test
):
"""
Test that we can create a new course the studio home page.
"""
...
...
common/test/acceptance/tests/studio/test_studio_general.py
View file @
0c5b7ab3
...
...
@@ -3,8 +3,6 @@ Acceptance tests for Studio.
"""
import
uuid
from
bok_choy.web_app_test
import
WebAppTest
from
base_studio_test
import
StudioCourseTest
from
common.test.acceptance.fixtures.course
import
CourseFixture
,
XBlockFixtureDesc
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
...
...
@@ -21,10 +19,10 @@ from common.test.acceptance.pages.studio.settings_graders import GradingPage
from
common.test.acceptance.pages.studio.signup
import
SignupPage
from
common.test.acceptance.pages.studio.textbook_upload
import
TextbookUploadPage
from
common.test.acceptance.pages.studio.users
import
CourseTeamPage
from
common.test.acceptance.tests.helpers
import
UniqueCourseTest
from
common.test.acceptance.tests.helpers
import
AcceptanceTest
,
UniqueCourseTest
class
LoggedOutTest
(
WebApp
Test
):
class
LoggedOutTest
(
Acceptance
Test
):
"""
Smoke test for pages in Studio that are visible when logged out.
"""
...
...
@@ -42,7 +40,7 @@ class LoggedOutTest(WebAppTest):
page
.
visit
()
class
LoggedInPagesTest
(
WebApp
Test
):
class
LoggedInPagesTest
(
Acceptance
Test
):
"""
Verify the pages in Studio that you can get to when logged in and do not have a course yet.
"""
...
...
common/test/acceptance/tests/studio/test_studio_help.py
View file @
0c5b7ab3
...
...
@@ -3,7 +3,6 @@ Test the Studio help links.
"""
from
flaky
import
flaky
from
bok_choy.web_app_test
import
WebAppTest
from
unittest
import
skip
from
common.test.acceptance.fixtures.course
import
XBlockFixtureDesc
...
...
@@ -29,6 +28,7 @@ from common.test.acceptance.pages.studio.import_export import ExportCoursePage,
from
common.test.acceptance.pages.studio.users
import
CourseTeamPage
from
common.test.acceptance.fixtures.programs
import
ProgramsConfigMixin
from
common.test.acceptance.tests.helpers
import
(
AcceptanceTest
,
assert_nav_help_link
,
assert_side_bar_help_link
)
...
...
@@ -75,7 +75,7 @@ class StudioHelpTest(StudioCourseTest):
)
class
SignInHelpTest
(
WebApp
Test
):
class
SignInHelpTest
(
Acceptance
Test
):
"""
Tests help links on 'Sign In' page
"""
...
...
@@ -107,7 +107,7 @@ class SignInHelpTest(WebAppTest):
)
class
SignUpHelpTest
(
WebApp
Test
):
class
SignUpHelpTest
(
Acceptance
Test
):
"""
Tests help links on 'Sign Up' page.
"""
...
...
@@ -191,7 +191,7 @@ class HomeHelpTest(StudioCourseTest):
)
class
NewCourseHelpTest
(
WebApp
Test
):
class
NewCourseHelpTest
(
Acceptance
Test
):
"""
Test help links while creating a new course.
"""
...
...
@@ -247,7 +247,7 @@ class NewCourseHelpTest(WebAppTest):
)
class
NewLibraryHelpTest
(
WebApp
Test
):
class
NewLibraryHelpTest
(
Acceptance
Test
):
"""
Test help links while creating a new library
"""
...
...
@@ -303,7 +303,7 @@ class NewLibraryHelpTest(WebAppTest):
)
class
LibraryTabHelpTest
(
WebApp
Test
):
class
LibraryTabHelpTest
(
Acceptance
Test
):
"""
Test help links on the library tab present at dashboard.
"""
...
...
@@ -517,7 +517,7 @@ class LibraryExportHelpTest(StudioLibraryTest):
)
class
NewProgramHelpTest
(
ProgramsConfigMixin
,
WebApp
Test
):
class
NewProgramHelpTest
(
ProgramsConfigMixin
,
Acceptance
Test
):
"""
Test help links on a 'New Program' page
"""
...
...
@@ -1251,7 +1251,7 @@ class ToolsExportHelpTest(StudioCourseTest):
)
class
StudioWelcomeHelpTest
(
WebApp
Test
):
class
StudioWelcomeHelpTest
(
Acceptance
Test
):
"""
Tests help link on 'Welcome' page ( User not logged in)
"""
...
...
common/test/acceptance/tests/studio/test_studio_home.py
View file @
0c5b7ab3
"""
Acceptance tests for Home Page (My Courses / My Libraries).
"""
from
bok_choy.web_app_test
import
WebAppTest
from
flaky
import
flaky
from
opaque_keys.edx.locator
import
LibraryLocator
from
uuid
import
uuid4
...
...
@@ -13,13 +12,14 @@ from common.test.acceptance.pages.studio.library import LibraryEditPage
from
common.test.acceptance.pages.studio.index
import
DashboardPage
,
DashboardPageWithPrograms
from
common.test.acceptance.pages.lms.account_settings
import
AccountSettingsPage
from
common.test.acceptance.tests.helpers
import
(
AcceptanceTest
,
select_option_by_text
,
get_selected_option_text
)
from
openedx.core.djangoapps.programs.tests
import
factories
class
CreateLibraryTest
(
WebApp
Test
):
class
CreateLibraryTest
(
Acceptance
Test
):
"""
Test that we can create a new content library on the studio home page.
"""
...
...
@@ -68,7 +68,7 @@ class CreateLibraryTest(WebAppTest):
self
.
assertTrue
(
self
.
dashboard_page
.
has_library
(
name
=
name
,
org
=
org
,
number
=
number
))
class
DashboardProgramsTabTest
(
ProgramsConfigMixin
,
CatalogConfigMixin
,
WebApp
Test
):
class
DashboardProgramsTabTest
(
ProgramsConfigMixin
,
CatalogConfigMixin
,
Acceptance
Test
):
"""
Test the programs tab on the studio home page.
"""
...
...
@@ -160,7 +160,7 @@ class DashboardProgramsTabTest(ProgramsConfigMixin, CatalogConfigMixin, WebAppTe
self
.
assertFalse
(
self
.
dashboard_page
.
is_new_program_button_present
())
class
StudioLanguageTest
(
WebApp
Test
):
class
StudioLanguageTest
(
Acceptance
Test
):
""" Test suite for the Studio Language """
def
setUp
(
self
):
super
(
StudioLanguageTest
,
self
)
.
setUp
()
...
...
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