From 5734e79b5dd33ad26ac7b5222c1350bd5d7b2e3d Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 2 Oct 2019 13:04:34 -0400 Subject: [PATCH] Use absolute paths to upload files in more bokchoy tests --- common/test/acceptance/pages/lms/instructor_dashboard.py | 3 ++- common/test/acceptance/pages/studio/settings.py | 3 ++- common/test/acceptance/pages/studio/settings_certificates.py | 3 ++- .../test/acceptance/tests/discussion/test_cohort_management.py | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/test/acceptance/pages/lms/instructor_dashboard.py b/common/test/acceptance/pages/lms/instructor_dashboard.py index bc3f796f06..aefac0887a 100644 --- a/common/test/acceptance/pages/lms/instructor_dashboard.py +++ b/common/test/acceptance/pages/lms/instructor_dashboard.py @@ -6,6 +6,7 @@ Instructor (2) dashboard page. from __future__ import absolute_import import os +import os.path import six from bok_choy.page_object import PageObject @@ -138,7 +139,7 @@ class InstructorDashboardPage(CoursePage): # Separate the list of folders in the path reaching to the current file, # e.g. '... common/test/acceptance/pages/lms/instructor_dashboard.py' will result in # [..., 'common', 'test', 'acceptance', 'pages', 'lms', 'instructor_dashboard.py'] - folders_list_in_path = __file__.split(os.sep) + folders_list_in_path = os.path.abspath(__file__).split(os.sep) # Get rid of the last 4 elements: 'acceptance', 'pages', 'lms', and 'instructor_dashboard.py' # to point to the 'test' folder, a shared point in the path's tree. diff --git a/common/test/acceptance/pages/studio/settings.py b/common/test/acceptance/pages/studio/settings.py index f94596d97f..b41e7cdafc 100644 --- a/common/test/acceptance/pages/studio/settings.py +++ b/common/test/acceptance/pages/studio/settings.py @@ -5,6 +5,7 @@ Course Schedule and Details Settings page. from __future__ import absolute_import, unicode_literals import os +import os.path import six from bok_choy.javascript import requirejs @@ -314,7 +315,7 @@ class SettingsPage(CoursePage): # Separate the list of folders in the path reaching to the current file, # e.g. '... common/test/acceptance/pages/lms/instructor_dashboard.py' will result in # [..., 'common', 'test', 'acceptance', 'pages', 'lms', 'instructor_dashboard.py'] - folders_list_in_path = __file__.split(os.sep) + folders_list_in_path = os.path.abspath(__file__).split(os.sep) # Get rid of the last 4 elements: 'acceptance', 'pages', 'lms', and 'instructor_dashboard.py' # to point to the 'test' folder, a shared point in the path's tree. diff --git a/common/test/acceptance/pages/studio/settings_certificates.py b/common/test/acceptance/pages/studio/settings_certificates.py index dff1398356..48009a5295 100644 --- a/common/test/acceptance/pages/studio/settings_certificates.py +++ b/common/test/acceptance/pages/studio/settings_certificates.py @@ -11,6 +11,7 @@ The methods in these classes are organized into several conceptual buckets: from __future__ import absolute_import import os +import os.path from bok_choy.promise import EmptyPromise from selenium.webdriver import ActionChains @@ -443,7 +444,7 @@ class SignatorySectionPage(CertificatesPage): """ # Should grab common point between this page module and the data folder. - return os.sep.join(__file__.split(os.sep)[:-4]) + '/data/uploads/' + filename + return os.sep.join(os.path.abspath(__file__).split(os.sep)[:-4]) + '/data/uploads/' + filename def get_selector(self, css=''): """ diff --git a/common/test/acceptance/tests/discussion/test_cohort_management.py b/common/test/acceptance/tests/discussion/test_cohort_management.py index 937e1fa9d4..2a84e90dad 100644 --- a/common/test/acceptance/tests/discussion/test_cohort_management.py +++ b/common/test/acceptance/tests/discussion/test_cohort_management.py @@ -6,6 +6,7 @@ End-to-end tests related to the cohort management on the LMS Instructor Dashboar from __future__ import absolute_import import os +import os.path import uuid from datetime import datetime