Skip to content

RickyLi79/supertest-allure-step-helper

Repository files navigation

supertest-allure-step-helper

NPM version npm download

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

Image Image

Example

./allure.test/example.allure.ts

Example Report HTML

About

turns the calls of `supertest` to `allure.createStep()`

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published