Skip to content

Commit

Permalink
eliminate 5 second wait from hidden unit ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsbailey committed Sep 10, 2018
1 parent bb7762d commit 4af7359
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/src/code-studio/hiddenStageRedux.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ function postToggleHidden(scriptName, sectionId, stageId, hidden) {
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify(data)
}).success(() => {
window.__TestInterface = window.__TestInterface || {};
window.__TestInterface.toggleHiddenUnitComplete = true;
});
}

Expand Down
3 changes: 3 additions & 0 deletions dashboard/test/ui/features/step_definitions/steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,9 @@ def refute_bad_gateway_or_site_unreachable

Then /^I hide unit "([^"]+)"$/ do |unit_name|
@browser.execute_script("$('.uitest-CourseScript:contains(#{unit_name}) .fa-eye-slash').click();")
wait_short_until do
@browser.execute_script("return window.__TestInterface.toggleHiddenUnitComplete;")
end
end

Then /^unit "([^"]+)" is marked as (not )?visible$/ do |unit_name, negation|
Expand Down
1 change: 0 additions & 1 deletion dashboard/test/ui/features/teacher_homepage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Feature: Using the teacher homepage sections feature

# Hide a unit from the section
When I hide unit "CSP Unit 2 - Digital Information"
And I wait for 5 seconds
And unit "CSP Unit 2 - Digital Information" is marked as not visible

# Verify hidden unit warning banner appears
Expand Down

0 comments on commit 4af7359

Please sign in to comment.