supertest-allure-step-helper
v0.2.8
Published
allure helper for supertest
Downloads
61
Maintainers
Readme
supertest-allure-step-helper
Introduce
turns the calls of supertest
to allure.createStep()
Install
$ npm i -D supertest-allure-step-helper
Usage
const HOST = 'https://github.com';
const toPath = '/RickyLi79';
const query = { tab: 'repositories', 'type': 'public' };
@test('expect `success`')
public async test1() {
const supertestAgent = supertest.agent(HOST);
const agent = AllureStepProxy.create(supertestAgent); // create
await agent
.stepName('visit') // optional, add by `supertest-allure-step-helper`
.get(toPath)
.query(query)
.expect(200)
.expectHeader('server', 'GitHub.com') // not a `supertest` function, add by `supertest-allure-step-helper`
.endAllureStep(); // this MUST be called at finnal
}
Demo Screenshot
Example
./allure.test/example.allure.ts
Example Report HTML
- https://rickyli79.github.io/testing-reports/supertest-allure-step-helper/allure-report/
- https://rickyli79.gitee.io/testing-reports/supertest-allure-step-helper/allure-report/