本文整理汇总了Python中common.test.acceptance.pages.studio.settings_advanced.AdvancedSettingsPage.wait_for_ajax方法的典型用法代码示例。如果您正苦于以下问题:Python AdvancedSettingsPage.wait_for_ajax方法的具体用法?Python AdvancedSettingsPage.wait_for_ajax怎么用?Python AdvancedSettingsPage.wait_for_ajax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.test.acceptance.pages.studio.settings_advanced.AdvancedSettingsPage
的用法示例。
在下文中一共展示了AdvancedSettingsPage.wait_for_ajax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CertificatesTest
# 需要导入模块: from common.test.acceptance.pages.studio.settings_advanced import AdvancedSettingsPage [as 别名]
# 或者: from common.test.acceptance.pages.studio.settings_advanced.AdvancedSettingsPage import wait_for_ajax [as 别名]
#.........这里部分代码省略.........
"""
Scenario: Ensure that creation of a certificate can be canceled correctly.
Given I have a course without certificates
When I click button 'Add your first Certificate'
And I set name of certificate and click the button 'Cancel'
Then I see that there is no certificates in the course
"""
self.certificates_page.visit()
self.certificates_page.click_first_certificate_button()
certificate = self.certificates_page.certificates[0]
certificate.course_title = "Title Override"
certificate.click_cancel_edit_certificate()
self.assertEqual(len(self.certificates_page.certificates), 0)
def test_line_breaks_in_signatory_title(self):
"""
Scenario: Ensure that line breaks are properly reflected in certificate
Given I have a certificate with signatories
When I add signatory title with new line character
Then I see line break in certificate title
"""
self.certificates_page.visit()
certificate = self.create_and_verify_certificate(
"Course Title Override",
0,
[
{
'name': 'Signatory Name',
'title': 'Signatory title with new line character \n',
'organization': 'Signatory Organization',
}
]
)
certificate.wait_for_certificate_delete_button()
# Make sure certificate is created
self.assertEqual(len(self.certificates_page.certificates), 1)
signatory_title = self.certificates_page.get_first_signatory_title()
self.assertNotEqual([], re.findall(r'<br\s*/?>', signatory_title))
def test_course_number_in_certificate_details_view(self):
"""
Scenario: Ensure that Course Number is displayed in certificate details view
Given I have a certificate
When I visit certificate details page on studio
Then I see Course Number next to Course Name
"""
self.certificates_page.visit()
certificate = self.create_and_verify_certificate(
"Course Title Override",
0,
[self.make_signatory_data('first')]
)
certificate.wait_for_certificate_delete_button()
# Make sure certificate is created
self.assertEqual(len(self.certificates_page.certificates), 1)
course_number = self.certificates_page.get_course_number()
self.assertEqual(self.course_info['number'], course_number)
def test_course_number_override_in_certificate_details_view(self):
"""
Scenario: Ensure that Course Number Override is displayed in certificate details view
Given I have a certificate
When I visit certificate details page on studio then course number override should be hidden.
Then I visit the course advance settings page and set the value for course override number.
Then I see Course Number Override next to Course Name in certificate settings page.
"""
self.course_advanced_settings.update(
{'Course Number Display String': 'Course Number Override String'}
)
self.certificates_page.visit()
certificate = self.create_and_verify_certificate(
"Course Title Override",
0,
[self.make_signatory_data('first')]
)
self.assertFalse(self.certificates_page.course_number_override().present)
certificate.wait_for_certificate_delete_button()
# Make sure certificate is created
self.assertEqual(len(self.certificates_page.certificates), 1)
# set up course number override in Advanced Settings Page
self.advanced_settings_page.visit()
self.advanced_settings_page.set_values(self.course_advanced_settings)
self.advanced_settings_page.wait_for_ajax()
self.certificates_page.visit()
course_number_override = self.certificates_page.get_course_number_override()
self.assertEqual(self.course_advanced_settings['Course Number Display String'], course_number_override)
self.assertTrue(self.certificates_page.course_number_override().present)