TNL-481: Add RequireJS Optimizer.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Course Advanced Settings page
|
||||
"""
|
||||
|
||||
from bok_choy.promise import EmptyPromise
|
||||
from .course_page import CoursePage
|
||||
from .utils import press_the_notification_button, type_in_codemirror, get_codemirror_value
|
||||
|
||||
@@ -13,6 +14,7 @@ MODAL_SELECTOR = ".validation-error-modal-content"
|
||||
ERROR_ITEM_NAME_SELECTOR = ".error-item-title strong"
|
||||
ERROR_ITEM_CONTENT_SELECTOR = ".error-item-message"
|
||||
|
||||
|
||||
class AdvancedSettingsPage(CoursePage):
|
||||
"""
|
||||
Course Advanced Settings page.
|
||||
@@ -21,6 +23,10 @@ class AdvancedSettingsPage(CoursePage):
|
||||
url_path = "settings/advanced"
|
||||
|
||||
def is_browser_on_page(self):
|
||||
def _is_finished_loading():
|
||||
return len(self.q(css='.course-advanced-policy-list-item')) > 0
|
||||
|
||||
EmptyPromise(_is_finished_loading, 'Finished rendering the advanced policy items.').fulfill()
|
||||
return self.q(css='body.advanced').present
|
||||
|
||||
def wait_for_modal_load(self):
|
||||
|
||||
@@ -4,6 +4,7 @@ Utility methods useful for Studio page tests.
|
||||
from selenium.webdriver.common.action_chains import ActionChains
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from bok_choy.promise import EmptyPromise
|
||||
from bok_choy.javascript import js_defined
|
||||
|
||||
from ...tests.helpers import disable_animations
|
||||
|
||||
@@ -50,6 +51,7 @@ def wait_for_notification(page):
|
||||
EmptyPromise(_is_saving_done, 'Notification should have been hidden.', timeout=60).fulfill()
|
||||
|
||||
|
||||
@js_defined('window.jQuery')
|
||||
def press_the_notification_button(page, name):
|
||||
# Because the notification uses a CSS transition,
|
||||
# Selenium will always report it as being visible.
|
||||
@@ -101,6 +103,7 @@ def add_advanced_component(page, menu_index, name):
|
||||
click_css(page, component_css, 0)
|
||||
|
||||
|
||||
@js_defined('window.jQuery')
|
||||
def type_in_codemirror(page, index, text, find_prefix="$"):
|
||||
script = """
|
||||
var cm = {find_prefix}('div.CodeMirror:eq({index})').get(0).CodeMirror;
|
||||
@@ -110,6 +113,7 @@ def type_in_codemirror(page, index, text, find_prefix="$"):
|
||||
page.browser.execute_script(script, str(text))
|
||||
|
||||
|
||||
@js_defined('window.jQuery')
|
||||
def get_codemirror_value(page, index=0, find_prefix="$"):
|
||||
return page.browser.execute_script(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user