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

Add manual attachment to example #326

Merged
merged 4 commits into from
Aug 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.4
3.3.4
67 changes: 29 additions & 38 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -48,25 +48,23 @@ 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)
cucumber-cucumber-expressions (17.1.0)
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)
Expand All @@ -76,64 +74,60 @@ 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)
rspec-expectations (~> 3.13.0)
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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)!
Expand All @@ -188,4 +179,4 @@ DEPENDENCIES
solargraph (~> 0.50.0)

BUNDLED WITH
2.3.23
2.5.11
7 changes: 7 additions & 0 deletions features/google.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions features/step_definitions/common_steps.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'securerandom'

Given 'I am on' do |url|
visit("http://#{url}")
end
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions features/support/fixture/testplan.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"id": "1245",
"selector": "Gitlab page has icon"
},
{
"id": "1255",
"selector": "Manual attachment"
}
]
}
Loading