spec: find elements text, then check for include
sometimes the order of the outcomes are different causing failure, instead let's grab the grades and verify that each grade is include in the array. Change-Id: Id18d78a4bb6bed9e15801ddb349d161654a5c2a5 Reviewed-on: https://gerrit.instructure.com/196460 Tested-by: Jenkins Reviewed-by: Derek Bender <djbender@instructure.com> QA-Review: James Butters <jbutters@instructure.com> Product-Review: James Butters <jbutters@instructure.com>
This commit is contained in:
parent
37dbf1d8cd
commit
c4f0028f35
|
@ -194,17 +194,17 @@ describe "outcome gradebook" do
|
|||
wait_for_ajax_requests
|
||||
|
||||
# mean
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score')).to have_size 2
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').first.text).to eq '2.33'
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').second.text).to eq '2.67'
|
||||
means = ff('.outcome-gradebook-container .headerRow_1 .outcome-score').map(&:text)
|
||||
expect(means).to have_size 2
|
||||
expect(means).to include "2.33"
|
||||
expect(means).to include "2.67"
|
||||
|
||||
f('#no_results_outcomes').click
|
||||
wait_for_ajax_requests
|
||||
|
||||
# mean
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score')).to have_size 2
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').first.text).to eq '2.33'
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').second.text).to eq '2.67'
|
||||
means = ff('.outcome-gradebook-container .headerRow_1 .outcome-score').map(&:text)
|
||||
expect(means).to contain_exactly("2.33", "2.67")
|
||||
end
|
||||
|
||||
it "displays course mean and median" do
|
||||
|
@ -213,17 +213,15 @@ describe "outcome gradebook" do
|
|||
wait_for_ajax_requests
|
||||
|
||||
# mean
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score')).to have_size 2
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').first.text).to eq '2.33'
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').second.text).to eq '2.67'
|
||||
averages = ff('.outcome-gradebook-container .headerRow_1 .outcome-score').map(&:text)
|
||||
expect(averages).to contain_exactly("2.33", "2.67")
|
||||
|
||||
# median
|
||||
f('.al-trigger').click
|
||||
ff('.al-options .ui-menu-item').second.click
|
||||
wait_for_ajax_requests
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score')).to have_size 2
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').first.text).to eq '2'
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').second.text).to eq '3'
|
||||
medians = ff('.outcome-gradebook-container .headerRow_1 .outcome-score').map(&:text)
|
||||
expect(medians).to contain_exactly("2", "3")
|
||||
|
||||
# switch to first section
|
||||
f('.section-select-button').click
|
||||
|
@ -234,9 +232,8 @@ describe "outcome gradebook" do
|
|||
wait_for_ajax_requests
|
||||
|
||||
# median
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score')).to have_size 2
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').first.text).to eq '2.5'
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').second.text).to eq '2.5'
|
||||
medians = ff('.outcome-gradebook-container .headerRow_1 .outcome-score').map(&:text)
|
||||
expect(medians).to contain_exactly("2.5", "2.5")
|
||||
|
||||
# switch to second section
|
||||
f('.section-select-button').click
|
||||
|
@ -248,9 +245,8 @@ describe "outcome gradebook" do
|
|||
refresh_page
|
||||
|
||||
# should remain on second section, with mean
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score')).to have_size 2
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').first.text).to eq '2'
|
||||
expect(ff('.outcome-gradebook-container .headerRow_1 .outcome-score').second.text).to eq '3'
|
||||
means = ff('.outcome-gradebook-container .headerRow_1 .outcome-score').map(&:text)
|
||||
expect(means).to contain_exactly("2", "3")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue