0.2.8 • Published 3 years ago
supertest-allure-step-helper v0.2.8
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