allure-framework / allure-scalatest Goto Github PK
View Code? Open in Web Editor NEWDeprecated, use https://github.com/allure-framework/allure-java instead
License: Other
Deprecated, use https://github.com/allure-framework/allure-java instead
License: Other
Any plans for add compatibility with scalatest 2.11?
In my build.sbt
file i have both allure reporter and scalatest
reporter :
testOptions in Test ++= Seq(
Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports-xml"),
Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/test-reports-html"),
Tests.Argument(TestFrameworks.ScalaTest, "-oDWF"),
Tests.Argument(TestFrameworks.ScalaTest, "-C", "ru.yandex.qatools.allure.scalatest.AllureReporter"),
Tests.Filter(s => s.endsWith("TestSuite"))
)
When i run test, i get both reports and here's the difference. XML from allure-results
folder :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:test-suite start="1514473321489" stop="1514473338259" version="1.4.23" xmlns:ns2="urn:model.allure.qatools.yandex.ru">
<name>com.vimpelcom.ep.api.test.idm.regression.authentication.LoginTestSuite</name>
<test-cases>
<test-case start="1514473321519" stop="1514473332992" status="passed">
<name>POST int-uat.buttonhub.com/authenticate?response_type=token+refresh_token for 999126930274</name>
<steps/>
<attachments/>
<labels>
<label name="host" value="azakordonets.local"/>
<label name="thread" value="[email protected](218)"/>
</labels>
</test-case>
<test-case start="1514473333044" stop="1514473338221" status="passed">
<name>POST int-uat.buttonhub.com/authenticate?response_type=token+refresh_token for 999126930274 with invalid password.</name>
<steps/>
<attachments/>
<labels>
<label name="host" value="azakordonets.local"/>
<label name="thread" value="[email protected](218)"/>
</labels>
</test-case>
</test-cases>
<labels>
<label name="language" value="JAVA"/>
</labels>
</ns2:test-suite>
And this is a xml from scalatest reporter :
...
</properties>
<testcase
name="POST int-uat.buttonhub.com/authenticate?response_type=token+refresh_token for 999126930274" classname="com.vimpelcom.ep.api.test.idm.regression.authentication.LoginTestSuite" time="11.481">
</testcase>
<testcase
name="POST int-uat.buttonhub.com/authenticate?response_type=token+refresh_token for 999126930274 with invalid password." classname="com.vimpelcom.ep.api.test.idm.regression.authentication.LoginTestSuite" time="5.222">
</testcase>
<testcase
name="POST int-uat.buttonhub.com/authenticate?response_type=token+refresh_token for 999126930274 with invalid state. JIRA BUG: https://vimpelcomdigital.atlassian.net/browse/IDM-1091" classname="com.vimpelcom.ep.api.test.idm.regression.authentication.LoginTestSuite" time="0.0">
<skipped/>
</testcase>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
As you can see, scalatest
report has ignored test included, while allure
report doesn't .
Allure report from allure-results
looks like this :
While when i generate allure report from scalatest
xml report i get this picture :
I have added simple test that always fails
As a result i got
[info] Run completed in 344 milliseconds.
[info] Total number of tests run: 3
[info] Suites: completed 2, aborted 0
[info] Tests: succeeded 2, failed 1, canceled 0, ignored 0, pending 0
[info] *** 1 TEST FAILED ***
and
...
</test-case>
<test-case start="1424395967702" stop="1424395967702" status="passed">
<name>A Stack should throw NoSuchElementException if an empty stack is popped</name>
<failure>
<message>TestFailedException: 42</message>
<stack-trace>org.scalatest.exceptions.TestFailedException: 42
...
in target/allure-report/*.xml
*Everything is ok when everything fails
In my spec i have two failures with names 'aa' and 'bb', but in report i've got two failures with name "bb":
Hi,
Each test reported by Allure Scalatest has default severity NORMAL. I'm trying to change severity using standard Allure Annotation:
Severity(SeverityLevel.CRITICAL)
@Title("Some test")
@Features(Array("Some feature"))
@Stories(Array("Some Story"))
class TestSomeFeature extends FlatSpec with BrowserSetupTeardown
{
//...
}
As a result, NORMAL , not CRITICAL as expected.
Is there any method to set test severity in Allure Scalatest? If no, is it possibility to implement it?
Thanks.
vania-pooh:/src/testing/allure-scalatest-example$ sbt test
[warn] The global sbt directory is now versioned and is located at /Users/vania-pooh/.sbt/0.13.
[warn] You are seeing this warning because there is global configuration in /Users/vania-pooh/.sbt but not in /Users/vania-pooh/.sbt/0.13.
[warn] The global sbt directory may be changed via the sbt.global.base system property.
[info] Loading project definition from /Users/vania-pooh/src/testing/allure-scalatest-example/project
[info] Set current project to Allure ScalaTest Example (in build file:/Users/vania-pooh/src/testing/allure-scalatest-example/)
[info] Compiling 1 Scala source to /Users/vania-pooh/src/testing/allure-scalatest-example/target/scala-2.10/test-classes...
[info] StackSpec:
[info] A Stack
[info] - should pop values in last-in-first-out order (18 milliseconds)
[info] - should throw NoSuchElementException if an empty stack is popped (3 milliseconds)
Reporter completed abruptly with an exception after receiving event: SuiteCompleted(Ordinal(0, 8),StackSpec,ru.yandex.qatools.allure.scalatest.StackSpec,Some(ru.yandex.qatools.allure.scalatest.StackSpec),Some(92),Some(MotionToSuppress),Some(TopOfClass(ru.yandex.qatools.allure.scalatest.StackSpec)),None,None,pool-4-thread-5,1401375701313).
ru.yandex.qatools.allure.exceptions.AllureException: Can't marshall test suite result
at ru.yandex.qatools.allure.utils.AllureResultsUtils.writeTestSuiteResult(AllureResultsUtils.java:75)
at ru.yandex.qatools.allure.Allure.fire(Allure.java:106)
at ru.yandex.qatools.allure.scalatest.AllureReporter.testSuiteFinished(AllureReporter.scala:70)
at ru.yandex.qatools.allure.scalatest.AllureReporter.apply(AllureReporter.scala:42)
at org.scalatest.DispatchReporter$Propagator$$anonfun$run$1.apply(DispatchReporter.scala:240)
at org.scalatest.DispatchReporter$Propagator$$anonfun$run$1.apply(DispatchReporter.scala:239)
at scala.collection.immutable.List.foreach(List.scala:318)
at org.scalatest.DispatchReporter$Propagator.run(DispatchReporter.scala:239)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.xml.bind.PropertyException: name: com.sun.xml.bind.marshaller.CharacterEscapeHandler value: ru.yandex.qatools.allure.utils.XmlEscapeHandler@4cc9301c
at javax.xml.bind.helpers.AbstractMarshallerImpl.setProperty(AbstractMarshallerImpl.java:358)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.setProperty(MarshallerImpl.java:527)
at ru.yandex.qatools.allure.utils.AllureResultsUtils.writeTestSuiteResult(AllureResultsUtils.java:69)
... 8 more
[info] Run completed in 340 milliseconds.
[info] Total number of tests run: 2
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 6 s, completed May 29, 2014 7:01:41 PM
I am running into this issue where at the end of test execution, sbt just hangs with no reports generated. Anyone else running into this or any pointers to help resolve this?
Some details from my build.sbt for reference.
scalaVersion := "2.10.4" libraryDependencies ++= Seq( "com.github.scopt" %% "scopt" % "3.3.0" excludeAll ( ExclusionRule(organization = "asm") ), "org.json4s" %% "json4s-jackson" % "3.2.7" excludeAll ( ExclusionRule(organization = "asm") ), "org.apache.hadoop" % "hadoop-core" % "1.2.1" excludeAll ( ExclusionRule(organization = "asm") ), "org.apache.hive" % "hive-jdbc" % "0.12.0-cdh5.0.0" excludeAll( ExclusionRule(organization = "asm") ), "org.scalatest" %% "scalatest" % "2.2.5" % "test->*" excludeAll ( ExclusionRule(organization="org.junit", name="junit"), ExclusionRule(organization = "asm") ), "org.slf4j" % "slf4j-log4j12" % "1.6.2" excludeAll ( ExclusionRule(organization = "asm") ), "ru.yandex.qatools.allure" % "allure-scalatest_2.10" % "1.4.0-SNAPSHOT" % "test", "asm" % "asm-all" % "3.1" force() ) fork in Test := false parallelExecution in ThisBuild := false resolvers ++= Seq( "Ooyala Nexus Releases" at "http://nexus.ooyala.com/nexus/content/repositories/releases/", "Ooyala Nexus Snapshots" at "http://nexus.ooyala.com/nexus/content/repositories/snapshots/", "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", "Ooyala Nexus Public" at "http://nexus.ooyala.com/nexus/content/groups/public/" ) testOptions in Test ++= Seq( Tests.Argument(TestFrameworks.ScalaTest, "-oD"), Tests.Argument(TestFrameworks.ScalaTest, "-C", "ru.yandex.qatools.allure.scalatest.AllureReporter") )
Hi. We have a number of projects with different API tests. This tests can re-use some common API clients for their purposes. We managed to add allure tests for this projects, however we would like to log and include http calls/responces into the report. I tried to do next :
trait AllureLogger extends LazyLogging {
@Step("{0}")
def debugLog(stepDescription: String, attachmentText: String = null): Unit = {
logger.debug(s"$stepDescription $attachmentText")
if (attachmentText != null) attachMessage(attachmentText)
}
@Attachment
def attachMessage(message: String): String = {
message
}
}
I use debugLog
in our tests, but when i try to generate report, i only see errors and not logged information inside the reported test.
Any tips on how to achieve this ?
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.