net.oneandone.spock:order-extension

Parent POM for 1-and-1 open source projects. Defines often used dependencies and plugins.

Лицензия

Лицензия

Категории

Категории

Spock Тестирование приложения и мониторинг Сеть
Группа

Группа

net.oneandone.spock
Идентификатор

Идентификатор

order-extension
Последняя версия

Последняя версия

0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Parent POM for 1-and-1 open source projects. Defines often used dependencies and plugins.
Ссылка на сайт

Ссылка на сайт

https://github.com/1and1/spock-order-extension
Организация-разработчик

Организация-разработчик

1&1
Система контроля версий

Система контроля версий

https://github.com/1and1/spock-order-extension/

Скачать order-extension

Как подключить последнюю версию

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.spockframework : spock-core jar 1.3-groovy-2.5
junit : junit jar 4.12

test (1)

Идентификатор библиотеки Тип Версия
org.jetbrains : annotations jar RELEASE

Модули Проекта

Данный проект не имеет модулей.

Spock Order Extension

This extension gives the opportunity to define the order between specs and its parent.

Like @Stepwise it ensures a defined execution order and skipps all the following features if a feature fails.

Unlike @Stepwise it effects the complete hierarchy and lets you modify the execution order.

Reasons to use this extension
  • you want to start your test with a feature of the child spec

  • you want to skip features of your base spec

Usage

Add dependency

pom.xml
<dependencies>
    <dependency>
        <groupId>net.oneandone.spock</groupId>
        <artifactId>order-extension</artifactId>
        <version>0.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

Annotate your spec with @Order and define order with annotations: @After and @Before.

OrderExtensionFullExampleTest
@Order(skip = 'base 5')
class OrderExtensionFullExampleTest extends Base {
    @After("base 1")
    def "child 1"() {
        expect: true
    }

    def "child 2"() {
        expect: true
    }

    @Before("base 2")
    def "child 3"() {
        expect: true
    }

    @After("base 3") @Before("base 4")
    def "child 4"() {
        expect: true
    }
}

class Base extends Specification {
    def "base 1"() {
        expect: true
    }

    def "base 2"() {
        expect: true
    }

    def "base 3"() {
        expect: true
    }

    def "base 4"() {
        expect: true
    }

    def "base 5"() {
        expect: true
    }
}

This gives the following execution order:

  • base 1

  • child 1 @After("base 1")

  • child 2 after step1 due to declaration order

  • child 3 @Before("base 2")

  • base 2

  • base 3 after base2 due to declaration order

  • child 4 @After("base 3") @Before("base 4")

  • base 4

  • base 5 (skipped) @Order(skip = 'base 5')

Hints

  • Features which are not annotated are executed in declaration order

  • If @After does not point to the last base feature it must be followed by @Before, so that it’s clear when to continue the execution with the base features.

net.oneandone.spock

1&1

Open Source by 1&1 Group.

Версии библиотеки

Версия
0.1