Commit c972cc8d by Braden MacDonald Committed by Jonathan Piacenti

Fix flaky dashboard test

parent 98dd0679
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
# Imports ########################################################### # Imports ###########################################################
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
import logging from lazy import lazy
from lxml import etree import uuid
from xblock.core import XBlock from xblock.core import XBlock
from xblock.fields import Scope, String, Float, List, UNIQUE_ID from xblock.fields import Scope, String, Float, UNIQUE_ID
from xblock.fragment import Fragment from xblock.fragment import Fragment
from xblock.validation import ValidationMessage from xblock.validation import ValidationMessage
from xblockutils.helpers import child_isinstance from xblockutils.helpers import child_isinstance
...@@ -90,14 +90,14 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc ...@@ -90,14 +90,14 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
""" translate text """ """ translate text """
return self.runtime.service(self, "i18n").ugettext(text) return self.runtime.service(self, "i18n").ugettext(text)
@property @lazy
def html_id(self): def html_id(self):
""" """
A short, simple ID string used to uniquely identify this question. A short, simple ID string used to uniquely identify this question.
This is only used by templates for matching <input> and <label> elements. This is only used by templates for matching <input> and <label> elements.
""" """
return unicode(id(self)) # Unique as long as all choices are loaded at once return uuid.uuid4().hex[:20]
def student_view(self, context=None): def student_view(self, context=None):
name = getattr(self, "unmixed_class", self.__class__).__name__ name = getattr(self, "unmixed_class", self.__class__).__name__
......
...@@ -175,6 +175,7 @@ class TestDashboardBlock(SeleniumXBlockTest): ...@@ -175,6 +175,7 @@ class TestDashboardBlock(SeleniumXBlockTest):
choices = mcq.find_elements_by_css_selector('.choices .choice label') choices = mcq.find_elements_by_css_selector('.choices .choice label')
choices[idx].click() choices[idx].click()
submit = pb.find_element_by_css_selector('.submit input.input-main') submit = pb.find_element_by_css_selector('.submit input.input-main')
self.assertTrue(submit.is_enabled())
submit.click() submit.click()
self.wait_until_disabled(submit) self.wait_until_disabled(submit)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment