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
Copy file name to clipboardExpand all lines: docs/configuration.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ After running `codeceptjs init` it should be saved in test root.
11
11
12
12
Here is an overview of available options with their defaults:
13
13
14
-
***tests**: `"./*_test.js"` - pattern to locate tests. Allows to enter [glob pattern](https://github.com/isaacs/node-glob).
14
+
***tests**: `"./*_test.js"` - pattern to locate tests. Allows to enter [glob pattern](https://github.com/isaacs/node-glob), Can either be a pattern to locate tests or an array of patterns to locate tests / test file names.
15
15
***grep**: - pattern to filter tests by name
16
16
***include**: `{}` - actors and page objects to be registered in DI container and included in tests. Accepts objects and module `require` paths
17
17
***timeout**: `10000` - default tests timeout
@@ -47,7 +47,20 @@ exports.config = {
47
47
require: ["ts-node/register", "should"]
48
48
}
49
49
```
50
-
50
+
For array of test pattern
51
+
```js
52
+
exports.config= {
53
+
tests: ['./*_test.js','./sampleTest.js'],
54
+
timeout:10000,
55
+
output:'',
56
+
helpers: {},
57
+
include: {},
58
+
bootstrap:false,
59
+
mocha: {},
60
+
// require modules
61
+
require: ["ts-node/register", "should"]
62
+
}
63
+
```
51
64
## Dynamic Configuration
52
65
53
66
By default `codecept.json` is used for configuration. You can override its values in runtime by using `--override` or `-o` option in command line, passing valid JSON as a value:
Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
1669
1669
Filename is relative to output folder.
1670
-
Optionally resize the window to the full available page `scrollHeight` and `scrollWidth` to capture the entire page by passing `true` in as the second argument.
1671
1670
1672
1671
```js
1673
1672
I.saveScreenshot('debug.png');
1674
-
I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scrollWidth before taking screenshot
Once the istanbul compatible coverage is generated, use [`nyc`](https://www.npmjs.com/package/nyc) to generate your coverage report in your desired format.
508
+
509
+
```
510
+
npx nyc report --reporter text -t coverage
511
+
```
512
+
513
+
The above command will generate a text report like shown below.
[Selenoid][10] plugin automatically starts browsers and video recording.
660
+
[Selenoid][7] plugin automatically starts browsers and video recording.
677
661
Works with WebDriver helper.
678
662
679
663
### Prerequisite
680
664
681
665
This plugin **requires Docker** to be installed.
682
666
683
-
> If you have issues starting Selenoid with this plugin consider using the official [Configuration Manager][11] tool from Selenoid
667
+
> If you have issues starting Selenoid with this plugin consider using the official [Configuration Manager][8] tool from Selenoid
684
668
685
669
### Usage
686
670
@@ -709,7 +693,7 @@ plugins: {
709
693
}
710
694
```
711
695
712
-
When `autoCreate` is enabled it will pull the [latest Selenoid from DockerHub][12] and start Selenoid automatically.
696
+
When `autoCreate` is enabled it will pull the [latest Selenoid from DockerHub][9] and start Selenoid automatically.
713
697
It will also create `browsers.json` file required by Selenoid.
714
698
715
699
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.
@@ -721,10 +705,10 @@ In automatic mode the latest version of browser will be used for tests. It is re
721
705
While this plugin can create containers for you for better control it is recommended to create and launch containers manually.
722
706
This is especially useful for Continous Integration server as you can configure scaling for Selenoid containers.
723
707
724
-
> Use [Selenoid Configuration Manager][11] to create and start containers semi-automatically.
708
+
> Use [Selenoid Configuration Manager][8] to create and start containers semi-automatically.
725
709
726
710
1. Create `browsers.json` file in the same directory `codecept.conf.js` is located
727
-
[Refer to Selenoid documentation][13] to know more about browsers.json.
711
+
[Refer to Selenoid documentation][10] to know more about browsers.json.
728
712
729
713
_Sample browsers.json_
730
714
@@ -749,7 +733,7 @@ _Sample browsers.json_
749
733
750
734
2. Create Selenoid container
751
735
752
-
Run the following command to create a container. To know more [refer here][14]
736
+
Run the following command to create a container. To know more [refer here][11]
753
737
754
738
```bash
755
739
docker create \
@@ -782,15 +766,15 @@ When `allure` plugin is enabled a video is attached to report automatically.
782
766
| enableVideo | Enable video recording and use `video` folder of output (default: false) |
783
767
| enableLog | Enable log recording and use `logs` folder of output (default: false) |
784
768
| deletePassed | Delete video and logs of passed tests (default : true) |
785
-
| additionalParams | example: `additionalParams:'--env TEST=test'` [Refer here][15] to know more |
769
+
| additionalParams | example: `additionalParams:'--env TEST=test'` [Refer here][12] to know more |
786
770
787
771
### Parameters
788
772
789
773
- `config`
790
774
791
775
## stepByStepReport
792
776
793
-
![step-by-step-report][16]
777
+
![step-by-step-report][13]
794
778
795
779
Generates step by step report for a test.
796
780
After each step in a test a screenshot is created. After test executed screenshots are combined into slideshow.
@@ -823,6 +807,20 @@ Possible config options:
823
807
824
808
- `config` **any**
825
809
810
+
## subtitles
811
+
812
+
Automatically captures steps as subtitle, and saves it as an artifact when a video is found for a failed test
813
+
814
+
#### Configuration
815
+
816
+
```js
817
+
plugins: {
818
+
subtitles: {
819
+
enabled:true
820
+
}
821
+
}
822
+
```
823
+
826
824
## tryTo
827
825
828
826
Adds global `tryTo` function inside of which all failed steps won't fail a test but will return true/false.
@@ -897,7 +895,7 @@ This plugin allows to run webdriverio services like:
897
895
- browserstack
898
896
- appium
899
897
900
-
A complete list of all available services can be found on [webdriverio website][17].
898
+
A complete list of all available services can be found on [webdriverio website][14].
901
899
902
900
#### Setup
903
901
@@ -909,7 +907,7 @@ See examples below:
909
907
910
908
#### Selenium Standalone Service
911
909
912
-
Install `@wdio/selenium-standalone-service` package, as [described here][18].
910
+
Install `@wdio/selenium-standalone-service` package, as [described here][15].
913
911
It is important to make sure it is compatible with current webdriverio version.
914
912
915
913
Enable `wdio` plugin in plugins list and add `selenium-standalone` service:
@@ -928,7 +926,7 @@ Please note, this service can be used with Protractor helper as well!
928
926
929
927
#### Sauce Service
930
928
931
-
Install `@wdio/sauce-service` package, as [described here][19].
929
+
Install `@wdio/sauce-service` package, as [described here][16].
932
930
It is important to make sure it is compatible with current webdriverio version.
933
931
934
932
Enable `wdio` plugin in plugins list and add `sauce` service:
@@ -970,28 +968,22 @@ In the same manner additional services from webdriverio can be installed, enable
0 commit comments