Feanil/delete flaky bokchoy tests (#23287)

* Delete flaky test.

* Remove flaky instructor dashboard help test.

* Remove flaky problem type tests.

* Remove flaky studio container tests.

* Remove flaky studio container tests.

* Remove flaky studio problem editor tests.

* Remove flaky enrollment track mode tests.

* Delete flaky video transcript tests.

* Fix pep8 issue.
This commit is contained in:
Feanil Patel
2020-03-03 16:09:49 -05:00
committed by GitHub
parent bf14bc97d2
commit 440ef56f10
8 changed files with 0 additions and 797 deletions

View File

@@ -63,74 +63,6 @@ class CourseHomeBaseTest(UniqueCourseTest):
auto_auth(self.browser, self.USERNAME, self.EMAIL, False, self.course_id)
class CourseHomeTest(CourseHomeBaseTest):
"""
Tests the course home page with course outline.
"""
shard = 20
def test_course_home(self):
"""
Smoke test of course goals, course outline, breadcrumbs to and from course outline, and bookmarks.
"""
ModeCreationPage(
self.browser, self.course_id, mode_slug=u'verified',
mode_display_name='verified', min_price=10
).visit()
self.course_home_page.visit()
# TODO: TNL-6546: Remove course_outline_page.
self.course_home_page.course_outline_page = True
self.courseware_page.nav.course_outline_page = True
# Check that the tab lands on the course home page.
self.assertTrue(self.course_home_page.is_browser_on_page())
# Check that a success message and update course field are shown when selecting a course goal
# TODO: LEARNER-2522: Ensure the correct message shows up for a particular goal choice
self.assertFalse(self.course_home_page.is_course_goal_success_message_shown())
self.assertFalse(self.course_home_page.is_course_goal_update_field_shown())
self.course_home_page.select_course_goal()
self.course_home_page.wait_for_ajax()
self.assertTrue(self.course_home_page.is_course_goal_success_message_shown())
self.assertTrue(self.course_home_page.is_course_goal_update_field_shown())
# Check that the course navigation appears correctly
EXPECTED_SECTIONS = {
u'Test Section': [u'Test Subsection'],
u'Test Section 2': [u'Test Subsection 2', u'Test Subsection 3']
}
actual_sections = self.course_home_page.outline.sections
for section, _ in six.iteritems(EXPECTED_SECTIONS):
self.assertIn(section, actual_sections)
self.assertEqual(actual_sections[section], EXPECTED_SECTIONS[section])
# Navigate to a particular section
self.course_home_page.outline.go_to_section(u'Test Section', u'Test Subsection')
# Check the sequence items on the courseware page
EXPECTED_ITEMS = ['Test Problem 1', 'Test Problem 2', 'Test HTML']
actual_items = self.courseware_page.nav.sequence_items
self.assertEqual(len(actual_items), len(EXPECTED_ITEMS))
for expected in EXPECTED_ITEMS:
self.assertIn(expected, actual_items)
# Use outline breadcrumb to get back to course home page.
self.courseware_page.nav.go_to_outline()
# Navigate to a particular section other than the default landing section.
self.course_home_page.outline.go_to_section('Test Section 2', 'Test Subsection 3')
self.assertTrue(self.courseware_page.nav.is_on_section('Test Section 2', 'Test Subsection 3'))
# Verify that we can navigate to the bookmarks page
self.course_home_page.visit()
self.course_home_page.click_bookmarks_button()
bookmarks_page = BookmarksPage(self.browser, self.course_id)
self.assertTrue(bookmarks_page.is_browser_on_page())
@attr('a11y')
class CourseHomeA11yTest(CourseHomeBaseTest):
"""

View File

@@ -88,29 +88,3 @@ class TestCohortHelp(ContainerBase, CohortTestMixin):
'/course_features/cohorts/cohorts_overview.html#all-automated-assignment',
)
self.verify_help_link(href)
@skip_unless_master # See note at the top of the file.
class InstructorDashboardHelp(BaseInstructorDashboardTest):
"""
Tests opening help from the general Help button in the instructor dashboard.
"""
shard = 2
def setUp(self):
super(InstructorDashboardHelp, self).setUp()
self.course_fixture = CourseFixture(**self.course_info).install()
self.log_in_as_instructor()
self.instructor_dashboard_page = self.visit_instructor_dashboard()
def test_instructor_dashboard_help(self):
"""
Scenario: Help button opens staff help
Given that I am viewing the Instructor Dashboard
When I click "Help"
Then I see help about the instructor dashboard in a new tab
"""
href = url_for_help('course_author', '/CA_instructor_dash_help.html')
help_element = self.instructor_dashboard_page.get_help_element()
click_and_wait_for_window(self, help_element)
assert_opened_help_link_is_correct(self, href)

View File

@@ -1450,34 +1450,6 @@ class FormulaProblemTypeBase(ProblemTypeTestBase):
self.problem_page.fill_answer(textvalue)
@ddt.ddt
class FormulaProblemTypeTest(FormulaProblemTypeBase, ProblemTypeTestMixin, ChangingAnswerOfProblemTestMixin):
"""
Standard tests for the Formula Problem Type
"""
shard = 24
pass
class FormulaProblemTypeTestNonRandomized(FormulaProblemTypeBase, NonRandomizedProblemTypeTestMixin):
"""
Tests for non-randomized Formula problem
"""
shard = 24
def get_problem(self):
"""
Creates a {problem_type} problem
"""
# Generate the problem XML using capa.tests.response_xml_factory
return XBlockFixtureDesc(
'problem',
self.problem_name,
data=self.factory.build_xml(**self.factory_kwargs),
metadata={'rerandomize': 'never', 'show_reset_button': True}
)
class FormulaProblemTypeNeverShowCorrectnessTest(FormulaProblemTypeBase, ProblemNeverShowCorrectnessMixin):
"""
Ensure that correctness can be withheld for Formula Problem Type problems.
@@ -1591,24 +1563,6 @@ class ScriptProblemResetAfterAnswerTest(ScriptProblemTypeBase):
self.answer_problem(other_correctness)
self.assertTrue(self.problem_status('unanswered'))
@ddt.data(['correct', '2/2 points (ungraded)'], ['incorrect', '0/2 points (ungraded)'])
@ddt.unpack
def test_script_score_after_answer_and_reset(self, correctness, score):
"""
Scenario: I can see my score on a script problem when I answer it and after I reset it
Given I am viewing a script problem
When I answer a script problem correct/incorrect
Then I should see a score
When I reset the problem
Then I should see a score of points possible: 0/2 points (ungraded)
"""
self.answer_problem(correctness)
self.problem_page.click_submit()
self.assertEqual(self.problem_page.problem_progress_graded_value, score)
self.problem_page.click_reset()
self.assertEqual(self.problem_page.problem_progress_graded_value, '0/2 points (ungraded)')
class ScriptProblemTypeTestNonRandomized(ScriptProblemTypeBase, NonRandomizedProblemTypeTestMixin):
"""

View File

@@ -537,23 +537,6 @@ class ContentGroupVisibilityModalTest(BaseGroupConfigurationsTest):
"""
self.select_and_verify_saved(self.html_component, self.CONTENT_GROUP_PARTITION, ['Dogs', 'Cats'])
def test_select_zero_content_groups(self):
"""
Scenario: The component visibility modal can not be set to be visible to 'Specific Content Groups' without
selecting those specific groups.
Given I have a unit with one component
When I go to the container page for that unit
And I open the visibility editor modal for that unit's component
And I select 'Specific Content Groups'
And I save the modal
Then the visibility selection should be 'All Students and Staff'
And the container page should not display the content visibility warning
"""
self.select_and_verify_saved(
self.html_component, self.CONTENT_GROUP_PARTITION
)
self.verify_visibility_set(self.html_component, False)
def test_missing_groups(self):
"""
Scenario: The component visibility modal shows a validation error when visibility is set to multiple unknown
@@ -1356,29 +1339,6 @@ class MoveComponentTest(ContainerBase):
component_display_names_after_operation=['HTML 21', 'HTML 22', 'HTML 11']
)
def test_undo_move_component_successfully(self):
"""
Test if we can undo move a component successfully.
Given I am a staff user
And I go to unit page in first section
And I open the move modal
When I click on the move button
Then I see move operation successful message
And When I clicked on undo move link
Then I see that undo move operation is successful
"""
unit_page = self.go_to_unit_page(unit_name='Test Unit 1')
components = unit_page.displayed_children
self.assertEqual(len(components), 2)
self.verify_move_opertions(
unit_page=unit_page,
source_component=components[0],
operation='undo_move',
component_display_names_after_operation=['HTML 11', 'HTML 12']
)
@ddt.data('publish', 'discard')
def test_publish_discard_changes_afer_move(self, operation):
"""

View File

@@ -109,63 +109,6 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest, TestWithSe
self.assertEqual(edit_modal.library_name, library_name)
self.assertEqual(edit_modal.count, max_count)
def test_no_library_shows_library_not_configured(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course
When I go to studio unit page for library content block
And I edit to select "No Library"
Then I can see that library content block is misconfigured
"""
expected_text = 'A library has not yet been selected.'
expected_action = 'Select a Library'
library_container = self._get_library_xblock_wrapper(self.unit_page.xblocks[1])
# precondition check - the library block should be configured before we remove the library setting
self.assertFalse(library_container.has_validation_not_configured_warning)
library_container.edit()
edit_modal = StudioLibraryContentEditor(self.browser, library_container.locator)
edit_modal.library_name = "No Library Selected"
library_container.save_settings()
self.assertTrue(library_container.has_validation_not_configured_warning)
self.assertIn(expected_text, library_container.validation_not_configured_warning_text)
self.assertIn(expected_action, library_container.validation_not_configured_warning_text)
def test_out_of_date_message(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course
When I go to studio unit page for library content block
Then I update the library being used
Then I refresh the page
Then I can see that library content block needs to be updated
When I click on the update link
Then I can see that the content no longer needs to be updated
"""
# Formerly flaky: see TE-745
expected_text = "This component is out of date. The library has new content."
library_block = self._get_library_xblock_wrapper(self.unit_page.xblocks[1])
self.assertFalse(library_block.has_validation_warning)
# Removed this assert until a summary message is added back to the author view (SOL-192)
#self.assertIn("3 matching components", library_block.author_content)
self.library_fixture.create_xblock(self.library_fixture.library_location, XBlockFixtureDesc("html", "Html4"))
self.unit_page.visit() # Reload the page
self.assertTrue(library_block.has_validation_warning)
self.assertIn(expected_text, library_block.validation_warning_text)
library_block.refresh_children()
self.unit_page.wait_for_page() # Wait for the page to reload
library_block = self._get_library_xblock_wrapper(self.unit_page.xblocks[1])
self.assertFalse(library_block.has_validation_message)
# Removed this assert until a summary message is added back to the author view (SOL-192)
#self.assertIn("4 matching components", library_block.author_content)
def test_no_content_message(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course
@@ -214,85 +157,6 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest, TestWithSe
self.assertFalse(library_container.has_validation_error)
self.assertFalse(library_container.has_validation_warning)
def test_not_enough_children_blocks(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course
When I go to studio unit page for library content block
And I set Problem Type selector so "Any"
Then I can see that "No matching content" warning is shown
"""
expected_tpl = u"The specified library is configured to fetch {count} problems, " \
u"but there are only {actual} matching problems."
library_container = self._get_library_xblock_wrapper(self.unit_page.xblocks[1])
# precondition check - assert block is configured fine
self.assertFalse(library_container.has_validation_error)
self.assertFalse(library_container.has_validation_warning)
library_container.edit()
edit_modal = StudioLibraryContentEditor(self.browser, library_container.locator)
edit_modal.count = 50
library_container.save_settings()
self.assertTrue(library_container.has_validation_warning)
self.assertIn(
expected_tpl.format(count=50, actual=len(self.library_fixture.children)),
library_container.validation_warning_text
)
def test_settings_overrides(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course
When I go to studio unit page for library content block
And when I click the "View" link
Then I can see a preview of the blocks drawn from the library.
When I edit one of the blocks to change a setting such as "display_name",
Then I can see the new setting is overriding the library version.
When I subsequently click to refresh the content with the latest from the library,
Then I can see that the overrided version of the setting is preserved.
When I click to edit the block and reset the setting,
then I can see that the setting's field defaults back to the library version.
"""
block_wrapper_unit_page = self._get_library_xblock_wrapper(self.unit_page.xblocks[0].children[0])
container_page = block_wrapper_unit_page.go_to_container()
library_block = self._get_library_xblock_wrapper(container_page.xblocks[0])
self.assertFalse(library_block.has_validation_message)
self.assertEqual(len(library_block.children), 3)
block = library_block.children[0]
self.assertIn(block.name, ("Html1", "Html2", "Html3"))
name_default = block.name
block.edit()
new_display_name = "A new name for this HTML block"
block.set_field_val("Display Name", new_display_name)
block.save_settings()
self.assertEqual(block.name, new_display_name)
# Create a new block, causing a new library version:
self.library_fixture.create_xblock(self.library_fixture.library_location, XBlockFixtureDesc("html", "Html4"))
container_page.visit() # Reload
self.assertTrue(library_block.has_validation_warning)
library_block.refresh_children()
container_page.wait_for_page() # Wait for the page to reload
self.assertEqual(len(library_block.children), 4)
self.assertEqual(block.name, new_display_name)
# Reset:
block.edit()
block.reset_field_val("Display Name")
block.save_settings()
self.assertEqual(block.name, name_default)
def test_cannot_manage(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course

View File

@@ -43,96 +43,6 @@ class ProblemComponentEditor(ContainerBase):
)
)
def test_user_can_view_metadata(self):
"""
Scenario: User can view metadata
Given I have created a Blank Common Problem
When I edit and select Settings
Then I see the advanced settings and their expected values
And Edit High Level Source is not visible
"""
expected_default_settings = {
'Display Name': u'Blank Common Problem',
'Matlab API key': u'',
'Maximum Attempts': u'',
'Problem Weight': u'',
'Randomization': u'Never',
'Show Answer': u'Finished',
'Show Answer: Number of Attempts': u'0',
'Show Reset Button': u'False',
'Timer Between Attempts': u'0'
}
self.problem_editor.open_settings()
settings = self.problem_editor.get_settings()
self.assertEqual(expected_default_settings, settings)
self.assertFalse(self.problem_editor.is_latex_compiler_present())
def test_user_can_modify_string_values(self):
"""
Given I have created a Blank Common Problem
When I edit and select Settings
Then I can modify the display name
And my display name change is persisted on save
"""
self.problem_editor.open_settings()
self.problem_editor.set_field_val('Display Name', 'New Name')
self.problem_editor.save()
component_name = self.unit.xblock_titles[0]
self.assertEqual(component_name, 'New Name', 'Component Name is not same as the new name')
def test_user_can_specify_special_characters(self):
"""
Scenario: User can specify special characters in String values
Given I have created a Blank Common Problem
When I edit and select Settings
Then I can specify special characters in the display name
And my special characters are persisted on save
"""
self.problem_editor.open_settings()
self.problem_editor.set_field_val('Display Name', '&&&')
self.problem_editor.save()
component_name = self.unit.xblock_titles[0]
self.assertEqual(component_name, '&&&', 'Component Name is not same as the new name')
def test_user_can_revert_display_name_to_unset(self):
"""
Scenario: User can revert display name to unset
Given I have created a Blank Common Problem
When I edit and select Settings
Then I can revert the display name to unset
And my display name is unset on save
"""
self.problem_editor.open_settings()
self.problem_editor.set_field_val('Display Name', 'New Name')
self.problem_editor.save()
# reopen settings
self.container_page.edit()
self.problem_editor.open_settings()
self.problem_editor.revert_setting(display_name=True)
self.problem_editor.save()
component_name = self.unit.xblock_titles[0]
self.assertEqual(component_name, 'Blank Advanced Problem', 'Component Name is not reverted to default name')
def test_user_can_set_html_in_display_name(self):
"""
Scenario: User can specify html in display name and it will be escaped
Given I have created a Blank Common Problem
When I edit and select Settings
Then I can specify html in the display name and save
And the problem display name is "<script>alert('test')</script>"
"""
self.problem_editor.open_settings()
self.problem_editor.set_field_val('Display Name', '<script>alert("test")</script>')
self.problem_editor.save()
component_name = self.unit.xblock_titles[0]
self.assertEqual(
component_name,
'<script>alert("test")</script>',
'Component Name is not same as the new name'
)
def test_user_can_modify_float_input(self):
"""
Scenario: User can modify float input values
@@ -156,18 +66,6 @@ class ProblemComponentEditor(ContainerBase):
field_value = self.problem_editor.get_field_val('Problem Weight')
self.assertEqual(field_value, '', 'Component settings is not reverted to default')
def test_user_cannot_type_letters(self):
"""
Scenario: User cannot type letters in float number field
Given I have created a Blank Common Problem
When I edit and select Settings
Then if I set the weight to "abc", it remains unset
"""
self.problem_editor.open_settings()
self.problem_editor.set_field_val('Problem Weight', 'abc')
field_value = self.problem_editor.get_field_val('Problem Weight')
self.assertEqual(field_value, '', "Only the Numerical input is allowed in this field")
@skip_if_browser('firefox')
# Lettuce tests run on chrome and chrome does not allow to enter
# periods/dots in this field and consequently we have to save the
@@ -194,24 +92,6 @@ class ProblemComponentEditor(ContainerBase):
field_value = self.problem_editor.get_field_val('Maximum Attempts')
self.assertEqual(field_value, '234', "Decimal values are not allowed in this field")
def test_user_cannot_type_out_of_range_values(self):
"""
Scenario: User cannot type out of range values in an integer number field
Given I have created a Blank Common Problem
When I edit and select Settings
Then if I set the max attempts to "-3", it will persist as a valid integer
"""
self.problem_editor.open_settings()
self.problem_editor.set_field_val('Maximum Attempts', '-3')
self.problem_editor.save()
# reopen settings
self.container_page.edit()
self.problem_editor.open_settings()
field_value = self.problem_editor.get_field_val('Maximum Attempts')
self.assertGreaterEqual(field_value, '0', "Negative values are not allowed in this field")
def test_settings_are_not_saved_on_cancel(self):
"""
Scenario: Settings changes are not saved on Cancel
@@ -241,29 +121,3 @@ class ProblemComponentEditor(ContainerBase):
"""
self.problem_editor.toggle_cheatsheet()
self.assertTrue(self.problem_editor.is_cheatsheet_present(), "Cheatsheet not present")
def test_user_can_select_values(self):
"""
Scenario: User can select values in a Select
Given I have created a Blank Common Problem
When I edit and select Settings
Then I can select 'Per Student' for Randomization
And my change to randomization is persisted
And I can revert to the default value for randomization
"""
dropdown_name = 'Randomization'
self.problem_editor.open_settings()
self.problem_editor.select_from_dropdown(dropdown_name, 'Per Student')
self.problem_editor.save()
# reopen the settings
self.container_page.edit()
self.problem_editor.open_settings()
dropdown_value = self.problem_editor.get_value_from_the_dropdown(dropdown_name)
self.assertEqual(dropdown_value, 'Per Student', "Component setting is not changed")
# revert settings
self.problem_editor.revert_setting()
dropdown_value = self.problem_editor.get_value_from_the_dropdown(dropdown_name)
self.assertEqual(dropdown_value, 'Never', 'Component setting is not reverted to default')

View File

@@ -231,59 +231,6 @@ class ContentGroupConfigurationTest(StudioCourseTest):
self.outline_page.wait_for_page()
@attr(shard=17)
class EnrollmentTrackModeTest(StudioCourseTest):
"""
Tests for the enrollment tracks section
"""
def setUp(self, is_staff=True, test_xss=True):
super(EnrollmentTrackModeTest, self).setUp(is_staff=is_staff)
self.audit_track = "Audit"
self.verified_track = "Verified"
self.staff_user = self.user
def test_all_course_modes_present(self):
"""
This test is meant to ensure that all the course modes show up as groups
on the Group configuration page within the Enrollment Tracks section.
It also checks to make sure that the edit buttons are not available.
"""
add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified'])
group_configurations_page = GroupConfigurationsPage(
self.browser,
self.course_info['org'],
self.course_info['number'],
self.course_info['run']
)
group_configurations_page.visit()
self.assertTrue(group_configurations_page.enrollment_track_section_present)
# Make sure the edit buttons are not available.
self.assertFalse(group_configurations_page.enrollment_track_edit_present)
groups = group_configurations_page.get_enrollment_groups()
for g in [self.audit_track, self.verified_track]:
assert g in groups
def test_one_course_mode(self):
"""
The purpose of this test is to ensure that when there is 1 or fewer course modes
the enrollment track section is not shown.
"""
add_enrollment_course_modes(self.browser, self.course_id, ['audit'])
group_configurations_page = GroupConfigurationsPage(
self.browser,
self.course_info['org'],
self.course_info['number'],
self.course_info['run']
)
group_configurations_page.visit()
self.assertFalse(group_configurations_page.enrollment_track_section_present)
groups = group_configurations_page.get_enrollment_groups()
self.assertEqual(len(groups), 0)
@attr('a11y')
class StudioSettingsA11yTest(StudioCourseTest):

View File

@@ -43,86 +43,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.navigate_to_course_unit()
def test_input_validation(self):
"""
Scenario: Check input error messages
Given I have created a Video component
Entering "123.webm" and "456.webm" source to field number 1 and 2 respectively should disable field 1 and 3
Then I see error message "Link types should be unique."
When I clear fields, input fields should be enabled
And I enter a "http://link.c" source to field number 1 should disable fields 2 and 3
Then I see error message "Incorrect url format."
Entering "http://goo.gl/pxxZrg" source to both field number 1 and 2 should disable fields 1 and 3
Then I see error message "Links should be unique."
When I clear fields, input fields should be enabled
And I enter a "http://youtu.be/t_not_exist" source to field number 1
Then I do not see error message
And I expect inputs are enabled
"""
self._create_video_component()
self.edit_component()
#User inputs html5 links with equal extension
self.video.set_url_field('123.webm', 1)
self.video.set_url_field('456.webm', 2)
self.assertEqual(self.video.message('error'), 'Link types should be unique.')
# Currently we are working with 2nd field. It means, that if 2nd field
# contain incorrect value, 1st and 3rd fields should be disabled until
# 2nd field will be filled by correct correct value
self.assertEqual(list(self.video.url_field_status(1, 3).values()), [False, False])
self.video.clear_fields()
self.assertEqual(list(self.video.url_field_status().values()), [True, True, True])
#User input URL with incorrect format
self.video.set_url_field('http://link.c', 1)
self.assertEqual(self.video.message('error'), 'Incorrect url format.')
self.assertEqual(list(self.video.url_field_status(2, 3).values()), [False, False])
#User input URL with incorrect format
self.video.set_url_field('http://goo.gl/pxxZrg', 1)
self.video.set_url_field('http://goo.gl/pxxZrg', 2)
self.assertEqual(self.video.message('error'), 'Links should be unique.')
self.assertEqual(list(self.video.url_field_status(1, 3).values()), [False, False])
self.video.clear_fields()
self.assertEqual(list(self.video.url_field_status().values()), [True, True, True])
self.video.set_url_field('http://youtu.be/t_not_exist', 1)
self.assertEqual(self.video.message('error'), '')
self.assertEqual(list(self.video.url_field_status().values()), [True, True, True])
def test_youtube_server_interaction(self):
"""
Scenario: Testing interaction with test youtube server
Given I have created a Video component with subtitles
And I enter a "http://youtu.be/t__eq_exist" source to field number 1
Then I see status message "No EdX Timed Transcript"
And I see button "import"
And I enter a "http://youtu.be/t_not_exist" source to field number 1
Then I see status message "No Timed Transcript"
And I do not see button "import"
And I see button "disabled_download_to_edit"
"""
self._create_video_component(subtitles=True)
self.edit_component()
# first part of url will be substituted by mock_youtube_server address
# for t__eq_exist id server will respond with transcripts
self.video.set_url_field('http://youtu.be/t__eq_exist', 1)
self.assertEqual(self.video.message('status'), 'No EdX Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('import'))
self.video.set_url_field('http://youtu.be/t_not_exist', 1)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.assertFalse(self.video.is_transcript_button_visible('import'))
self.assertTrue(self.video.is_transcript_button_visible('disabled_download_to_edit'))
def test_youtube_id_w_different_local_server_sub(self):
"""
Scenario: Youtube id only: check "Found" state when user sets youtube_id with different local and server subs
@@ -182,27 +102,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.assertTrue(self.video.is_transcript_button_visible('import'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
def test_youtube_no_import(self):
"""
Scenario: Entering youtube (no importing), and 2 html5 sources without transcripts - "Not Found"
Given I have created a Video component
urls = ['http://youtu.be/t_not_exist', 't_not_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
Status message `No Timed Transcript` is shown
`disabled_download_to_edit` and `upload_new_timed_transcripts` buttons are shown
"""
self._create_video_component()
self.edit_component()
urls = ['http://youtu.be/t_not_exist', 't_not_exist.mp4', 't_not_exist.webm']
for index, url in enumerate(urls, 1):
self.video.set_url_field(url, index)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('disabled_download_to_edit'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
def test_youtube_with_import(self):
"""
Scenario: Entering youtube with imported transcripts, and 2 html5 sources without transcripts - "Found"
@@ -238,36 +137,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.assertTrue(self.video.is_transcript_button_visible('download_to_edit'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
def test_youtube_wo_transcripts(self):
"""
Scenario: Entering youtube w/o transcripts - html5 w/o transcripts - html5 with transcripts
Given I have created a Video component with subtitles "t_neq_exist"
urls = ['http://youtu.be/t_not_exist', 't_not_exist.mp4']
for each url in urls do the following
Enter `url` to field number `n`
Status message `No Timed Transcript` is shown
`disabled_download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I enter a "t_neq_exist.webm" source to field number 3
Then I see status message "Timed Transcript Found"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
"""
self._create_video_component(subtitles=True, subtitle_id='t_neq_exist')
self.edit_component()
urls = ['http://youtu.be/t_not_exist', 't_not_exist.mp4']
for index, url in enumerate(urls, 1):
self.video.set_url_field(url, index)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('disabled_download_to_edit'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
self.video.set_url_field('t_neq_exist.webm', 3)
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
self.assertTrue(self.video.is_transcript_button_visible('download_to_edit'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
def test_youtube_wo_imported_transcripts(self):
"""
Scenario: Entering youtube w/o imported transcripts - html5 w/o transcripts w/o import - html5 with transcripts
@@ -289,27 +158,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.assertTrue(self.video.is_transcript_button_visible('import'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
def test_youtube_wo_imported_transcripts2(self):
"""
Scenario: Entering youtube w/o imported transcripts - html5 with transcripts - html5 w/o transcripts w/o import
Given I have created a Video component with subtitles "t_neq_exist"
urls = ['http://youtu.be/t__eq_exist', 't_neq_exist.mp4', 't_not_exist.webm']
for each url in urls do the following
Enter `url` to field number `n`
Status message `No EdX Timed Transcript` is shown
`import` and `upload_new_timed_transcripts` buttons are shown
"""
self._create_video_component(subtitles=True, subtitle_id='t_neq_exist')
self.edit_component()
urls = ['http://youtu.be/t__eq_exist', 't_neq_exist.mp4', 't_not_exist.webm']
for index, url in enumerate(urls, 1):
self.video.set_url_field(url, index)
self.assertEqual(self.video.message('status'), 'No EdX Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('import'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
def test_youtube_w_imported_transcripts(self):
"""
Scenario: Entering youtube with imported transcripts - html5 with transcripts - html5 w/o transcripts
@@ -419,61 +267,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.video.set_url_field('uk_transcripts.webm', 3)
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
def test_one_field_only(self):
"""
Scenario: Work with 1 field only: Enter HTML5 source with transcripts - save -> change it to another one
HTML5 source w/o transcripts - click on use existing -> change it to another one HTML5 source
w/o transcripts - do not click on use existing -> change it to another one HTML5 source w/o
transcripts - click on use existing
Given I have created a Video component with subtitles "t_not_exist"
If i enter "t_not_exist.mp4" source to field number 1 Then I see status message "Timed Transcript Found"
`download_to_edit` and `upload_new_timed_transcripts` buttons are shown
And I save changes And then edit the component
If i enter "video_name_2.mp4" source to field number 1 Then I see status message "Confirm Timed Transcript"
I see button "use_existing"
If i enter "video_name_3.mp4" source to field number 1 Then I see status message "Confirm Timed Transcript"
And I see button "use_existing"
If i enter a "video_name_4.mp4" source to field number 1 Then I see status message "Confirm Timed Transcript"
I see button "use_existing" And I click on it And I see status message "Timed Transcript Found"
I save video component And see that the captions are visible
Then I edit video component And I see status message "Timed Transcript Found"
"""
self.metadata = {'sub': 't_not_exist'}
self._create_video_component(subtitles=True, subtitle_id='t_not_exist')
self.edit_component()
self.video.set_url_field('t_not_exist.mp4', 1)
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
self.assertTrue(self.video.is_transcript_button_visible('download_to_edit'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
self.save_unit_settings()
self.edit_component()
self.video.set_url_field('video_name_2.mp4', 1)
self.assertEqual(self.video.message('status'), 'Confirm Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('use_existing'))
self.assertTrue(self.video.is_transcript_button_visible('upload_new_timed_transcripts'))
self.video.set_url_field('video_name_3.mp4', 1)
self.assertEqual(self.video.message('status'), 'Confirm Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('use_existing'))
self.video.set_url_field('video_name_4.mp4', 1)
self.assertEqual(self.video.message('status'), 'Confirm Timed Transcript')
self.assertTrue(self.video.is_transcript_button_visible('use_existing'))
self.video.click_button('use_existing')
self.save_unit_settings()
self.assertTrue(self.video.is_captions_visible())
self.edit_component()
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
def test_two_fields_only(self):
"""
Scenario: Work with 2 fields: Enter HTML5 source with transcripts - save -> change it to another one HTML5
@@ -527,39 +320,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.edit_component()
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
def test_upload_subtitles(self):
"""
Scenario: Transcript upload for a video who has Video ID set on it.
Given I have created a Video component
I enter a "video_name_1.mp4" source to field number 1
And set "Video ID" to "video_001"
And I see status message "No Timed Transcript"
And I upload the transcripts file "uk_transcripts.srt"
Then I see status message "Timed Transcript Uploaded Successfully"
And I save changes
Then when I view the video it does show the captions
And I edit the component
Then I see status message "Timed Transcript Found"
"""
self._create_video_component()
self.edit_component()
self.video.set_field_value('Video ID', 'video_001')
self.save_unit_settings()
self.edit_component()
self.video.set_url_field('video_name_1.mp4', 1)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.video.upload_transcript('uk_transcripts.srt')
self.assertEqual(self.video.message('status'), 'Timed Transcript Uploaded Successfully')
self.save_unit_settings()
self.video.is_captions_visible()
self.edit_component()
self.video.verify_field_value('Video ID', 'video_001')
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
def test_video_wo_subtitles(self):
"""
Scenario: Video w/o subs - another video w/o subs - Not found message
@@ -638,48 +398,6 @@ class VideoTranscriptTest(CMSVideoBaseTest):
self.edit_component()
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
def test_non_ascii_transcripts(self):
"""
Scenario: Check non-ascii (chinese) transcripts
Given I have created a Video component
After I enter a "video_name_1.mp4" source to field number 1 Then I see status message "No Timed Transcript"
After I upload the transcripts "chinese_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving the changes video captions should be visible
"""
self._create_video_component()
self.edit_component()
self.video.set_url_field('video_name_1.mp4', 1)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.video.upload_transcript('chinese_transcripts.srt')
self.assertEqual(self.video.message('status'), 'Timed Transcript Uploaded Successfully')
self.save_unit_settings()
self.assertTrue(self.video.is_captions_visible())
def test_upload_subtitles_w_different_names2(self):
"""
Scenario: Uploading subtitles for file with periods in it does not effect the uploaded transcript in anyway
Given I have created a Video component
After I enter a "video_name_1.1.2.mp4" source to field number 1, I see status message "No Timed Transcript"
After I upload the transcripts file "uk_transcripts.srt" I see message "Timed Transcript Uploaded Successfully"
After saving the changes video captions should be visible
After I edit the component I should see status message "Timed Transcript Found"
"""
self._create_video_component()
self.edit_component()
self.video.set_url_field('video_name_1.1.2.mp4', 1)
self.assertEqual(self.video.message('status'), 'No Timed Transcript')
self.video.upload_transcript('uk_transcripts.srt')
self.assertEqual(self.video.message('status'), 'Timed Transcript Uploaded Successfully')
self.save_unit_settings()
self.assertTrue(self.video.is_captions_visible())
self.edit_component()
self.assertEqual(self.video.message('status'), 'Timed Transcript Found')
def test_upload_subtitles_w_different_names3(self):
"""
Scenario: Shortened link: Shortened link to the source does not effect the uploaded