Written in TypeScript, transpiled to JS for NPM packaging using Rollup
creates NPM package in /dist folder in ES, UMD, and CJS module formats
also publishes Typescript types and sourcemaps into NPM package
runs tests using Node and UVU
Configured for Node 14+ . To update, change base tsconfig from "extends": "@tsconfig/node14/tsconfig.json", update "engines" section in package.json, and update .node-version file
To set up the applause.json
config file for the WebdriverIO tests, follow these steps:
-
Create a new file named
applause.json
in the root directory of your project. -
Open the
applause.json
file and add the following JSON structure:
{
"apiKey": "API_KEY",
"productId": 0,
"applauseTestCycleId": 0,
"testRailOptions": {
"projectId": 0,
"suiteId": 0,
"planName": "Example Plan Name",
"runName": "Example Run Name"
}
}
The apiKey
and productId
settings are required for execution. The testRailOptions
and applauseTestCycleId
settings are optional.
- Save the
applause.json
file.
Now, when you run your WebdriverIO tests, they will be configured to use the settings specified in the applause.json
file.
To use the ApplauseRunService
and ApplauseResultService
in a WebdriverIO configuration file, follow these steps:
-
Install the
wdio-applause-reporter
package as a dev dependency by running the command:npm install wdio-applause-reporter --save-dev
. -
Import the
ApplauseRunService
andApplauseResultService
classes in your WebdriverIO configuration file:
import { ApplauseRunService, ApplauseResultService } frpom 'wdio-applause-reporter';
- Add the
ApplauseRunService
andApplauseResultService
to theservices
array in your WebdriverIO configuration file:
exports.config = {
// ... other configuration options
services: [
// ... other services
[ApplauseRunService, {}],
[ApplauseResultService, {}]
],
// ... other configuration options
};
- Run your WebdriverIO tests as usual. The
ApplauseRunService
will handle setting up the Applause TestRun theApplauseResultService
will handle the reporting.
To use the ApplausePlatformReporter
in the reporter section of a WebdriverIO configuration file, follow these steps:
-
Install the
wdio-applause-reporter
package as a dev dependency by running the command:npm install wdio-applause-reporter --save-dev
. -
Import the
ApplausePlatformReporter
class in your WebdriverIO configuration file:
import { ApplausePlatformReporter } from 'wdio-applause-reporter';
- Add the
ApplausePlatformReporter
to thereporters
array in your WebdriverIO configuration file:
exports.config = {
// ... other configuration options
reporters: [
// ... other reporters
[ApplausePlatformReporter, {}]
],
// ... other configuration options
};
- Run your WebdriverIO tests as usual. The
ApplausePlatformReporter
will handle reporting to the Applause Platform.
To insert a custom Winston logger into the ApplausePlatformReporter
, ApplauseRunService
, and ApplauseResultService
, you can follow these steps:
- Create a custom Winston logger configuration in your WebdriverIO configuration file. You can use the
winston
package to create and configure your logger. Here's an example:
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.simple(),
transports: [
new winston.transports.Console()
]
});
- Pass the custom logger to the respective services and reporter by adding the
logger
option to their configuration. Here's an example:
exports.config = {
// ... other configuration options
services: [
// ... other services
[ApplauseRunService, {
logger: logger
}],
[ApplauseResultService, {
logger: logger
}]
],
reporters: [
// ... other reporters
[ApplausePlatformReporter, {
logger: logger
}]
],
// ... other configuration options
};
By providing the logger
option with your custom logger, you can integrate it into the ApplausePlatformReporter
, ApplauseRunService
, and ApplauseResultService
for logging purposes.
To insert a custom Winston logger into the ApplausePlatformReporter
, ApplauseRunService
, and ApplauseResultService
, you can follow these steps:
- Create a custom Winston logger configuration in your WebdriverIO configuration file. You can use the
winston
package to create and configure your logger. Here's an example:
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.simple(),
transports: [
new winston.transports.Console(),
new ApplauseTransport(),
]
});
- Pass the custom logger to the respective services and reporter by adding the
logger
option to their configuration. Here's an example:
exports.config = {
// ... other configuration options
services: [
// ... other services
[ApplauseRunService, {
logger: logger
}],
[ApplauseResultService, {
logger: logger
}]
],
reporters: [
// ... other reporters
[ApplausePlatformReporter, {
logger: logger
}]
],
// ... other configuration options
};
By providing the logger
option with your custom logger, you can integrate it into the ApplausePlatformReporter
, ApplauseRunService
, and ApplauseResultService
for logging purposes.
Use yarn run all
. It will configure and run all the build steps
To set up the project, follow these steps:
- Clone the repository to your local machine.
- Navigate to the project directory:
/Users/rconner/src/wdio-applause-reporter/
. - Install the project dependencies by running the command:
yarn install
. - Build the project by running:
yarn build
. - Run the tests using:
yarn test
. - Clean the project by running:
yarn clean
. - Lint the code with:
yarn lint
.
Make sure you have Node.js 14+ installed and configured before proceeding with these steps.