Split out non-js feature test in an effort to reduce flakiness

pull/1/head
Alex Basson 4 years ago
parent 473c169c0d
commit fe1e314c89

@ -37,12 +37,12 @@ def go_to_different_district(district)
end end
def district_admin_sees_schools_change def district_admin_sees_schools_change
expected_path = "/districts/#{school_in_same_district.district.slug}/schools/#{school_in_same_district.slug}/browse/#{SqmCategory.first.slug}?year=2020-21" expected_path = "/districts/#{school_in_same_district.district.slug}/schools/#{school_in_same_district.slug}/dashboard?year=2020-21"
expect(page).to have_current_path(expected_path) expect(page).to have_current_path(expected_path)
end end
def district_admin_sees_district_change def district_admin_sees_district_change
expected_path = "/districts/#{different_district.slug}/schools/#{different_district.schools.alphabetic.first.slug}/browse/#{SqmCategory.first.slug}?year=2020-21" expected_path = "/districts/#{different_district.slug}/schools/#{different_district.schools.alphabetic.first.slug}/dashboard?year=2020-21"
expect(page).to have_current_path(expected_path) expect(page).to have_current_path(expected_path)
end end
@ -141,7 +141,7 @@ feature 'School dashboard', type: feature do
expect(page).not_to have_text(school.name) expect(page).not_to have_text(school.name)
end end
scenario 'District Admin views a school dashboard', js: true do scenario 'District Admin navigates the site', js: true do
page.driver.basic_authorize(username, password) page.driver.basic_authorize(username, password)
visit '/welcome' visit '/welcome'
@ -149,11 +149,26 @@ feature 'School dashboard', type: feature do
district_admin_sees_dashboard_content district_admin_sees_dashboard_content
go_to_different_school_in_same_district(school_in_same_district)
district_admin_sees_schools_change
go_to_different_district(different_district)
district_admin_sees_district_change
end
scenario 'District Admin views a school dashboard' do
page.driver.browser.basic_authorize(username, password)
visit "/districts/#{district.slug}/schools/#{school.slug}/dashboard?year=#{ay_2020_21.range}"
district_admin_sees_dashboard_content
within('section#teachers-and-leadership') do within('section#teachers-and-leadership') do
expect(page).to have_text('View Details') expect(page).to have_text('View Details')
click_on 'View Details' click_on 'View Details'
end end
district_admin_sees_browse_content district_admin_sees_browse_content
click_on 'Dashboard' click_on 'Dashboard'
district_admin_sees_dashboard_content district_admin_sees_dashboard_content
@ -162,12 +177,6 @@ feature 'School dashboard', type: feature do
click_on 'School Culture' click_on 'School Culture'
expect(page).to have_text('This category measures the degree to which the school environment is safe, caring, and academically-oriented.') expect(page).to have_text('This category measures the degree to which the school environment is safe, caring, and academically-oriented.')
go_to_different_school_in_same_district(school_in_same_district)
district_admin_sees_schools_change
go_to_different_district(different_district)
district_admin_sees_district_change
end end
scenario 'user sees schools in the same district' do scenario 'user sees schools in the same district' do

Loading…
Cancel
Save