Remove search settings and add test to validate search visibility
This commit is contained in:
@@ -9,7 +9,6 @@ WAFFLE_NAMESPACE = u'studio'
|
||||
|
||||
# Switches
|
||||
ENABLE_ACCESSIBILITY_POLICY_PAGE = u'enable_policy_page'
|
||||
ENABLE_ASSETS_SEARCH = u'enable_assets_search'
|
||||
|
||||
|
||||
def waffle():
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
|
||||
from cms.djangoapps.contentstore.config.waffle import waffle, ENABLE_ASSETS_SEARCH
|
||||
%>
|
||||
<%block name="title">${_("Files & Uploads")}</%block>
|
||||
<%block name="bodyclass">is-signedin course uploads view-uploads</%block>
|
||||
@@ -49,9 +48,6 @@
|
||||
},
|
||||
"upload_settings": {
|
||||
"max_file_size_in_mbs": ${max_file_size_in_mbs|n, dump_js_escaped_json}
|
||||
},
|
||||
"search_settings": {
|
||||
"enabled": ${waffle().is_enabled(ENABLE_ASSETS_SEARCH) | n, dump_js_escaped_json}
|
||||
}
|
||||
}
|
||||
</%static:studiofrontend>
|
||||
|
||||
@@ -77,6 +77,11 @@ class AssetIndexPageStudioFrontend(CoursePage):
|
||||
"""Checks that pagination is on the page."""
|
||||
return self.q(css='.pagination').present
|
||||
|
||||
@wait_for_js
|
||||
def is_search_element_on_page(self):
|
||||
"""Checks that search bar is on the page."""
|
||||
return self.q(css="[name='search']").present
|
||||
|
||||
@wait_for_js
|
||||
def is_status_alert_element_on_page(self):
|
||||
"""Checks that status alert is hidden on page."""
|
||||
|
||||
@@ -35,6 +35,7 @@ class AssetIndexTestStudioFrontend(StudioCourseTest):
|
||||
assert self.assert_sortable_table_heading_elements_exist()
|
||||
assert self.assert_status_element_exists()
|
||||
assert self.assert_pagination_element_exists()
|
||||
assert self.assert_search_element_exists()
|
||||
|
||||
def assert_page_without_filter_results_elements_load(self):
|
||||
"""Make sure correct elements are on page for a filter with no results."""
|
||||
@@ -42,6 +43,7 @@ class AssetIndexTestStudioFrontend(StudioCourseTest):
|
||||
assert not self.assert_table_exists()
|
||||
assert not self.assert_sortable_table_heading_elements_exist()
|
||||
assert not self.assert_pagination_element_exists()
|
||||
assert not self.assert_search_element_exists()
|
||||
|
||||
assert self.assert_status_element_exists()
|
||||
assert self.assert_type_filter_exists()
|
||||
@@ -77,6 +79,10 @@ class AssetIndexTestStudioFrontend(StudioCourseTest):
|
||||
"""Make sure pagination element is on the page."""
|
||||
return self.asset_page.is_pagination_element_on_page() is True
|
||||
|
||||
def assert_search_element_exists(self):
|
||||
"""Make sure search element is on the page."""
|
||||
return self.asset_page.is_search_element_on_page() is True
|
||||
|
||||
def assert_no_results_headings_exist(self):
|
||||
"""Make sure headings with text for no results is on the page."""
|
||||
return self.asset_page.are_no_results_headings_on_page()
|
||||
|
||||
Reference in New Issue
Block a user