diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0be7b4a..6f9c1cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.1' + ruby-version: '3.3' bundler-cache: true - name: Test run: bundle exec cucumber --retry 1 diff --git a/.ruby-version b/.ruby-version index 0aec50e..a0891f5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.4 +3.3.4 diff --git a/Gemfile.lock b/Gemfile.lock index 513e11a..c7ecaec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,8 +16,8 @@ GIT GEM remote: https://rubygems.org/ specs: - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) backport (1.2.0) base64 (0.2.0) @@ -48,7 +48,7 @@ GEM multi_test (~> 1.1) sys-uname (~> 1.2) cucumber-ci-environment (10.0.1) - cucumber-core (13.0.2) + cucumber-core (13.0.3) cucumber-gherkin (>= 27, < 28) cucumber-messages (>= 20, < 23) cucumber-tag-expressions (> 5, < 7) @@ -56,17 +56,15 @@ GEM bigdecimal cucumber-gherkin (27.0.0) cucumber-messages (>= 19.1.4, < 23) - cucumber-html-formatter (21.4.0) - cucumber-messages (> 19, < 25) + cucumber-html-formatter (21.7.0) + cucumber-messages (> 19, < 27) cucumber-messages (22.0.0) cucumber-tag-expressions (6.1.0) diff-lcs (1.5.1) e2mmap (0.1.0) ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux-gnu) - jaro_winkler (1.5.6) - json (2.7.1) + jaro_winkler (1.6.0) + json (2.7.2) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) @@ -76,37 +74,33 @@ GEM macaddr (1.7.2) systemu (~> 2.6.5) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0702) + mime-types-data (3.2024.0820) mini_mime (1.1.5) multi_test (1.1.0) - nokogiri (1.16.5-arm64-darwin) - racc (~> 1.4) - nokogiri (1.16.5-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - parallel (1.23.0) - parser (3.2.2.4) + parallel (1.26.3) + parser (3.3.4.2) ast (~> 2.4.1) racc pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.4) - racc (1.7.3) - rack (3.0.9.1) + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.7) rack-test (2.1.0) rack (>= 1.3) rainbow (3.1.1) rbs (2.8.4) - regexp_parser (2.9.0) + regexp_parser (2.9.2) require_all (3.0.0) reverse_markdown (2.1.1) nokogiri - rexml (3.3.3) + rexml (3.3.5) strscan rspec (3.13.0) rspec-core (~> 3.13.0) @@ -114,26 +108,26 @@ GEM rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) - rspec-expectations (3.13.1) + rspec-expectations (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - rubocop (1.58.0) + rubocop (1.65.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.32.1) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) rubyzip (2.3.2) selenium-webdriver (4.23.0) @@ -162,8 +156,8 @@ GEM sys-uname (1.3.0) ffi (~> 1.1) systemu (2.6.5) - thor (1.3.0) - tilt (2.3.0) + thor (1.3.1) + tilt (2.4.0) unicode-display_width (2.5.0) uuid (2.3.9) macaddr (~> 1.0) @@ -173,10 +167,7 @@ GEM yard (0.9.36) PLATFORMS - arm64-darwin-21 - arm64-darwin-22 - x86_64-darwin-21 - x86_64-linux + ruby DEPENDENCIES allure-cucumber (~> 2.24.5)! @@ -188,4 +179,4 @@ DEPENDENCIES solargraph (~> 0.50.0) BUNDLED WITH - 2.3.23 + 2.5.11 diff --git a/features/google.feature b/features/google.feature index 7c0a225..0d1ee46 100644 --- a/features/google.feature +++ b/features/google.feature @@ -27,3 +27,10 @@ Feature: Using Google gitlab.com """ Then I should see gitlab icon + + Scenario: Manual attachment + Given I am on + """ + github.com + """ + Then I should be able to create screenshot attachment diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb index cc1e00e..ef644e5 100644 --- a/features/step_definitions/common_steps.rb +++ b/features/step_definitions/common_steps.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'securerandom' + Given 'I am on' do |url| visit("http://#{url}") end @@ -31,3 +33,10 @@ Then 'it passes on the second try' do expect(Global.run).to eq(2) end + +Then 'I should be able to create screenshot attachment' do + filename = "tmp/screenshot-#{SecureRandom.uuid}.png" + page.save_screenshot(filename) + + Allure.add_attachment(name: 'screenshot', source: File.new(filename), type: Allure::ContentType::PNG) +end diff --git a/features/support/fixture/testplan.json b/features/support/fixture/testplan.json index b7602f8..f2e0a54 100644 --- a/features/support/fixture/testplan.json +++ b/features/support/fixture/testplan.json @@ -8,6 +8,10 @@ { "id": "1245", "selector": "Gitlab page has icon" + }, + { + "id": "1255", + "selector": "Manual attachment" } ] }