allure-framework / allure-js-commons

Deprecated, use https://github.com/allure-framework/allure-js instead
Other
27 stars 40 forks source link

Реализация добавления степов и аттачей #1

Closed d0lfin closed 9 years ago

d0lfin commented 9 years ago

В коде выглядит как-то вот так:

{
    shouldSeeElement: allure.createStep('Проверяем наличие элемента на странице', function (element) {
        element.should.not.equal(undefined);
    }),
    getScreenshot: allure.createAttachment('Снимок экрана', function() {
        var bytes = driver.getScreenshotAs(wd.OutputType.BYTES);
        return new Buffer(bytes);
    }),
    getPageSource: allure.createAttachment('Содержимое страницы', function() {
        var source = driver.getPageSource();
        return new Buffer(source);
    }, 'text/html')
}