本文整理汇总了Python中pastasauce.PastaSauce.update_job方法的典型用法代码示例。如果您正苦于以下问题:Python PastaSauce.update_job方法的具体用法?Python PastaSauce.update_job怎么用?Python PastaSauce.update_job使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pastasauce.PastaSauce
的用法示例。
在下文中一共展示了PastaSauce.update_job方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestGenerateReports
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestGenerateReports(unittest.TestCase):
"""T1.68 - Generate Reports."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.admin = Admin(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.admin.login()
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.admin.driver.session_id),
**self.ps.test_updates
)
try:
self.admin.delete()
except:
pass
# Case C8361 - 001 - Admin | Export research data to OwnCloud Research
@pytest.mark.skipif(str(8361) not in TESTS, reason='Excluded')
def test_admin_export_research_data_to_own_cloud_research_8361(self):
"""Export research data to OwnCloud Research.
Steps:
Open the user menu by clicking on the user's name
Click on the 'Admin' button
Click the 'Research Data' button
Click on the 'Export Data' button
Expected Result:
The page is reloaded and a confirmation message is displayed.
"""
self.ps.test_updates['name'] = 't1.68.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.68', 't1.68.001', '8361']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.admin.open_user_menu()
self.admin.wait.until(
expect.element_to_be_clickable(
(By.LINK_TEXT, 'Admin')
)
).click()
self.admin.page.wait_for_page_load()
self.admin.driver.find_element(
By.XPATH, '//a[contains(text(),"Research Data")]').click()
self.admin.driver.find_element(
By.XPATH, '//input[@value="Export Data"]').click()
self.admin.driver.find_element(
By.XPATH, '//div[contains(@class,"alert-info")]')
self.ps.test_updates['passed'] = True
示例2: TestEpicName
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestEpicName(unittest.TestCase):
"""Product.Epic - Epic Text."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.teacher.delete()
except:
pass
# Case CaseID - Story# - UserType
@pytest.mark.skipif(str(CaseID) not in TESTS, reason='Excluded')
def test_usertype_storytext_CaseID(self):
"""Story Text.
Steps:
Expected Result:
"""
self.ps.test_updates['name'] = 'product.epic.story' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
'product',
'product.epic',
'product.epic.story',
'CaseID'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
示例3: TestGuideMonitorSupportAndTrainUsers
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestGuideMonitorSupportAndTrainUsers(unittest.TestCase):
"""T2.18 - Guide, Monitor, Support, and Train Users."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities["name"] = self.id()
self.teacher = Teacher(use_env_vars=True, pasta_user=self.ps, capabilities=self.desired_capabilities)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(job_id=str(self.teacher.driver.session_id), **self.ps.test_updates)
try:
self.teacher.delete()
except:
pass
# 14752 - 001 - User | In-app Notification of downtime
@pytest.mark.skipif(str(14752) not in TESTS, reason="Excluded")
def test_user_inapp_notification_of_downtime_14752(self):
"""In-app Notification of downtime.
Steps:
Go to Tutor
Log in as admin
Click "Admin" from the user menu
Click "System Setting"
Click "Notifications"
Enter a new notification into the text box
Click "Add"
Log out of admin
Log in as teacher01
Expected Result:
An orange header with the notification pops up when you sign in
"""
self.ps.test_updates["name"] = "t2.18.001" + inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates["tags"] = ["t2", "t2.18", "t2.18.001", "14752"]
self.ps.test_updates["passed"] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates["passed"] = True
# 14751 - 002 - Teacher | Directed to a "No Courses" page when not in any
# courses yet
@pytest.mark.skipif(str(14751) not in TESTS, reason="Excluded")
def test_teacher_directed_to_a_no_courses_page_when_not_in_any_14751(self):
"""Directed to a "No Courses" page when not in any courses yet.
Steps:
Go to tutor-qa.openstax.org
Sign in as demo_teacher; password
Expected Result:
The message "We cannot find an OpenStax course associated with your
account" displays with help links below
"""
self.ps.test_updates["name"] = "t2.18.002" + inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates["tags"] = ["t2", "t2.18", "t2.18.002", "14751"]
self.ps.test_updates["passed"] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates["passed"] = True
# 58279 - 003 - Teacher | View "Getting Started with Tutor" Guide
@pytest.mark.skipif(str(58279) not in TESTS, reason="Excluded")
def test_teacher_view_getting_started_with_tutor_guide_58279(self):
"""View "Getting Started with Tutor" Guide.
Steps:
Click "Tutor Instructors. Get help"
Expected Result:
Tutor Help Center opens in another tab with the Getting Started guide
"""
self.ps.test_updates["name"] = "t2.18.003" + inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates["tags"] = ["t2", "t2.18", "t2.18.003", "58279"]
self.ps.test_updates["passed"] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates["passed"] = True
# 58280 - 004 - Teacher | Access Tutor Help Center after registering for
# a course
@pytest.mark.skipif(str(58280) not in TESTS, reason="Excluded")
def test_teacher_access_tutor_help_center_after_registering_58280(self):
"""Access Tutor Help Center after registering for a course.
Steps:
Go to Tutor
Sign in as teacher01
Click on a Tutor course if the user is in more than one
Click "Get Help" from the user menu in the upper right corner of the
#.........这里部分代码省略.........
示例4: TestAnalyzeCollegeWorkflow
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestAnalyzeCollegeWorkflow(unittest.TestCase):
"""T2.05 - Analyze College Workflow."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.student = Student(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities,
existing_driver=self.teacher.driver
)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.student = None
self.teacher.delete()
except:
pass
# 14645 - 001 - Student | All work is visible for college students
# not just "This Week"
@pytest.mark.skipif(str(14645) not in TESTS, reason='Excluded')
def test_student_all_work_is_visible_for_college_students_14645(self):
"""All work is visible for college students, not just 'This Week'.
Steps:
Log into tutor-qa as student
Click on a college course
Expected Result:
Can view assignments due later than this week
"""
self.ps.test_updates['name'] = 't2.05.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't2',
't2.05',
't2.05.001',
'14645'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.student.login()
self.student.select_course(appearance='physics')
assert('list/' in self.student.current_url()), \
'Not viewing the calendar dashboard'
self.student.sleep(5)
page = self.student.driver.page_source
assert('Coming Up' in page or 'No upcoming events' in page), \
'No Coming Up/No upcoming events text is visible/present'
self.ps.test_updates['passed'] = True
# 14646 - 002 - Teacher | Create a link to the OpenStax Dashboard
@pytest.mark.skipif(str(14646) not in TESTS, reason='Excluded')
def test_teacher_create_a_link_to_the_openstax_dashboard_14646(self):
"""Create a link to the OpenStax Dashboard.
Steps:
Expected Result:
"""
self.ps.test_updates['name'] = 't2.05.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't2',
't2.05',
't2.05.002',
'14646'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# 14647 - 003 - Teacher | Create a link to the OpenStax Dashboard
@pytest.mark.skipif(str(14647) not in TESTS, reason='Excluded')
def test_teacher_create_a_link_to_the_openstax_dashboard_14647(self):
"""Create a link to the OpenStax Dashboard.
Steps:
#.........这里部分代码省略.........
示例5: TestChooseCourse
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestChooseCourse(unittest.TestCase):
"""T1.38 - Choose Course."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.user = None
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.user.driver.session_id),
**self.ps.test_updates
)
try:
self.user.delete()
except:
pass
# Case C8254 - 001 - Student | Select a course
@pytest.mark.skipif(str(8254) not in TESTS, reason='Excluded')
def test_student_select_a_course_8254(self):
"""Select a course.
Steps:
Click on a Tutor course name
Expected Result:
The user selects a course and is presented with the dashboard.
"""
self.ps.test_updates['name'] = 't1.38.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't1',
't1.38',
't1.38.001',
'8254'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.user = Student(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.user.login()
self.user.select_course(appearance='physics')
assert('list' in self.user.current_url()), \
'Not in a course'
self.ps.test_updates['passed'] = True
# Case C8255 - 002 - Student | Bypass the course picker
@pytest.mark.skipif(str(8255) not in TESTS, reason='Excluded')
def test_student_bypass_the_course_picker_8255(self):
"""Bypass the course picker.
Steps:
Go to Tutor
Click on the 'Login' button
Enter the student user account qas_01
Click on the 'Sign in' button
Expected Result:
The user bypasses the course picker and is presented with the
dashboard (because qas_01 is only enrolled in one course)
"""
self.ps.test_updates['name'] = 't1.38.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't1',
't1.38',
't1.38.002',
'8255'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.user = Student(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.user.login(username="qas_01")
assert('list' in self.user.current_url()), \
'Not in a course'
self.ps.test_updates['passed'] = True
# Case C8256 - 003 - Teacher | Select a course
@pytest.mark.skipif(str(8256) not in TESTS, reason='Excluded')
def test_teacher_select_a_course_8256(self):
"""Select a course.
Steps:
Click on a Tutor course name
#.........这里部分代码省略.........
示例6: TestImproveLoginREgistrationEnrollment
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestImproveLoginREgistrationEnrollment(unittest.TestCase):
"""T2.09 - Improve Login, Registration, Enrollment."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.Teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.teacher.delete()
except:
pass
# C14758 - 001 - User | Create an account that maps to the OS Product I use
@pytest.mark.skipif(str(14758) not in TESTS, reason='Excluded')
def test_teacher_view_a_scores_export_for_my_students_work_14758(self):
"""Create an account that maps to the OS Product I use.
Steps:
Expected Result:
"""
self.ps.test_updates['name'] = 't2.09.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't2',
't2.09',
't2.09.001',
'14758'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# C14760 - 002 - User | Create an openstax.org account and get directed to
# Concept Coach or Tutor
@pytest.mark.skipif(str(14760) not in TESTS, reason='Excluded')
def test_user_create_an_openstax_account_and_get_directed_to_14760(self):
"""Create an openstax.org account and get directed to CC or Tutor.
Steps:
Expected Result:
"""
self.ps.test_updates['name'] = 't2.09.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't2',
't2.09',
't2.09.002',
'14760'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# C14761 - 003 - Teacher | Create a custom URL for student registration
@pytest.mark.skipif(str(14761) not in TESTS, reason='Excluded')
def test_teacher_create_a_custom_url_for_student_registration_14761(self):
"""Create a custom URL for student registration.
Steps:
Go to https://tutor-qa.openstax.org/
Click on the 'Login' button
Enter the teacher user account in the username and password text boxes
Click on the 'Sign in' button
If the user has more than one course, click on a Tutor course name
Click "Course Settings and Roster" from the user menu
Expected Result:
The user is presented with a custom URL for student registration
beneath the period tabs
"""
self.ps.test_updates['name'] = 't2.09.003' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't2',
't2.09',
't2.09.003',
#.........这里部分代码省略.........
示例7: TestTeacherViews
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestTeacherViews(unittest.TestCase):
"""CC1.13 - Teacher Views."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.teacher.login()
self.teacher.driver.find_element(
By.XPATH, '//a[contains(@href,"/cc-dashboard")]'
).click()
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.teacher.delete()
except:
pass
# Case C7609 - 001 - Teacher | View the Concept Coach dashboard
@pytest.mark.skipif(str(7609) not in TESTS, reason='Excluded')
def test_teacher_view_the_concept_coach_dashboard_7609(self):
"""View the Concept Coach dashboard.
Steps:
Go to Tutor
Click on the 'Login' button
Enter the teacher user account in the username and password text boxes
Click on the 'Sign in' button
If the user has more than one course, click on a CC course name
Expected Result:
The user is presented with the Concept Coach dashbaord
"""
self.ps.test_updates['name'] = 'cc1.13.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['cc1', 'cc1.13', 'cc1.13.001', '7609']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
assert('cc-dashboard' in self.teacher.current_url()), \
'not at Concept Coach Dashboard'
self.ps.test_updates['passed'] = True
# Case C7610 - 002 - Teacher | Switch between concurrently running courses
@pytest.mark.skipif(str(7610) not in TESTS, reason='Excluded')
def test_teacher_switch_between_concurrently_running_courses_7610(self):
"""Able to switch between concurrently running courses.
Steps:
Click on the OpenStax logo in the left corner of the header
Expected Result:
The user is presented with a list of Concept Coach courses
Is able to switch to another course
"""
self.ps.test_updates['name'] = 'cc1.13.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['cc1', 'cc1.13', 'cc1.13.002', '7610']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
url1 = self.teacher.current_url().split('courses')[1]
self.teacher.driver.find_element(
By.XPATH, '//a//i[@class="ui-brand-logo"]'
).click()
try:
self.teacher.driver.find_element(
By.XPATH,
'//a[contains(@href,"/cc-dashboard") ' +
'and not(contains(@href,"'+str(url1)+'"))]'
).click()
except NoSuchElementException:
print('Only one CC course, cannot go to another')
raise Exception
assert('cc-dashboard' in self.teacher.current_url()), \
'not at Concept Coach Dashboard'
assert(url1 != self.teacher.current_url()), \
'went to same course'
self.ps.test_updates['passed'] = True
# Case C7611 - 003 - Teacher | View links on dashboard to course materials
@pytest.mark.skipif(str(7611) not in TESTS, reason='Excluded')
def test_teacher_view_links_on_dashboard_to_course_materials_7611(self):
"""View links on dashboard to course materials.
Steps:
Go to Tutor
Click on the 'Login' button
#.........这里部分代码省略.........
示例8: TestContractControls
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestContractControls(unittest.TestCase):
"""T1.35 - Contract Controls."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.admin = Admin(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.admin.login()
# make sure there are no new terms to accept
try:
self.admin.driver.find_element(
By.ID, 'i_agree'
).click()
self.admin.driver.find_element(
By.ID, 'agreement_submit'
).click()
except NoSuchElementException:
pass
# go to admin console
self.wait = WebDriverWait(self.admin.driver, 15)
self.admin.open_user_menu()
self.admin.wait.until(
expect.element_to_be_clickable(
(By.LINK_TEXT, 'Admin')
)
).click()
self.admin.page.wait_for_page_load()
self.admin.driver.find_element(
By.XPATH, '//a[contains(text(),"Legal")]').click()
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.admin.driver.session_id),
**self.ps.test_updates
)
try:
self.admin.delete()
except:
pass
# Case C8228 - 001 - Admin | Add a new contract
@pytest.mark.skipif(str(8228) not in TESTS, reason='Excluded')
def test_admin_add_a_new_contract_8228(self):
"""Add a new contract.
Steps:
Click on the 'Terms' option
Click on the "New Contract" Link
Enter information into the Name, Title, and Content text boxes
Click on the 'Create contract' button
Expected Result:
Contract is created as a draft.
User is shown the contract they just made,
and has options on what to do with it next
"""
self.ps.test_updates['name'] = 't1.35.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.35', 't1.35.001', '8228']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.admin.wait.until(
expect.element_to_be_clickable(
(By.XPATH, '//a[contains(text(),"Terms")]')
)
).click()
self.admin.driver.find_element(
By.XPATH,
'//div[contains(@class,"links")]/a[text()="New Contract"]').click()
self.admin.wait.until(
expect.visibility_of_element_located(
(By.XPATH, '//h1[text()="New Contract"]')
)
).click()
self.admin.driver.find_element(
By.ID, 'contract_name').send_keys('test_contract_name_001')
self.admin.driver.find_element(
By.ID, 'contract_title').send_keys('test_contract_title_001')
self.admin.driver.find_element(
By.ID, 'contract_content').send_keys('test_contract_content_001')
self.admin.driver.find_element(
By.XPATH, '//input[@value="Create contract"]').click()
self.admin.driver.find_element(
By.XPATH, '//h1[contains(text(),"Details")]').click()
self.ps.test_updates['passed'] = True
# Case C8229 - 002 - Admin | Cancel adding a new contract
@pytest.mark.skipif(str(8229) not in TESTS, reason='Excluded')
def test_admin_cancel_adding_a_new_contract_8229(self):
"""Cancel adding a new contract.
Steps:
#.........这里部分代码省略.........
示例9: TestCourseMaintenance
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestCourseMaintenance(unittest.TestCase):
"""T1.57 - Course Maintenance."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.admin = Admin(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.admin.login()
self.admin.goto_admin_control()
self.admin.sleep(5)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.admin.driver.session_id),
**self.ps.test_updates
)
try:
self.admin.delete()
except:
pass
# Case C8311 - 001 - Admin | Import courses from Salesforece
@pytest.mark.skipif(str(8311) not in TESTS, reason='Excluded')
def test_admin_import_courses_from_salesforce_8311(self):
"""Import courses from Salesforce.
Steps:
Click on the user menu
Click on the Admin option
Click on Salesforce on the header
Click on the Import Courses button
Expected Result:
"""
self.ps.test_updates['name'] = 't1.57.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.57', 't1.57.001', '8311']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# Case C8312 - 002 - Admin | Update Salesforce Staistics
@pytest.mark.skipif(str(8312) not in TESTS, reason='Excluded')
def test_admin_update_salesforce_statistice_8312(self):
"""Update Salesforce statistics.
Steps:
Click on the user menu
Click on the Admin option
Click on Salesforce on the header
Click on Update Salesforce
Expected Result:
"""
self.ps.test_updates['name'] = 't1.57.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.57', 't1.57.002', '8312']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# Case C8313 - 003 - Admin | Exclude assesments from all courses
@pytest.mark.skipif(str(8313) not in TESTS, reason='Excluded')
def test_admin_exclude_assesments_from_all_courses_8313(self):
"""Exclude assesments from all courses.
Steps:
Expected Result:
"""
self.ps.test_updates['name'] = 't1.57.003' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.57', 't1.57.003', '8313']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# Case C8314 - 004 - Admin | Add a system notification
@pytest.mark.skipif(str(8314) not in TESTS, reason='Excluded')
def test_admin_add_a_system_notification_8314(self):
"""Add a system notification.
Steps:
#.........这里部分代码省略.........
示例10: TestViewClassPerformance
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestViewClassPerformance(unittest.TestCase):
"""T1.22 - View Class Performance."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.teacher.login()
self.teacher.select_course(appearance='biology')
self.teacher.find(By.PARTIAL_LINK_TEXT, 'Performance Forecast').click()
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.teacher.delete()
except:
pass
# Case C8148 - 001 - Teacher | View the period Performance Forecast
@pytest.mark.skipif(str(8148) not in TESTS, reason='Excluded')
def test_teacher_view_the_period_performance_forecast_8148(self):
"""View the period Performance Forecast.
Steps:
On the calendar dashboard, click on the "Performance Forecast" button
on the upper right corner of the calendar OR
click on the user drop down menu then click on the
"Performance Forecast" button
Click on the desired period
Expected Result:
The period Performance Forecast is presented to the user
"""
self.ps.test_updates['name'] = 't1.22.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't1',
't1.22',
't1.22.001',
'8148'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
assert('guide' in self.teacher.current_url()), \
'Not viewing performance forecast'
self.ps.test_updates['passed'] = True
# Case C8149 - 002 - Teacher | Info icon shows an explanation of the data
@pytest.mark.skipif(str(8149) not in TESTS, reason='Excluded')
def test_teacher_info_icon_shows_an_explanation_of_the_data_8149(self):
"""Info icon shows an explanation of the data.
Steps:
On the calendar dashboard, click on the "Performance Forecast" button
on the upper right corner of the calendar
OR
Click on the user drop down menu then click on the
"Performance Forecast" button
Hover the cursor over the info icon that is next to the
"Performance Forecast" header
Expected Result:
Info icon shows an explanation of the data
"""
self.ps.test_updates['name'] = 't1.22.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
't1',
't1.22',
't1.22.002',
'8149'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
assert('guide' in self.teacher.current_url()), \
'Not viewing performance forecast'
self.teacher.wait.until(
expect.visibility_of_element_located(
(By.CLASS_NAME, 'info-link')
)
).click()
self.ps.test_updates['passed'] = True
# Case C8150 - 003 - Teacher | View the performance color key
@pytest.mark.skipif(str(8150) not in TESTS, reason='Excluded')
def test_teacher_view_the_performance_color_key_8150(self):
"""View the performance color key.
#.........这里部分代码省略.........
示例11: TestAdminAndTeacherCourseSetup
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestAdminAndTeacherCourseSetup(unittest.TestCase):
"""CC1.10 - Admin and Teacher Course Setup."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.admin = Admin(
use_env_vars=True,
existing_driver=self.teacher.driver,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.admin.driver = None
self.teacher.delete()
except:
pass
# Case C7715 - 001 - Admin | Send course setup data from Sales Force
@pytest.mark.skipif(str(7715) not in TESTS, reason='Excluded')
def test_admin_send_course_setup_data_from_sales_force_7715(self):
"""Send course setup data from Sales Force.
Steps:
Go to tutor-staging.openstax.org and login as admin
Click on the user menu
Select the Admin option
Click on Salesforce on the header
Expected Result:
"""
self.ps.test_updates['name'] = 'cc1.10.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
'cc1',
'cc1.10',
'cc1.10.001',
'7715'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.admin.login()
self.admin.open_user_menu()
self.teacher.driver.find_element(
By.LINK_TEXT, 'Admin'
).click()
self.admin.wait.until(
expect.visibility_of_element_located(
(By.LINK_TEXT, 'Salesforce')
)
).click()
assert('salesforce' in self.admin.current_url()), 'not at salesforce'
self.ps.test_updates['passed'] = True
# Case C7716 - 002 - System | Course registration codes are emailed to the
# teacher once the course is set up
@pytest.mark.skipif(str(7716) not in TESTS, reason='Excluded')
def test_system_registration_codes_are_emailed_to_teacher_7716(self):
"""Registration codes are emailed to teacher once the course is set up.
Steps:
Expected Result:
"""
self.ps.test_updates['name'] = 'cc1.10.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
'cc1',
'cc1.10',
'cc1.10.002',
'7716'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
raise NotImplementedError(inspect.currentframe().f_code.co_name)
self.ps.test_updates['passed'] = True
# Case C7717 - 003 - Teacher | Use a teacher registration code to access
# their course
@pytest.mark.skipif(str(7717) not in TESTS, reason='Excluded')
def test_teacher_use_teacher_registration_code_to_access_course_7717(self):
"""Use a teacher registration code to access their course.
#.........这里部分代码省略.........
示例12: TestTutorStudent
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestTutorStudent(unittest.TestCase):
''''''
def setUp(self):
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.student = Student(use_env_vars=True)
self.helper = StaxHelper(driver_type='chrome', pasta_user=self.ps,
capabilities=self.desired_capabilities,
initial_user=self.student)
self.driver = self.helper.driver
self.wait = WebDriverWait(self.driver, StaxHelper.DEFAULT_WAIT_TIME)
self.driver.set_window_size(*standard_window)
self.teacher.login()
self.teacher.select_course(title='physics')
self.rword = Assignment.rword
self.screenshot_path = '/tmp/errors/'
def tearDown(self):
# Returns the info of exception being handled
has_errors = self._test_has_failed()
if has_errors:
print(self.driver.current_url, '\n')
date_and_time = datetime.now().strftime('%Y-%m-%d_%H-%M-%S-%f')
filename = 'testerr_%s.png' % date_and_time
self.driver.save_screenshot('%s%s' % (self.screenshot_path,
filename))
self.driver.quit()
self.ps.update_job(self.driver.session_id, passed=has_errors)
def _test_has_failed(self):
# for 3.4. In 3.3, can just use self._outcomeForDoCleanups.success:
for method, error in self._outcome.errors:
if error:
return True
return False
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_views_dashboard(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_views_all_past_work(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_views_reference_book(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_works_a_standard_reading(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_works_an_intro_reading(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_works_a_homework(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_practices_weakest_topics_from_dashboard(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_practices_specific_topic_from_dashboard(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_views_complete_performance_forecast(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_practices_all_topics_from_forecast(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_practices_one_chapter_from_forecast(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_practices_specific_topic_from_forecast(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_works_an_external_assignment(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_reviews_a_finished_reading(self):
''''''
@pytest.mark.skipif(NOT_STARTED, reason='Not started')
def test_student_reviews_a_finished_homework(self):
''''''
示例13: TestAccountMaintenance
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestAccountMaintenance(unittest.TestCase):
"""T1.37 - Account Maintenance."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.admin = Admin(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.admin.login()
self.admin.wait = WebDriverWait(self.admin.driver, 15)
self.admin.open_user_menu()
self.admin.wait.until(
expect.element_to_be_clickable(
(By.LINK_TEXT, 'Admin')
)
).click()
self.admin.page.wait_for_page_load()
self.admin.driver.find_element(
By.XPATH,
'//a[contains(text(),"Users")]'
).click()
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.admin.driver.session_id),
**self.ps.test_updates
)
try:
self.admin.delete()
except:
pass
# Case C8247 - 001 - Admin | Search for a username
@pytest.mark.skipif(str(8247) not in TESTS, reason='Excluded')
def test_admin_search_for_a_username_8247(self):
"""Search for a username.
Steps:
Enter a username into the search here text box
Click on the 'Search' button
Expected Result:
A list of users with the search term in their name,
or username is displayed.
"""
self.ps.test_updates['name'] = 't1.37.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.37', 't1.37.001', '8247']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.admin.driver.find_element(
By.ID, 'query').send_keys('Atticus')
self.admin.driver.find_element(
By.XPATH, '//input[@value="Search"]').click()
self.admin.driver.find_element(
By.XPATH, '//td[contains(text(),"Atticus")]')
self.ps.test_updates['passed'] = True
# Case C8248 - 002 - Admin | Search for a user's name
@pytest.mark.skipif(str(8248) not in TESTS, reason='Excluded')
def test_admin_search_for_a_users_name_8248(self):
"""Search for a user's name.
Steps:
Click on the user's name in the top right corner to open drop down menu
Click on the 'Admin' option of the drop down menu
Click on 'Users' on the bar across the top
Enter a user's name into the search here text box
Click on the 'Search' button
Expected Result:
A list of users with the search term in their name,
or username is displayed.
"""
self.ps.test_updates['name'] = 't1.37.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.37', 't1.37.002', '8248']
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.admin.driver.find_element(
By.ID, 'query').send_keys('student01')
self.admin.driver.find_element(
By.XPATH, '//input[@value="Search"]').click()
self.admin.driver.find_element(
By.XPATH, '//td[text()="student01"]')
self.ps.test_updates['passed'] = True
# Case C8249 - 003 - Admin | Create a new user
@pytest.mark.skipif(str(8249) not in TESTS, reason='Excluded')
def test_admin_create_a_user_8249(self):
"""Create a new user.
#.........这里部分代码省略.........
示例14: TestRecruitingTeachers
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestRecruitingTeachers(unittest.TestCase):
"""CC1.01 - Recruiting Teachers."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.teacher = Teacher(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.CONDENSED_WIDTH = 1105
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.teacher.driver.session_id),
**self.ps.test_updates
)
try:
self.teacher.delete()
except:
pass
# Case C7751 - 001 - Admin | Recruitment and promo website is available
@pytest.mark.skipif(str(7751) not in TESTS, reason='Excluded')
def test_admin_recruitment_and_promo_website_is_available_7751(self):
"""Recruitment and promo website is available.
Steps:
Go to the recruitment website ( http://cc.openstax.org/ )
Expected Result:
Recruitment website loads and renders
"""
self.ps.test_updates['name'] = 'cc1.01.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
'cc1',
'cc1.01',
'cc1.01.001',
'7751'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.teacher.get('http://cc.openstax.org/')
self.teacher.page.wait_for_page_load()
self.ps.test_updates['passed'] = True
# Case C7752 - 002 - Teacher | Information about Concept Coach and the
# pilot are available on the demo site
@pytest.mark.skipif(str(7752) not in TESTS, reason='Excluded')
def test_teacher_information_about_cc_is_available_on_demo_site_7752(self):
"""Information about CC and pilot are available on the demo site.
Steps:
Go to the recruitment website ( http://cc.openstax.org/ )
Expected Result:
Page loads several sections describing Concept Coach
"""
self.ps.test_updates['name'] = 'cc1.01.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
'cc1',
'cc1.01',
'cc1.01.002',
'7752'
]
self.ps.test_updates['passed'] = False
# Test steps and verification assertions
self.teacher.get('http://cc.openstax.org/')
self.teacher.page.wait_for_page_load()
self.teacher.find(By.ID, 'who-we-are')
self.ps.test_updates['passed'] = True
# Case C7753 - 003 - Teacher | Can interact with a Concept Coach wire frame
# for each subject
@pytest.mark.skipif(str(7753) not in TESTS, reason='Excluded')
def test_teacher_can_interact_with_a_cc_wire_frame_for_subjects_7753(self):
"""Can interact with a Concept Coach wire frame for each subject.
Steps:
Go to the recruitment website ( http://cc.openstax.org/)
Hover over "demos" in the header
Click "Interactice Demo"
CLick on a Concept Coach book title
Expected Result:
A new tab or window opens rendering the demo content for the selected
book
"""
self.ps.test_updates['name'] = 'cc1.01.003' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = [
#.........这里部分代码省略.........
示例15: TestUserLogin
# 需要导入模块: from pastasauce import PastaSauce [as 别名]
# 或者: from pastasauce.PastaSauce import update_job [as 别名]
class TestUserLogin(unittest.TestCase):
"""T1.36 - User login."""
def setUp(self):
"""Pretest settings."""
self.ps = PastaSauce()
self.desired_capabilities['name'] = self.id()
self.admin = Admin(
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.content = ContentQA(
existing_driver=self.admin.driver,
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.student = Student(
existing_driver=self.admin.driver,
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
self.teacher = Teacher(
existing_driver=self.admin.driver,
use_env_vars=True,
pasta_user=self.ps,
capabilities=self.desired_capabilities
)
def tearDown(self):
"""Test destructor."""
self.ps.update_job(
job_id=str(self.admin.driver.session_id),
**self.ps.test_updates
)
try:
self.teacher = None
self.student = None
self.content = None
self.admin.delete()
except:
pass
# Case C8238 - 001 - Admin | Log into Tutor
@pytest.mark.skipif(str(8238) not in TESTS, reason='Excluded')
def test_admin_log_into_tutor_8238(self):
"""Log into Tutor.
Steps:
Click on the 'Login' button
Enter the admin account in the username and password text boxes
Click on the 'Sign in' button
Expected Result:
User is logged in
"""
self.ps.test_updates['name'] = 't1.36.001' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.36', 't1.36.001', '8238']
self.ps.test_updates['passed'] = False
self.admin.get(self.admin.url)
self.admin.page.wait_for_page_load()
# check to see if the screen width is normal or condensed
if self.admin.driver.get_window_size()['width'] <= \
self.admin.CONDENSED_WIDTH:
# get small-window menu toggle
is_collapsed = self.admin.find(
By.XPATH,
'//button[contains(@class,"navbar-toggle")]'
)
# check if the menu is collapsed and, if yes, open it
if('collapsed' in is_collapsed.get_attribute('class')):
is_collapsed.click()
self.admin.wait.until(
expect.visibility_of_element_located(
(By.LINK_TEXT, 'Login')
)
).click()
self.admin.page.wait_for_page_load()
self.admin.find(
By.ID, 'auth_key'
).send_keys(self.admin.username)
self.admin.find(
By.ID, 'password'
).send_keys(self.admin.password)
# click on the sign in button
self.admin.find(
By.XPATH,
'//button[text()="Sign in"]'
).click()
self.admin.page.wait_for_page_load()
assert('dashboard' in self.admin.current_url()), \
'Not taken to dashboard: %s' % self.admin.current_url()
self.ps.test_updates['passed'] = True
# Case C8239 - 002 - Admin | Access the Admin Console
#.........这里部分代码省略.........