# qali

> Create browser tests 10x faster (qawolf fork)

Latest version **1.3.22** (published 2021-06-14) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install qali
pnpm add qali
yarn add qali
bun add qali
```

Provides the command `qali`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.22 |
| Published | 2021-06-14 |
| First published | 2020-06-09 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.15.0 |
| Dependencies | 29 |
| Unpacked size | 5.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 4 |
| Maintainers | gen-codes, vkefallinos.grnet |

## Links

- npm: https://www.npmjs.com/package/qali
- Repository: https://github.com/gen-codes/qauto
- Homepage: https://github.com/gen-codes/qauto#readme
- Issues: https://github.com/gen-codes/qauto/issues
- npm.io page: https://npm.io/package/qali

## Dependencies (29)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [jest](https://npm.io/package/jest.md) ^26.6.3
- [open](https://npm.io/package/open.md) ^7.0.4
- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [debug](https://npm.io/package/debug.md) *
- [kleur](https://npm.io/package/kleur.md) ^3.0.3
- [rrweb](https://npm.io/package/rrweb.md) ^0.9.11
- [split](https://npm.io/package/split.md) ^1.0.1
- [tempy](https://npm.io/package/tempy.md) ^0.5.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [morgan](https://npm.io/package/morgan.md) ^1.10.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.4.0
- [inquirer](https://npm.io/package/inquirer.md) ^7.1.0
- [prettier](https://npm.io/package/prettier.md) ^2.0.5
- [callsites](https://npm.io/package/callsites.md) ^3.1.0
- [commander](https://npm.io/package/commander.md) ^5.1.0
- [playwright](https://npm.io/package/playwright.md) ^1.7.0
- [lodash.wrap](https://npm.io/package/lodash.wrap.md) ^4.1.1
- [await-outside](https://npm.io/package/await-outside.md) ^3.0.0
- [patch-package](https://npm.io/package/patch-package.md) ^6.2.2
- [playwright-ci](https://npm.io/package/playwright-ci.md) ^1.0.0
- [playwright-cli](https://npm.io/package/playwright-cli.md) ^0.170.0
- [playwright-core](https://npm.io/package/playwright-core.md) ^1.7.0
- [update-notifier](https://npm.io/package/update-notifier.md) ^4.1.0
- [jest-image-snapshot](https://npm.io/package/jest-image-snapshot.md) ^4.2.0
- [@qawolf/jest-reporter](https://npm.io/package/@qawolf/jest-reporter.md) ^0.1.0
- [postinstall-postinstall](https://npm.io/package/postinstall-postinstall.md) ^2.1.0
- [an-array-of-english-words](https://npm.io/package/an-array-of-english-words.md) ^2.0.0
- [@jperl/html-parse-stringify](https://npm.io/package/@jperl/html-parse-stringify.md) ^1.0.4

## Recent versions

- 1.3.22 (latest) — 2021-06-14
- 1.3.21 — 2021-02-18
- 1.3.20 — 2021-02-18
- 1.3.19 — 2021-02-18
- 1.3.18 — 2021-02-09
- 1.3.17 — 2021-02-09
- 1.3.16 — 2021-02-03
- 1.3.15 — 2021-02-03
- 1.3.14 — 2021-01-20
- 1.3.13 — 2021-01-20
- 1.3.10 — 2021-01-13
- 1.3.9 — 2020-12-22
- 1.3.8 — 2020-12-21
- 1.3.7 — 2020-12-21
- 1.3.6 — 2020-12-21
- … 42 more at https://npm.io/package/qali/versions

## README

# Qali

## 🐺 What is Qali?

Qali is a Node.js library for creating browser tests. Run one command (`npx qawolf init`) to configure your project and set up CI.

- **Skip writing boilerplate:** Your browser actions are converted to [Playwright](https://github.com/microsoft/playwright)/[Jest](https://jestjs.io) code.
- **Create stable tests:** Your tests automatically wait for elements. Element selectors use test attributes when possible, and CSS/text otherwise.
- **Edit your tests:** Edit your code as it is created and add steps to existing tests. Re-run your tests automatically with watch mode.
- **Debug with ease:** Each test can report full interactive replayable session with logs.

<br/>

## 🖥️ Install

<br />

Set up your project for browser tests:

```bash
cd /my/awesome/project
yarn create qali
```

Configure your test directory and CI provider:

```
? rootDir: Directory to create tests in (e2e)
```

This will install `qali`, `jest` and `playwright` as dev dependencies and create a [CI workflow file] to:

- 🐎 Run tests in parallel
- 📄 Create reports

<br/>

## 🎨 Create a test

<br />

```bash
yarn qali create http://example.com testName
```

A new browser page will be opened where you can record the test flow.
<br/>
Take screenshots with `ctrl/cmd + S`
<br/>
Check the existence a string in page with `ctrl/cmd+click`
<br/>
End the test by hitting Enter in the terminal that started the test recording
<br/>
Hints:
- try to do things slowly 
- click directly on text
- type slowly

## ✅ Run your tests

<br />

On Chromium:

```bash
yarn qali test [name]
```

On Firefox:

```bash
yarn qali test --firefox [name]
```

On Webkit:

```bash
yarn qali test --webkit [name]
```

On all browsers:

```bash
yarn qali test --all-browsers [name]
```

<br/>
Run the tests headlessly with 
`yarn qali test --headless`
<br/>
To mock api requests run
(This means that every request/response that is sent to backend 
is stored in a file and then replayed so there is no need to run a backend server)
```
yarn qali test --mock
```

To create a report for each test

```
yarn qali test --report
```
To add more logs to tests(eg server logs)

```
yarn qali test --report --more-logs logs.txt,server.logs

```

The logs must be in the form per line
```
    {
      "timestamp": 1608040047816,
      "method": "log",
      "data": [
        "%cbackend_dev      |%c INFO 2020-12-15 15:47:27,819 basehttp 36 139840204351232 \"GET /api/users/me/ HTTP/1.0\" 200 430\r",
        "color:rgb(0,153,102)",
        "color:rgb(-51,-153,-204)"
      ]
    }
```

To run the ci script:

```
npx qali-ci --url https://github.com/digigov/example --commit feature-qali-ci --qaliPath ui/e2e --report --prepareScript "cp backend-defaults.env backend-local.env" --port 80
```

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