# @iamkenos/hornet

> WebdriverIO that comes with presets and additional features

Latest version **0.3.0** (published 2022-12-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install @iamkenos/hornet
pnpm add @iamkenos/hornet
yarn add @iamkenos/hornet
bun add @iamkenos/hornet
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2022-12-20 |
| First published | 2022-05-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 24 |
| Unpacked size | 3.2 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | iamkenos |
| Maintainers | iamkenos |
| Keywords | webdriver, webdriverio, selenium, cucumber, bdd |

## Links

- npm: https://www.npmjs.com/package/@iamkenos/hornet
- Repository: https://github.com/iamkenos/hornet
- Homepage: https://github.com/iamkenos/hornet#readme
- Issues: https://github.com/iamkenos/hornet/issues
- npm.io page: https://npm.io/package/@iamkenos/hornet

## Dependencies (24)

- [luxon](https://npm.io/package/luxon.md) ^2.3.2
- [ts-node](https://npm.io/package/ts-node.md) ^10.7.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [jsonpath](https://npm.io/package/jsonpath.md) ^1.1.1
- [@wdio/cli](https://npm.io/package/@wdio/cli.md) ^7.19.6
- [callsites](https://npm.io/package/callsites.md) ^3.1.0
- [deep-diff](https://npm.io/package/deep-diff.md) ^1.0.2
- [@types/luxon](https://npm.io/package/@types/luxon.md) ^2.3.1
- [query-string](https://npm.io/package/query-string.md) ^7.1.1
- [tsconfig-paths](https://npm.io/package/tsconfig-paths.md) ^3.14.1
- [@types/jsonpath](https://npm.io/package/@types/jsonpath.md) ^0.2.0
- [@types/deep-diff](https://npm.io/package/@types/deep-diff.md) ^1.0.1
- [@wdio/local-runner](https://npm.io/package/@wdio/local-runner.md) ^7.19.5
- [allure-commandline](https://npm.io/package/allure-commandline.md) ^2.17.2
- [@wdio/spec-reporter](https://npm.io/package/@wdio/spec-reporter.md) ^7.19.5
- [@wdio/junit-reporter](https://npm.io/package/@wdio/junit-reporter.md) ^7.19.5
- [crypto-random-string](https://npm.io/package/crypto-random-string.md) ^3.3.1
- [@wdio/allure-reporter](https://npm.io/package/@wdio/allure-reporter.md) ^7.19.5
- [@wdio/devtools-service](https://npm.io/package/@wdio/devtools-service.md) ^7.19.6
- [wdio-intercept-service](https://npm.io/package/wdio-intercept-service.md) ^4.2.2
- [@wdio/cucumber-framework](https://npm.io/package/@wdio/cucumber-framework.md) ^7.19.5
- [@wdio/browserstack-service](https://npm.io/package/@wdio/browserstack-service.md) ^7.19.5
- [wdio-image-comparison-service](https://npm.io/package/wdio-image-comparison-service.md) ^3.1.1
- [@wdio/selenium-standalone-service](https://npm.io/package/@wdio/selenium-standalone-service.md) ^7.19.5

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2022-12-20
- 0.2.0 — 2022-06-04
- 0.1.2 — 2022-05-28
- 0.1.1 — 2022-05-28
- 0.1.0 — 2022-05-01
- 0.0.1 — 2022-05-01

## README

<!-- markdownlint-disable MD033 -->
<h1 align="center">HORNET</h1>

<p align="center">
  <a href="https://github.com/iamkenos/hornet/actions/workflows/unit-tests.yml">
      <img alt="Unit Tests" src="https://github.com/iamkenos/hornet/actions/workflows/unit-tests.yml/badge.svg">
  </a>
</p>

## About

[WebdriverIO](https://webdriver.io/) that comes with presets and additional features:

- write _**`async`**_ tests with [TypeScript](https://www.typescriptlang.org/docs/handbook/modules.html) and [Cucumber](https://cucumber.io/docs/guides/overview/)
- gherkin statements that can be used out of the box
- browser and elements expected conditions
- generic classes for page objects and custom webcomponents support
- multi-locale support
- internal polling and retries
- reporters:
  - [spec](https://webdriver.io/docs/spec-reporter/)
  - [junit](https://webdriver.io/docs/junit-reporter/)
  - [allure](https://webdriver.io/docs/allure-reporter/)
- services:
  - [devtools](https://webdriver.io/docs/devtools-service/)
  - [intercept](https://webdriver.io/docs/wdio-intercept-service/)
  - [selenium-standalone](https://webdriver.io/docs/selenium-standalone-service/)
  - [image-comparison](https://webdriver.io/docs/wdio-image-comparison-service/)

## Requirements

- NodeJS ≥ 16.3.0 or ≤ LTS
- JRE ≥ 8

## Get Started

You'll need a working knowledge of WebdriverIO to be able to use this library. They have rich documentation so head on over the site and read on if you're not familiar with it yet.

1. Get it: `npm install @iamkenos/hornet`

2. Create a `tsconfig.json` file:

   ```json
   {
     "compilerOptions": {
       "baseUrl": "./",
       "downlevelIteration": true,
       "esModuleInterop": true,
       "types": [
         "@wdio/cucumber-framework",
         "@wdio/selenium-standalone-service",
         "@wdio/browserstack-service",
         "@wdio/devtools-service",
         "wdio-intercept-service",
         "webdriverio/async",
         "@iamkenos/hornet",
         "node"
       ]
     },
     "include": ["./**/*.ts"]
   }
   ```

3. Create your WebdriverIO config file: `wdio.conf.ts`

   ```ts
   import { configure } from "@iamkenos/hornet/config";

   // you can set most of the wdio config props from here, leave some that are restricted.
   // e.g. the `framework` prop cannot be overriden as it's fixed to cucumber
   export const config = configure({
     baseUrl: "https://the-internet.herokuapp.com/"
   });
   ```

4. Create your page metadata files:

   ```ts
   // fixtures/app.meta.ts
   export default {
     default: {
       url: "/",
       title: "The Internet",
       selectors: {
         flash: "#flash"
       }
     }
   };

   // fixtures/login.meta.ts
   import merge from "lodash/merge";
   import app from "./app.meta";

   export default merge({}, app, {
     default: {
       url: "/login",
       selectors: {
         Username: "#username",
         Password: "#password",
         Login: "//button[@type='submit']"
       }
     }
   });

   // fixtures/secure.meta.ts
   import merge from "lodash/merge";
   import app from "./app.meta";

   export default merge({}, app, {
     default: {
       url: "/secure"
     }
   });
   ```

5. Create your feature file: `features/login.feature`

   ```gherkin
   Feature: Login

     Background:
       Given I am on the "login" page

     Scenario: S01: Login with valid credentials
       When I type on the fields:
         | Field    | Value                |
         | Username | tomsmith             |
         | Password | SuperSecretPassword! |
         And I click the "Login" button
       Then I expect to be on the "secure" page
         And I expect the "flash" element text to contain "You logged into a secure area!"

     Scenario: S02: Login with invalid credentials
       When I type on the fields:
         | Field    | Value  |
         | Username | foobar |
         | Password | barfoo |
         And I click the "Login" button
       Then I expect to still be on the "login" page
         And I expect the "flash" element text to contain "Your username is invalid!"
   ```

6. Run it: `npx wdio wdio.conf.ts`

7. Check the results: `npx allure open .reports/allure/html`

8. You can view other gherkin steps available out-of-the-box [here](./demo/test/features).

## Contribute

TODO

## Acknowledgements

Huge thanks to the [WebdriverIO team](https://github.com/webdriverio/webdriverio/blob/master/AUTHORS.md) for their awesome work!

## License

ISC

## TODO

- full api documentation
- other TODOs

---
_Source: https://npm.io/package/@iamkenos/hornet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
