2.1.0 • Published 11 months ago

@marcelo.eliseu/cucumber-support v2.1.0

Weekly downloads
-
License
unlicensed
Repository
-
Last release
11 months ago

@inshur/cucumber-support

Inshur's implementation of a support libs for cucumber.js test consumers.

Usage

mongoDB

Use cucumber hook before or after all scenarios for mongoDB connection.

BeforeAll(async function () {
  await mongodbService.connectToDatabase();
});

AfterAll(async function () {
  await mongodbService.closeDBConnections();
});

auth0Service

Token for internal service, configure the environment for docker:

  AUTH0_INTERNAL_AUTOMATED_TEST_URL=https://inshur-dev0-internal.eu.auth0.com/oauth/token
  AUTH0_INTERNAL_AUTOMATED_TEST_CLIENT_ID=<client_id>
  AUTH0_INTERNAL_AUTOMATED_TEST_CLIENT_SECRET=<client_secrect>
      let response = await auth0Service.token();
      let access_token = response.data.access_token;
      ...

use token on axios

  const apiClient: AxiosInstance = axios.create({
      baseURL: process.env.SERVICE_URL,
      withCredentials: true,
      headers: {
        'Content-type': 'application/json',
        Accept: '*/*'
      },
    })
  ...
  apiClient.defaults.headers.common = {'Authorization': `Bearer ${access_token}`}

2.1.0

11 months ago

1.9.0

11 months ago

1.8.0

11 months ago

1.7.0

11 months ago

1.6.0

11 months ago

1.5.0

11 months ago

1.4.0

11 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago