Skip to content
Snippets Groups Projects
Commit 766663ee authored by Jesse Zoldak's avatar Jesse Zoldak
Browse files

Merge pull request #7217 from edx/ziafazal/fix-studio-settings-flaky-test

fixed a flaky test (acceptance.tests.studio.test_studio_settings_details.SettingsMilestonesTest.test_prerequisite_course_save_successfully)
parents 4e454cca 0b28c3fd
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ from datetime import datetime
from path import path
from bok_choy.javascript import js_defined
from bok_choy.web_app_test import WebAppTest
from bok_choy.promise import EmptyPromise
from opaque_keys.edx.locator import CourseLocator
from pymongo import MongoClient
from xmodule.partitions.partitions import UserPartition
......@@ -215,6 +216,28 @@ def select_option_by_value(browser_query, value):
select = Select(browser_query.first.results[0])
select.select_by_value(value)
def options_selected():
"""
Returns True if all options in select element where value attribute
matches `value`. if any option is not selected then returns False
and select it. if value is not an option choice then it returns False.
"""
all_options_selected = True
has_option = False
for opt in select.options:
if opt.get_attribute('value') == value:
has_option = True
if not opt.is_selected():
all_options_selected = False
opt.click()
# if value is not an option choice then it should return false
if all_options_selected and not has_option:
all_options_selected = False
return all_options_selected
# Make sure specified option is actually selected
EmptyPromise(options_selected, "Option is selected").fulfill()
def is_option_value_selected(browser_query, value):
"""
......
......@@ -40,7 +40,6 @@ class SettingsMilestonesTest(StudioCourseTest):
self.assertTrue(self.settings_detail.pre_requisite_course_options)
@skip("Flaky test. See SOL-449")
def test_prerequisite_course_save_successfully(self):
"""
Scenario: Selecting course from Pre-Requisite course drop down save the selected course as pre-requisite
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment