Spock Manual Extension

An extension to mark certain tests as to be done manual for the Spock Framework (see http://spockframework.org/).

License

License

Categories

Categories

Spock Application Testing & Monitoring
GroupId

GroupId

de.assertagile.spockframework.extensions
ArtifactId

ArtifactId

spock-manual-extension
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

Spock Manual Extension
An extension to mark certain tests as to be done manual for the Spock Framework (see http://spockframework.org/).
Project URL

Project URL

https://github.com/mkutz/spock-manual-extension
Source Code Management

Source Code Management

https://github.com/mkutz/spock-manual-extension

Download spock-manual-extension

How to add to project

<!-- https://jarcasting.com/artifacts/de.assertagile.spockframework.extensions/spock-manual-extension/ -->
<dependency>
    <groupId>de.assertagile.spockframework.extensions</groupId>
    <artifactId>spock-manual-extension</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/de.assertagile.spockframework.extensions/spock-manual-extension/
implementation 'de.assertagile.spockframework.extensions:spock-manual-extension:1.2.1'
// https://jarcasting.com/artifacts/de.assertagile.spockframework.extensions/spock-manual-extension/
implementation ("de.assertagile.spockframework.extensions:spock-manual-extension:1.2.1")
'de.assertagile.spockframework.extensions:spock-manual-extension:jar:1.2.1'
<dependency org="de.assertagile.spockframework.extensions" name="spock-manual-extension" rev="1.2.1">
  <artifact name="spock-manual-extension" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.assertagile.spockframework.extensions', module='spock-manual-extension', version='1.2.1')
)
libraryDependencies += "de.assertagile.spockframework.extensions" % "spock-manual-extension" % "1.2.1"
[de.assertagile.spockframework.extensions/spock-manual-extension "1.2.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.codehaus.groovy : groovy-all jar 2.3.9
org.spockframework : spock-core jar 1.0-groovy-2.3
cglib : cglib jar 3.1
org.objenesis : objenesis jar 2.1

Project Modules

There are no modules declared in this project.

Spock Manual Extension

Build Status Coverage Status Maven Central

Extension to define manual test case specification using the Spock framwork.

When executing a Specification marked @Manual the test will be set "ignored" and the block comments will be written to a test plan file.

Example

Given this Specification

package de.assertagile.spockframework.extensions.demonstration

import de.assertagile.spockframework.extensions.Manual
import spock.lang.Issue
import spock.lang.Specification
import spock.lang.Title

@Manual
@Title("My manual spec is manual")
@Issue("STY-4711")
class MyManualSpec extends Specification {

    @Issue("http://assertagile.de/issues/BUG-42")
    def "this is a manual tested feature description"() {
        given: "the user is logged in"
        when: "the user clicks the logout button"
        then: "the user is at the start page"
        and: "the login button is visible"
    }

    @Issue(["http://assertagile.de/issues/STY-4712", "http://assertagile.de/issues/BUG-666", "http://issues.com/4711"])
    def "this is a manual tested feature description with additional information"() {
        given: "the user is not logged in"
        when: "the user enters unknown credentials"
        then: "the user stayed at the start page"
        and: "the login button is visible"
    }
}

and the following SpockManualConfig.groovy file:

import de.assertagile.spockframework.extensions.MarkDownTestPlanBuilder

Locale locale = Locale.ENGLISH
String issueTrackerBaseUrl = "http://assertagile.de/issues"
boolean markManualTestsAsExcluded = true

testPlanBuilders = [
    new MarkDownTestPlanBuilder("target/test_plan.md", issueTrackerBaseUrl, locale),
    new CsvTestPlanBuilder("target/test_plan.csv", issueTrackerBaseUrl, locale)
]

When executing the Specification in your IDE or via mvn test you will find the following test plan at target/test_plan.md:

#Manual Test Plan

##My manual spec is manual
[STY-4711](http://assertagile.de/issues/STY-4711)

###this is a manual tested feature description
[BUG-42](http://assertagile.de/issues/BUG-42)

- *Given* the user is logged in
- *When* the user clicks the logout button
- *Then* the user is at the start page
- *And* the login button is visible


###this is a manual tested feature description with additional information
[STY-4712](http://assertagile.de/issues/STY-4712), [BUG-666](http://assertagile.de/issues/BUG-666), [http://issues.com/4711](http://issues.com/4711)

- *Given* the user is not logged in
- *When* the user enters unknown credentials
- *Then* the user stayed at the start page
- *And* the login button is visible

and one more at target/test_plan.csv

"specification";"feature";"steps";"issues"
"My manual spec is manual";"this is a manual tested feature description";"Given the user is logged in
When the user clicks the logout button
Then the user is at the start page
And the login button is visible";"STY-4711 (http://assertagile.de/issues/STY-4711)
BUG-42 (http://assertagile.de/issues/BUG-42)"
"My manual spec is manual";"this is a manual tested feature description with additional information";"Given the user is not logged in
When the user enters unknown credentials
Then the user stayed at the start page
And the login button is visible";"STY-4711 (http://assertagile.de/issues/STY-4711)
STY-4712 (http://assertagile.de/issues/STY-4712), BUG-666 (http://assertagile.de/issues/BUG-666), http://issues.com/4711 (http://issues.com/4711)"

Usage

To use this extension you need to create a Groovy config script in you projects test resources path named SpockManualConfig.groovy. In default Maven projects the file should be located in src/test/resources. In order to generate a test plan, you need to configure at least one TestPlanBuilder.

Extension

Currently there is only MarkDownTestPlanBuilder and CsvTestPlanBuilder, but you can always create more. Just extend TestPlanBuilder and add it to your SpockManualConfig.groovy

Versions

Version
1.2.1
1.2
1.1