allure-framework / allure-ruby-commons Goto Github PK
View Code? Open in Web Editor NEWDeprecated, use https://github.com/allure-framework/allure-ruby instead
License: Other
Deprecated, use https://github.com/allure-framework/allure-ruby instead
License: Other
Hey folks,
Figured I would start the conversation about getting ready for Allure Core 2.0
. Is there anyone on the yandex team who is gearing up to port the ruby adaptor? If not, please let us know how the community can step up and help.
version: 0.6.8
๐ wrong use @LOGGER
, should replace with LOGGER
when example stoping, will raise error:
RSpec::Core::MultipleExceptionError: undefined method `debug' for nil:NilClass
undefined method `debug' for nil:NilClass
undefined method `debug' for nil:NilClass
undefined method `debug' for nil:NilClass
undefined method `debug' for nil:NilClass
undefined method `debug' for nil:NilClass
undefined method `debug' for nil:NilClass
Hey,
Some folks who are using the allure-cucumber repo are very interested in getting cucumber tags to show in the allure XML report. The add that functionality, it would require allure-core be updated to support a label type called 'tags'. We would then extend that api in allure-ruby-adaptop-api
From this attached issue, I can see the functionality is available in allure-core-java.
allure-framework/allure1#764
I assume the type you are expecting for parameter file
in option opts
is File
. But what does this mean? File type does not have basename
instance method. Am I missing something?
See allure-core for example.
I have a scenario that calls one step many times
Ex:
.......(when I do something).......
"Then I should see the "HomePage"
.......(when I do something).......
"Then I should see the "HomePage"
.......(when I do something).......
"Then I should see the "HomePage"
If the step fails I will attach some log file and screenshot to my step.
The problem is if this step fail at the 3rd time called, all my report files will be attached to the 1st step.
This is not correct and cause difficulty in my debugging.
Anyone got the same problem and anyway to fix this?
Thanks.
I have few steps in cucumber-adaptor which I can't execute in realtime so I would want to be able to pass time as argument to start_step
and stop_step
methods.
Making it optional won't break anything in adaptors
def start_step(suite, test, step, time = Time.now)
MUTEX.synchronize do
puts "Starting step #{suite}.#{test}.#{step}"
self.suites[suite][:tests][test][:steps][step] = {
:title => step,
:start => timestamp(time),
:attachments => []
}
end
end
def stop_step(suite, test, step, status = :passed, time = Time.now)
MUTEX.synchronize do
puts "Stopping step #{suite}.#{test}.#{step}"
self.suites[suite][:tests][test][:steps][step][:stop] = timestamp(time)
self.suites[suite][:tests][test][:steps][step][:status] = status
end
end
@smecsia - If this looks ok to you then I will send a pull request.
Couple of Ruby tools, Inspec and ServerSpec, have occupied a very interesting niche: infrastructure testing that validates target machine for being compliant to set of rules. While both of them are based on RSpec, and generally RSpec adapter should fit in somehow, they are often used under not so common conditions (Test Kitchen that allows only declarative configuration or simply run by people that are not familiar with Ruby enough), what restricts people from using Allure reports - and they would come very handy since security-concerning Inspec check may consist of thousands of assertions, and usually those tools are used against of fleet of machines. That would be terribly lovely to add a cherry on top of infrastructure automation stack Chef guys has made, because currently i can validate may configuration against all possible distros i can imagine, but it's quite difficult to find who exactly has failed (especially if tests are run concurrently, which is typical for test Test Kitchen with tens of target distros).
So, this issue suggests
There is a possibility that i'll do it one day myself, but past experience tells me that's not what i can be sure about.
Feel free to ask me about details of Inspec/Test Kitchen usage, if you need any.
Hi,
when running Allure reports with rspec retry Tests may fail with identical screenshots causing added attachments to overwrite the previously attached file.
This is caused by using SHA256 for determining a file name for an attachment. It would be safer to use a different approach for generating unique attachment filenames like UUID.
I'll add a PR with the required changes.
title = opts[:title] || File.basename file
should be
title = opts[:title] || File.basename(file)
This is the similar issue as mentioned in here. I'm posting it again here as the other thread is closed.
It executes fine when I run the below code from Visual Studio Code with Ruby extension. It also generates the XML file. Below is the ruby code.
require 'aws-sdk'
require 'allure-ruby-adaptor-api'
require 'test/unit'
class StringTest < Test::Unit::TestCase
def test_length
s = "Hello, World!"
assert_equal(13, s.length)
end
end
builder = AllureRubyAdaptorApi::Builder
builder.start_suite "StringTest", :severity => :normal
builder.start_test "StringTest", "test_length", :severity => :critical
builder.stop_test "StringTest", "test_length", :status => :broken, :exception => Exception.new("some error")
builder.stop_suite "StringTest"
builder.build!
The XML looks like below. I've multiple questions here.
Why does the test status shows as broken in the XML below. Per the above code ":status => :broken", broken is supposed to be just the default value, but should be overwritten by the actual test result, in this case - Passed. Is it not right?
Why is there a failure message even though the test case passed?
When this XML is converted into the HTML report using Command Line, the HTML report is showing as 0 test cases. Why? Actually, when the allure report is generated from the below XML, using the command "allure generate --clean", all the json files generated under allure-report/data folder are empty like ""children" : [ ]". Please let me know what am I mising.
<?xml version="1.0"?>
<ns2:test-suite xmlns="" xmlns:ns2="urn:model.allure.qatools.yandex.ru" start="1505627368257" stop="1505627368257">
<name>StringTest</name>
<title>StringTest</title>
<test-cases>
<test-case start="1505627368257" stop="1505627368257" status="broken">
<name>test_length</name>
<title>test_length</title>
<failure>
<message>some error</message>
<stack-trace/>
</failure>
<steps/>
<attachments/>
<labels>
<label name="severity" value="critical"/>
<label name="thread" value="20044420"/>
<label name="host" value="GUNDE1"/>
</labels>
<parameters/>
</test-case>
</test-cases>
<labels>
<label name="severity" value="normal"/>
<label name="thread" value="20044420"/>
<label name="host" value="GUNDE1"/>
</labels>
</ns2:test-suite>
I'm using Allure 2.3.5 and allure-ruby-adaptor-api-0.7.0
Shouldn't the version number be updated for the change in logging level?
I would like to use the cucumber --retry
feature. Only thing that is required to publish in xml is to generate each retry result as one test-case
. Can you please guide me how to use the library so I can fork allure-cucumber and update
Failing to generate alllure reports. Trying out a basic example. Am I missing something here?
Sample test code
require 'test/unit'
require 'allure-ruby-adaptor-api'
class StringTest < Test::Unit::TestCase
def test_length
s = "Hello, World!"
assert_equal(13, s.length)
end
end
AllureRubyAdaptorApi.configure do |c|
c.output_dir = "/reports"
end
builder = AllureRubyAdaptorApi::Builder
builder.start_suite "StringTest", :severity => :normal
builder.stop_suite "StringTest"
builder.build!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.