You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Selenoid plugin](/plugins#selenoid) added by by @koushikmohan1996
7
+
* uses Selenoid to launch browsers inside Docker containers
8
+
* automatically **records videos** and attaches them to allure reports
9
+
* can delete videos for successful tests
10
+
* can automatically pull in and start Selenoid containers
11
+
* works with WebDriver helper
12
+
* Avoid failiure report on successful retry in worker by @koushikmohan1996
13
+
* Added translation ability to Scenario, Feature and other context methods by @koushikmohan1996
14
+
* 📢 Please help us translate context methods to your language! See [italian translation](https://github.com/Codeception/CodeceptJS/blob/master/translations/it-IT.js#L3) as an example and send [patches to vocabularies](https://github.com/Codeception/CodeceptJS/tree/master/translations).
15
+
* allurePlugin: Added `say` comments to allure reports by @PeterNgTr.
16
+
* Fixed no custom output folder created when executed with run-worker. Fix by @PeterNgTr
17
+
*[Puppeteer] Fixed error description for context element not found. See #2065. Fix by @PeterNgTr
18
+
19
+
1
20
## 2.4.1
2
21
3
22
*[Hotfix] - Add missing lib that prevents codeceptjs from initializing.
Copy file name to clipboardExpand all lines: docs/plugins.md
+135-8Lines changed: 135 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -531,9 +531,124 @@ Possible config options:
531
531
532
532
- `config`
533
533
534
+
## selenoid
535
+
536
+
[Selenoid][8] plugin automatically starts browsers and video recording.
537
+
Works with WebDriver helper.
538
+
539
+
### Prerequisite
540
+
541
+
This plugin **requires Docker** to be installed.
542
+
543
+
> If you have issues starting Selenoid with this plugin consider using official [Configuration Manager][9] tool from Selenoid
544
+
545
+
### Usage
546
+
547
+
Selenoid plugin can be started in two ways:
548
+
549
+
1. **Automatic** - this plugin will create and manage selenoid container for you.
550
+
2. **Manual** - you create the conatainer and configure it with a plugin (recommended).
551
+
552
+
#### Automatic
553
+
554
+
If you are new to Selenoid and you want plug and play setup use automatic mode.
555
+
556
+
Add plugin configuration in `codecept.conf.js`:
557
+
558
+
```js
559
+
plugins: {
560
+
selenoid: {
561
+
enabled:true,
562
+
deletePassed:true,
563
+
autoCreate:true,
564
+
autoStart:true,
565
+
sessionTimeout:'30m',
566
+
enableVideo:true,
567
+
enableLog:true,
568
+
},
569
+
}
570
+
```
571
+
572
+
When `autoCreate` is enabled it will pull the [latest Selenoid from DockerHub][10] and start Selenoid automatically.
573
+
It will also create `browsers.json` file required by Selenoid.
574
+
575
+
In automatic mode the latest version of browser will be used for tests. It is recommended to specify exact version of each browser inside `browsers.json` file.
576
+
577
+
> **If you are using Windows machine or if `autoCreate` does not work properly, create container manually**
578
+
579
+
#### Manual
580
+
581
+
While this plugin can create containers for you for better control it is recommended to create and launch containers manually.
582
+
This is especially useful for Continous Integration server as you can configure scaling for Selenoid containers.
583
+
584
+
> Use [Selenoid Configuration Manager][9] to create and start containers semi-automatically.
585
+
586
+
1. Create `browsers.json` file in the same directory `codecept.conf.js` is located
587
+
[Refer to Selenoid documentation][11] to know more about browsers.json.
588
+
589
+
_Sample browsers.json_
590
+
591
+
```js
592
+
{
593
+
"chrome": {
594
+
"default":"latest",
595
+
"versions": {
596
+
"latest": {
597
+
"image":"selenoid/chrome:latest",
598
+
"port":"4444",
599
+
"path":"/"
600
+
}
601
+
}
602
+
}
603
+
}
604
+
```
605
+
606
+
> It is recommended to use specific versions of browsers in `browsers.json` instead of latest. This will prevent tests fail when browsers will be updated.
607
+
608
+
2. Create Selenoid container
609
+
610
+
Run the following command to create a container. To know more [refer here][12]
Copy file name to clipboardExpand all lines: docs/puppeteer.md
-45Lines changed: 0 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,51 +247,6 @@ npx codeceptjs def
247
247
Mocking rules will be kept while a test is running. To stop mocking use `I.stopMocking()` command
248
248
249
249
250
-
## Cloud Browsers
251
-
252
-
Puppeteer browser can be executed locally or remotely.
253
-
If you want to run your tests in parallel you may face problem of maintaining infrastructure for Puppeteer tests.
254
-
255
-
That's why we recommend using [Aerokube Browsers](https://browsers.aerokube.com) as a fast cloud provider for browsers. At this moment, this is the only cloud provider that can launch multiple puppeteer sessions for you.
256
-
257
-
To start with Aerokube Browsers you need to register at [Aerokube Browsers](https://browsers.aerokube.com) and obtain a private key. Then install `aerokube-plugin`:
258
-
259
-
```
260
-
npm i @codeceptjs/aerokube-plugin --save-dev
261
-
```
262
-
263
-
And add this plugin to a config. Please provide Aerokube credentials in configuration:
264
-
265
-
```js
266
-
// codecept.conf.js config
267
-
exports.config= {
268
-
helpers: {
269
-
Puppeteer: {
270
-
// regular Puppeteer config goes here
271
-
// no need to change anything here
272
-
}
273
-
},
274
-
// ....
275
-
plugins: {
276
-
aerokube: {
277
-
// uncomment next line to permanently enable this plugin
278
-
// enabled: true,
279
-
require:'@codeceptjs/aerokube-plugin',
280
-
user:'<username from aerokube>',
281
-
password:'<password from aerokube>',
282
-
}
283
-
}
284
-
}
285
-
```
286
-
287
-
To launch tests and use Aerokube Browsers enable `aerokube` plugin from a command line:
288
-
289
-
```
290
-
npx codeceptjs run --plugins aerokube
291
-
```
292
-
293
-
> ℹ When running a browser from Aerokube it can't access your local environment or private networks. Consider using [Selenoid or Moon](https://aerokube.com) to set up a private browsers cloud.
294
-
295
250
## Extending
296
251
297
252
Puppeteer has a very [rich and flexible API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md). Sure, you can extend your test suites to use the methods listed there. CodeceptJS already prepares some objects for you and you can use them from your you helpers.
0 commit comments