Coder Social home page Coder Social logo

allure-scalatest's People

Contributors

azakordonets avatar baev avatar eroshenkoam avatar nikolajscmihuns avatar qameta-ci avatar roberth-k avatar vania-pooh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

allure-scalatest's Issues

Ignored test cases are not shown in allure report

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 :
screenshot 2017-12-28 19 20 13

While when i generate allure report from scalatest xml report i get this picture :
screenshot 2017-12-28 19 21 28

Strange behaviour with partial fail

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

Cannot change test severity

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.

An exception in test project

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

SBT hangs at the enf of test with no report generation

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") )

How to use @Step annotation together with allure-scalatest in multi libraries project

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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.