codeceptjs 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,7 @@
12
12
  | 🌐 Web | WebDriver | [![WebDriver Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml) |
13
13
  | 🌐 Web | Obscura | [![Obscura Helper Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/obscura.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/obscura.yml) |
14
14
  | 🌐 Web | Lightpanda | [![Lightpanda Helper Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/lightpanda.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/lightpanda.yml) |
15
+ | 🌐 Web | Moli | [![Moli Helper Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/moli.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/moli.yml) |
15
16
  | 📱 Mobile | Appium | [![Appium Tests - Android](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium_Android.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium_Android.yml) |
16
17
 
17
18
  # CodeceptJS [![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)
@@ -46,6 +47,7 @@ CodeceptJS uses **Helper** modules to provide actions to `I` object. Currently,
46
47
  - [**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver or Devtools protocol.
47
48
  - [**Obscura**](https://codecept.io/helpers/Obscura) - drives the lightweight Obscura browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers).
48
49
  - [**Lightpanda**](https://codecept.io/helpers/Lightpanda) - drives the Lightpanda headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers).
50
+ - [**Moli**](https://codecept.io/helpers/Moli) - drives the Moli headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers).
49
51
  - [**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium
50
52
  - [**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps.
51
53
 
@@ -6,7 +6,7 @@ title: Alternative Browser Engines
6
6
  # Alternative Browser Engines
7
7
 
8
8
  ::: warning Experimental
9
- The `Obscura`, `Lightpanda` and `Kitesurf` helpers are experimental. Keep a Playwright or WebDriver job for compatibility-critical tests.
9
+ The `Obscura`, `Lightpanda`, `Moli` and `Kitesurf` helpers are experimental. Keep a Playwright or WebDriver job for compatibility-critical tests.
10
10
  :::
11
11
 
12
12
  Playwright drives full Chromium, Firefox and WebKit: the most accurate way to test what users see, at the cost of a heavy browser per worker. Alternative engines trade part of that accuracy for speed, a small footprint, or cloud scale. They are a good fit for functional tests (text appears, form submits, redirect happens, cookie is set) and a poor one for anything visual.
@@ -143,6 +143,61 @@ Lightpanda: {
143
143
 
144
144
  All options: [Lightpanda helper reference](/helpers/Lightpanda).
145
145
 
146
+ ## Moli
147
+
148
+ [Moli](https://github.com/lexmount/moli) is an open-source headless browser built in Rust for automation. It runs your app's JavaScript in V8 and computes real CSS, but skips layout and painting, so it starts fast and stays small. Visibility checks such as `seeElement` and `waitForVisible` work.
149
+
150
+ Limitations:
151
+
152
+ - No screenshots: `saveScreenshot`, failure screenshots and the `screencast` plugin do not work.
153
+ - `clickXY` does not work.
154
+ - `attachFile` uploads files without a MIME type; the server receives `application/octet-stream`.
155
+ - Links have no default color: `a` computes `color: rgb(0, 0, 0)`.
156
+
157
+ ### Setup
158
+
159
+ Install Moli following the [official instructions](https://github.com/lexmount/moli#direct-installation) and put `moli` on `PATH`. Then enable the helper:
160
+
161
+ ```js
162
+ // codecept.conf.js
163
+ export const config = {
164
+ helpers: {
165
+ Moli: {
166
+ url: 'http://localhost:3000',
167
+ },
168
+ },
169
+ }
170
+ ```
171
+
172
+ If the binary is not on `PATH`, set `binaryPath` in the config or the `MOLI_PATH` environment variable.
173
+
174
+ ### Usage
175
+
176
+ ```sh
177
+ npx codeceptjs run
178
+ ```
179
+
180
+ The helper starts `moli serve` on a free port before the first test and stops it after the last one. Each worker gets its own instance:
181
+
182
+ ```sh
183
+ npx codeceptjs run-workers 8
184
+ ```
185
+
186
+ To connect to a Moli you started yourself, set `endpoint`; the helper then never starts or stops it:
187
+
188
+ ```sh
189
+ moli serve --host 127.0.0.1 --port 9222
190
+ ```
191
+
192
+ ```js
193
+ Moli: {
194
+ url: 'http://localhost:3000',
195
+ endpoint: 'http://127.0.0.1:9222',
196
+ }
197
+ ```
198
+
199
+ All options: [Moli helper reference](/helpers/Moli).
200
+
146
201
  ## Kitesurf
147
202
 
148
203
  [Kitesurf](https://blog.cloudflare.com/kitesurf/) is Cloudflare's browser running on Cloudflare Workers, with a real layout and rendering pipeline. Sessions start in about a second and nothing runs on your machine, so the number of parallel browsers is limited only by how far your suite splits.