ensure page reload in spec before clicking

pull/6329/head
Jens Ulferts 7 years ago
parent 09156956e8
commit 7e12f3fc76
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 67
      spec/features/work_packages/custom_actions_spec.rb

@ -35,35 +35,35 @@ describe 'Custom actions', type: :feature, js: true do
let(:admin) { FactoryBot.create(:admin) }
let(:user) do
user = FactoryBot.create(:user,
firstname: 'A',
lastname: 'User')
firstname: 'A',
lastname: 'User')
FactoryBot.create(:member,
project: project,
roles: [role],
user: user)
project: project,
roles: [role],
user: user)
FactoryBot.create(:member,
project: other_project,
roles: [role],
user: user)
project: other_project,
roles: [role],
user: user)
user
end
let!(:other_member_user) do
FactoryBot.create(:user,
firstname: 'Other member',
lastname: 'User',
member_in_project: project,
member_through_role: role)
firstname: 'Other member',
lastname: 'User',
member_in_project: project,
member_through_role: role)
end
let(:project) { FactoryBot.create(:project) }
let(:other_project) { FactoryBot.create(:project) }
let!(:work_package) do
FactoryBot.create(:work_package,
project: project,
assigned_to: user,
priority: default_priority,
status: default_status)
project: project,
assigned_to: user,
priority: default_priority,
status: default_status)
end
let(:wp_page) { Pages::FullWorkPackage.new(work_package) }
@ -72,8 +72,8 @@ describe 'Custom actions', type: :feature, js: true do
end
let!(:immediate_priority) do
FactoryBot.create(:issue_priority,
name: 'At once',
position: IssuePriority.maximum(:position) + 1)
name: 'At once',
position: IssuePriority.maximum(:position) + 1)
end
let(:default_status) do
FactoryBot.create(:default_status)
@ -93,21 +93,21 @@ describe 'Custom actions', type: :feature, js: true do
end
let!(:workflows) do
FactoryBot.create(:workflow,
old_status: work_package.status,
new_status: closed_status,
role: role,
type: work_package.type)
old_status: work_package.status,
new_status: closed_status,
role: role,
type: work_package.type)
FactoryBot.create(:workflow,
new_status: work_package.status,
old_status: closed_status,
role: role,
type: work_package.type)
new_status: work_package.status,
old_status: closed_status,
role: role,
type: work_package.type)
FactoryBot.create(:workflow,
old_status: work_package.status,
new_status: rejected_status,
role: role,
type: work_package.type)
old_status: work_package.status,
new_status: rejected_status,
role: role,
type: work_package.type)
end
let!(:list_custom_field) do
cf = FactoryBot.create(:list_wp_custom_field, multi_value: true)
@ -246,14 +246,15 @@ describe 'Custom actions', type: :feature, js: true do
wp_page.dismiss_notification!
## Bump the lockVersion and by that force a conflict.
WorkPackage.where(id: work_package.id).update_all(lock_version: 10, updated_at: Time.now)
work_package.reload.touch
wp_page.click_custom_action('Escalate')
wp_page.expect_notification type: :error, message: I18n.t('api_v3.errors.code_409')
visit "/"
wp_page.visit!
sleep(4)
# reload the page
page.driver.browser.navigate.refresh
wp_page.click_custom_action('Escalate')

Loading…
Cancel
Save