Skip to content

Commit 6ece269

Browse files
Fix sessions
1 parent a8a92cf commit 6ece269

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

env.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
options = Selenium::WebDriver::Firefox::Options.new
2727
options.add_argument(HEADLESS)
2828

29-
Capybara::Selenium::Driver.new(app, browser: :firefox, options:)
29+
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
30+
end
31+
32+
Capybara.register_driver :firefox_alternative_session do |app|
33+
options = Selenium::WebDriver::Firefox::Options.new
34+
options.add_argument(HEADLESS)
35+
36+
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
3037
end
3138

3239
Capybara.default_driver = :firefox

helpers/helpers.rb

+14-14
Original file line numberDiff line numberDiff line change
@@ -91,26 +91,26 @@ def ensure_test_repository_exists
9191
end
9292

9393
def ensure_test_user_exists
94-
# visit "#{STAFF_URL}/users/new"
94+
visit "#{STAFF_URL}/users/new"
9595

96-
# fill_in 'user_username_', with: 'test'
97-
# fill_in 'user_name_', with: 'test'
98-
# fill_in 'user_password_', with: 'test'
99-
# fill_in 'user_confirm_password_', with: 'test'
100-
# check 'user_is_admin_'
96+
fill_in 'user_username_', with: 'test'
97+
fill_in 'user_name_', with: 'test'
98+
fill_in 'user_password_', with: 'test'
99+
fill_in 'user_confirm_password_', with: 'test'
100+
check 'user_is_admin_'
101101

102-
# click_on 'Create Account', match: :first
102+
click_on 'Create Account', match: :first
103103

104-
# visit "#{STAFF_URL}/users/manage_access"
104+
visit "#{STAFF_URL}/users/manage_access"
105105

106-
# row = find('tr', text: 'test')
106+
row = find('tr', text: 'test')
107107

108-
# within row do
109-
# click_on 'Edit Groups'
110-
# end
108+
within row do
109+
click_on 'Edit Groups'
110+
end
111111

112-
# check 'repository-advanced-data-entry'
113-
# click_on 'Update Account'
112+
check 'repository-advanced-data-entry'
113+
click_on 'Update Account'
114114
end
115115

116116
def find_user_table_row_in_manage_user_access_page(username)

staff_features/accessions/step_definitions/accession_edit.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@
127127
end
128128

129129
Given 'the Accession is opened in edit mode by User B' do
130-
@session = Capybara::Session.new(:selenium)
130+
@session = Capybara::Session.new(:firefox_alternative_session)
131+
131132
@session.visit(STAFF_URL)
132133

133134
@session.fill_in 'username', with: 'test'

0 commit comments

Comments
 (0)