All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.qatools.allure.data.plugins.MigrationPlugin.groovy Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
package ru.yandex.qatools.allure.data.plugins

import ru.yandex.qatools.allure.model.Status
import ru.yandex.qatools.allure.model.TestCaseResult

import static ru.yandex.qatools.allure.config.AllureModelUtils.createSeverityLabel

/**
 * eroshenkoam 
 * 25/02/15
 */
class MigrationPlugin implements PreparePlugin {

    @Override
    void prepare(TestCaseResult data) {
        migrateSeverityFieldToLabel(data)
        migrateSkippedStatusToCanceled(data)
    }

    @Override
    Class getType() {
        TestCaseResult
    }

    static void migrateSkippedStatusToCanceled(TestCaseResult data) {
        if (data.status.equals(Status.SKIPPED)) {
            data.status = Status.CANCELED;
        }
    }

    static void migrateSeverityFieldToLabel(TestCaseResult data) {
        if (data.severity) {
            data.labels.add(createSeverityLabel(data.severity))
            data.severity = null
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy