Skip to content

Commit

Permalink
# This is a combination of 6 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

Resource calculate dates

# This is the commit message #2:

Overcommit

# This is the commit message #3:

Fix specs

# This is the commit message #4:

Force error

# This is the commit message #5:

Test

# This is the commit message #6:

Test
  • Loading branch information
blacksmith-welder committed Dec 10, 2024
1 parent 6ee5674 commit 8fc4622
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RuboCop:
enabled: true
on_warn: fail
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem 'byebug'
gem 'capybara'
gem 'cucumber'
gem 'cuke_linter'
gem 'overcommit', require: false
gem 'rspec-expectations'
gem 'rubocop-packaging', require: false
gem 'selenium-webdriver'
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (5.1.0)
logger (~> 1.5)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
Expand Down Expand Up @@ -48,6 +50,7 @@ GEM
cucumber-gherkin (< 29.0)
diff-lcs (1.5.1)
ffi (1.17.0-x86_64-linux-gnu)
iniparse (1.5.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
Expand All @@ -56,6 +59,10 @@ GEM
multi_test (1.1.0)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
overcommit (0.64.0)
childprocess (>= 0.6.3, < 6)
iniparse (~> 1.4)
rexml (~> 3.2)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
Expand Down Expand Up @@ -112,6 +119,7 @@ DEPENDENCIES
capybara
cucumber
cuke_linter
overcommit
rspec-expectations
rubocop-packaging
selenium-webdriver
Expand Down
3 changes: 2 additions & 1 deletion staff_features/resources/resource_calculate_dates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ Feature: Resource calculate dates
Scenario: Dates sub record is added to the Resource
When the user clicks on 'More'
And the user clicks on 'Calculate Dates'
And the user selects 'Calculate for all dates' in the modal
And the user clicks on 'Calculate Date Record' in the modal
And the user selects 'Single' from 'Type' in the date calculator result in the modal
And the user selects 'Single' from 'Type' in the modal
And the user fills in 'Begin' with '2022' in the modal
And the user clicks on 'Create Date Record' in the modal
And the user clicks on 'Save'
Expand Down
27 changes: 10 additions & 17 deletions staff_features/shared/step_definitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@

within '.modal-content' do
click_on_string string

if string == 'Calculate Date Record'
click_on 'Cancel'
end

raise "Force error"
end
end

Expand Down Expand Up @@ -188,29 +194,16 @@
select option, from: label, match: :first
end

When 'the user selects {string} from {string} in the date calculator result in the modal' do |option, label|
wait_for_ajax

tries = 0
begin
find('#date_calculator_create_date_form')
rescue Capybara::ElementNotFound => e
raise e if tries == 5

tries += 1
sleep 3
retry
end

within '#date_calculator_create_date_form' do
select option, from: label
When 'the user selects {string} in the modal' do |select_option|
within '.modal-content' do
find('#label').select select_option
end
end

When 'the user selects {string} from {string} in the modal' do |option, label|
wait_for_ajax

within '#date-calculator-result' do
within '.modal-content' do
select option, from: label
end
end
Expand Down

0 comments on commit 8fc4622

Please sign in to comment.