diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 83234aff5..af0a7a38c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,7 +7,7 @@ Go over the steps in [this](https://github.com/firstcontributions/first-contribu To start you need: 1. Fork and clone the repo. -2. Run `npm i --force --omit=optional` to install all required libraries +2. Run `npm i --force` to install all required libraries 3. Do the changes. 4. Add/Update Test (if possible) 5. Update documentation @@ -28,7 +28,6 @@ To run examples: node bin/codecept.js run -c examples ``` - Depending on a type of change you should do the following. ## Debugging @@ -45,12 +44,12 @@ Please keep in mind that CodeceptJS have **unified API** for Playwright, WebDriv ### Updating Playwright | Puppeteer | WebDriver -*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required! Do **not edit** `docs/helpers/`, those files are generated from docblocks in corresponding helpers! * +_Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required! Do **not edit** `docs/helpers/`, those files are generated from docblocks in corresponding helpers! _ Working test is highly appreciated. To run the test suite you need: -* selenium server + chromedriver -* PHP installed +- selenium server + chromedriver +- PHP installed To launch PHP demo application run: @@ -83,7 +82,7 @@ http://localhost:8000/form/myexample ### Updating REST | ApiDataFactory -*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required!* +_Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required!_ Adding a test is highly appreciated. @@ -97,7 +96,7 @@ Edit a test at `test/rest/REST_test.js` or `test/rest/ApiDataFactory_test.js` ## Appium -*Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required! Do **not edit** `docs/helpers/`, those files are generated from docblocks in corresponding helpers! * +_Whenever a new method or new behavior is added it should be documented in a docblock. Valid JS-example is required! Do **not edit** `docs/helpers/`, those files are generated from docblocks in corresponding helpers! _ It is recommended to run mobile tests on CI. So do the changes, make pull request, see the CI status. @@ -212,6 +211,7 @@ docker-compose run --rm test-helpers test/rest ``` #### Run acceptance tests + To that we provide three separate services respectively for WebDriver, Nightmare and Puppeteer tests: ```sh @@ -236,11 +236,13 @@ And now every command based on `test-helpers` service will use node 9.4.0. The same argument can be passed when building unit and acceptance tests services. ### CI flow + We're currently using a bunch of CI services to build and test codecept in different environments. Here's short summary of what are differences between separate services #### CircleCI + Here we use CodeceptJS docker image to build and execute tests inside it. We start with building Docker container based on Dockerfile present in main project directory. Then we run (in this order) unit tests, all helpers present in diff --git a/lib/mocha/featureConfig.js b/lib/mocha/featureConfig.js index dec3da2da..052b2fbf1 100644 --- a/lib/mocha/featureConfig.js +++ b/lib/mocha/featureConfig.js @@ -3,6 +3,9 @@ * Can inject values and add custom configuration. */ class FeatureConfig { + /** + * @param {CodeceptJS.Suite} suite + */ constructor(suite) { this.suite = suite } @@ -41,12 +44,17 @@ class FeatureConfig { return this } + /** + * @callback FeatureConfigCallback + * @param {CodeceptJS.Suite} suite + * @returns {Object} + */ + /** * Configures a helper. * Helper name can be omitted and values will be applied to first helper. - * - * @param {string|number} helper - * @param {*} obj + * @param {string | Object | FeatureConfigCallback} helper + * @param {Object} [obj] * @returns {this} */ config(helper, obj) { diff --git a/lib/mocha/scenarioConfig.js b/lib/mocha/scenarioConfig.js index 6813e786e..bd73127f6 100644 --- a/lib/mocha/scenarioConfig.js +++ b/lib/mocha/scenarioConfig.js @@ -2,6 +2,9 @@ const { isAsyncFunction } = require('../utils') /** @class */ class ScenarioConfig { + /** + * @param {CodeceptJS.Test} test + */ constructor(test) { this.test = test } @@ -77,10 +80,16 @@ class ScenarioConfig { return this } + /** + * @callback ScenarioConfigCallback + * @param {CodeceptJS.Test} test + * @returns {Object} + */ + /** * Configures a helper. * Helper name can be omitted and values will be applied to first helper. - * @param {string | Object} helper + * @param {string | Object | ScenarioConfigCallback} helper * @param {Object} [obj] * @returns {this} */