Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: Removing flaky specs from pending to analyze the failure #6215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions spec/features/course_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,8 @@ def js_visit(path, count=3)
expect(assigned_articles_section).to have_content 'Education'
expect(Assignment.count).to eq(1)
expect(assigned_articles_section).to have_content 'Remove'
accept_alert do
click_button 'Remove'
end
click_button 'Remove'
click_button 'OK'
expect(assigned_articles_section).not_to have_content 'Education'

pass_pending_spec
Expand Down
50 changes: 14 additions & 36 deletions spec/features/instructor_role_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'rails_helper'

describe 'Instructor users', type: :feature, js: true do
describe 'Instructor users', :js, type: :feature do
before do
include type: :feature
include Devise::TestHelpers
Expand Down Expand Up @@ -70,7 +70,7 @@
it 'can see the passcode' do
visit "/courses/#{Course.first.slug}"
expect(page).to have_content('passcode')
expect(page).not_to have_content('****')
expect(page).to have_no_content('****')
end
end

Expand Down Expand Up @@ -128,52 +128,34 @@
sleep 1
visit "/courses/#{Course.first.slug}/students"
expect(page).to have_content 'Student A'
expect(page).not_to have_content 'Student B'
expect(page).to have_no_content 'Student B'
end

it 'is able to assign articles' do
pending 'This sometimes fails on travis.'

visit "/courses/#{Course.first.slug}/students/articles"
first('.student-selection .student').click

# Assign an article
click_button 'Assign Articles'
find('button.border', text: 'Assign/remove an article', match: :first).click
within('#users') { find('input', match: :first).set('Article 1') }
within('#users') { find('textarea', match: :first).set('Article 1') }
click_button 'Assign'
click_button 'OK'
find('button.border.assign-button', match: :first).click
click_button 'Done'

# Assign a review
find('button.border', text: 'Assign/remove a peer review', match: :first).click
sleep 1
within('#users') { find('input', match: :first).set('Article 2') }
within('#users') { find('textarea', match: :first).set('Article 2') }
click_button 'Assign'
click_button 'OK'
find('button.border.assign-button', match: :first).click
click_button 'Done'

# Leave editing mode
within 'div.controls' do
click_button 'Done'
end
expect(page).to have_content 'Article 1'
expect(page).to have_content 'Article 2'

# Delete an assignments
visit "/courses/#{Course.first.slug}/students/articles"
sleep 1
click_button 'Assign Articles'
find('button.border.assign-button', match: :first).click
page.accept_confirm do
click_button '-'
end
sleep 1
within 'div.controls' do
click_button 'Done'
end
expect(page).not_to have_content 'Article 1'

pass_pending_spec
first('.student-selection .student').click
find('button.border', text: 'Assign/remove an article', match: :first).click
first('button.border.assign-selection-button', text: 'Remove').click
click_button 'OK'
expect(page).to have_no_content 'Article 1'
end

it 'is able to add Available Articles' do
Expand All @@ -187,17 +169,13 @@
end

it 'is able to remove students from the course' do
pending 'This sometimes fails on travis.'

visit "/courses/#{Course.first.slug}/students/overview"

click_button 'Add/Remove Students'
find('button.border.plus', text: '-', match: :first).click
click_button 'OK'
sleep 1
expect(page).not_to have_content 'Student A'

pass_pending_spec
expect(page).to have_no_content 'Student A'
end

it 'is able to notify users with overdue training' do
Expand Down
9 changes: 2 additions & 7 deletions spec/features/survey_bugs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
end

it 'handles changes in condition questions' do
pending 'This sometimes fails for unknown reasons.'

visit survey_path(@survey)

Expand All @@ -100,7 +99,6 @@
end

expect(page).to have_content('Submit Survey')

# Now go back to the previous question
within('div[data-progress-index="4"]') do
click_button('Previous', visible: true) # Q4
Expand All @@ -114,7 +112,6 @@
end

sleep 1

# Now go back to the previous question
within('div[data-progress-index="4"]') do
click_button('Previous', visible: true) # Q3
Expand All @@ -128,16 +125,14 @@
click_button('Next', visible: true) # Q2
end

sleep 2
expect(page).to have_content('Submit Survey')

# Now we can actually submit the survey
# and finish.
expect(page).to have_field("answer_group_#{Rapidfire::Question.last.id}_answer_text")
fill_in("answer_group_#{Rapidfire::Question.last.id}_answer_text", with: 'Done!')
expect(page).to have_content('Submit Survey')
click_button('Submit Survey', visible: true)
expect(page).to have_content 'You made it!'

pass_pending_spec
end
end
end
Loading