Skip to content

Commit

Permalink
Merge pull request #4197 from MCGallaspy/fixup-contentrec-test
Browse files Browse the repository at this point in the history
Add more explicit wait in test
  • Loading branch information
rtibbles committed Aug 13, 2015
2 parents 17ae1da + c5e036b commit fed1174
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# File created by Coverage
.coverage

# PyCharm
.idea

# Eclipse
.project
.pydevproject
Expand Down
2 changes: 1 addition & 1 deletion kalite/coachreports/features/steps/coachreports.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def step_impl(context):
# time it's built because of /api/coachreports/summary/?facility_id
# being super slow
try:
find_id_with_wait(context, "summary_mainview", wait_time=30)
find_id_with_wait(context, "summary_mainview", wait_time=60)
except TimeoutException:
raise RuntimeError("Could not find element, this was the DOM:\n\n" + context.browser.execute_script("return document.documentElement.outerHTML"))

Expand Down
12 changes: 4 additions & 8 deletions kalite/distributed/features/steps/content_recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def impl(context):

@when(u'I click on the right of an exercise suggestion on the next steps card')
def impl(context):
card = find_id_with_wait(context, "nextsteps")
element = card.find_elements_by_tag_name("a")[1]
element = find_css_class_with_wait(context, "content-nextsteps-topic-link")
click_and_wait_for_page_load(context, element, wait_time=15)

@then(u'I should be taken to that topic')
Expand All @@ -31,8 +30,7 @@ def impl(context):

@when(u'I click in the middle of an exercise suggestion on the next steps card')
def impl(context):
card = find_id_with_wait(context, "nextsteps")
element = card.find_elements_by_tag_name("a")[0]
element = find_css_class_with_wait(context, "content-nextsteps-lesson-link")
click_and_wait_for_page_load(context, element, wait_time=15)

@then(u'the content recommendation cards should be shown')
Expand All @@ -46,8 +44,7 @@ def impl(context):

@when(u'I click on a suggested topic on the explore card')
def impl(context):
card = find_id_with_wait(context, "explore")
element = card.find_element_by_tag_name("a")
element = find_css_class_with_wait(context, "content-explore-topic-link")
click_and_wait_for_page_load(context, element)

@then(u'I should be taken to that exercise')
Expand All @@ -56,6 +53,5 @@ def impl(context):

@when(u'I click on the resume card lesson')
def impl(context):
card = find_id_with_wait(context, "resume")
element = card.find_element_by_tag_name("a")
element = find_css_class_with_wait(context, "content-resume-topic-link")
click_and_wait_for_page_load(context, element)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--likely to be a link to the subject in the sidenav tree-->
<a href="/learn/{{suggested_topic.path}}">
<a href="/learn/{{suggested_topic.path}}" class="content-explore-topic-link">
<div class="content-explore-topic">
<div class="row">
<div class="col-xs-12">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div class="row" class="content-nextsteps-lesson">
<a href="/learn/{{ path }}">
<a href="/learn/{{ path }}" class="content-nextsteps-lesson-link">
<div class="col-xs-3">
<center>
{{#if content_urls.thumbnail }}
Expand All @@ -21,7 +21,7 @@
</a>
<!--The URL without the specific video, so that we see the path
along the nav and show them the entire series-->
<a href="/learn/{{ topic.path }}">
<a href="/learn/{{ topic.path }}" class="content-nextsteps-topic-link">
<div class="col-xs-3">
<h4>{{_ "Topic" }}</h4>
<span class="ns_series_arrow glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<hr class="module_divider" />
</div>
<a href="/learn/{{ path }}">
<a href="/learn/{{ path }}" class="content-resume-topic-link">
<!--Where the video thumbnail and description go-->
<div id="content-resume-thumbnail">
{{#if content_urls.thumbnail }}
Expand Down

0 comments on commit fed1174

Please sign in to comment.