Skip to content

Replace runio with runok #2614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/books.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A book by **Paul Vincent Beigang**
#### Contents:

1. Preparation for End 2 End Testing with CodeceptJS
1. Setup CodeceptJS with WebDriver helper
1. Setup CodeceptJS with WebdriverIO
1. Create Your First CodeceptJS Test
1. Run Your First CodeceptJS Test Locally
1. Run Test on BrowserStack Against with the Safari Browser
Expand All @@ -34,4 +34,4 @@ A list of good educational posts about CodeceptJS
* [Customizing CodeceptJS Skeleton](https://medium.com/@successivetech/codeceptjs-skeleton-9ba86d3b45ec)
* [Running End to End tests as Google Cloud Functions](https://hackernoon.com/running-end-to-end-tests-as-google-cloud-functions-f5e34ffc3984)
* [End-To-End Testing With CodeceptJS](https://www.monterail.com/blog/end-to-end-testing-with-codeceptjs) by Piotr Michalski
* [Getting started with CodeceptJS and Selenium WebDriver](https://medium.com/@garrettvorce/getting-started-with-selenium-and-codeceptjs-c0698e8df677)
* [Getting started with CodeceptJS and Selenium WebDriver](https://medium.com/@garrettvorce/getting-started-with-selenium-and-codeceptjs-c0698e8df677)
392 changes: 263 additions & 129 deletions docs/changelog.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/community-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Please **add your own** by editing this page.
## Other

* [codeceptjs-cmdhelper](https://github.com/thiagodp/codeceptjs-cmdhelper) allows you to run commands in the terminal/console
* [eslint-plugin-codeceptjs](https://www.npmjs.com/package/eslint-plugin-codeceptjs) Eslint rules for CodeceptJS.
* [eslint-plugin-codeceptjs](https://www.npmjs.com/package/eslint-plugin-codeceptjs) Eslint rules for CodeceptJS.
4 changes: 2 additions & 2 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Tests repository demonstrate usage of
* PageObjects
* Cucumber syntax

## [Basic Examples](https://github.com/codecept-js/CodeceptJS/tree/master/examples)
## [Basic Examples](https://github.com/Codeception/CodeceptJS/tree/master/examples)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are redirected to the proper place, so I guess, this should be fine, thou!


CodeceptJS repo contains basic tests (both failing and passing) just to show how it works.
Our team uses it to test new features and run simple scenarios.
Expand Down Expand Up @@ -155,4 +155,4 @@ Suggestions and improvements are welcome , please raise a ticket in Issue tab.
* Step by step setup in README
* Two helpers are added. UI - Puppeteer , API - REST and chai-codeceptJS for assetion
* ESLint for code check
* Upcoming : API generic functions , Adaptor design pattern , More utilities
* Upcoming : API generic functions , Adaptor design pattern , More utilities
8 changes: 6 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,18 +788,22 @@ Adds global `tryTo` function inside of which all failed steps won't fail a test

Enable this plugin in `codecept.conf.js` (enabled by default for new setups):

````js
```js
plugins: {
tryTo: {
enabled: true
}
}
```

Use it in your tests:

```js
const result = await tryTo(() => I.see('Welcome'));

// if text "Welcome" is on page, result => true
// if text "Welcome" is not on page, result => false
````
```

Disables retryFailedStep plugin for steps inside a block;

Expand Down
2 changes: 1 addition & 1 deletion lib/helper/REST.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class REST extends Helper {

if ((typeof request.data) === 'string') {
if (!request.headers || !request.headers['Content-Type']) {
request.headers = {...request.headers, ...{ 'Content-Type': 'application/x-www-form-urlencoded' }};
request.headers = { ...request.headers, ...{ 'Content-Type': 'application/x-www-form-urlencoded' } };
}
}

Expand Down
4 changes: 4 additions & 0 deletions lib/plugin/tryTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ const defaultConfig = {
* Adds global `tryTo` function inside of which all failed steps won't fail a test but will return true/false.
*
* Enable this plugin in `codecept.conf.js` (enabled by default for new setups):
*
* ```js
* plugins: {
* tryTo: {
* enabled: true
* }
* }
* ```
* Use it in your tests:
*
* ```js
* const result = await tryTo(() => I.see('Welcome'));
*
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"build": "tsc -p ./",
"json-server": "./node_modules/json-server/bin/index.js test/data/rest/db.json -p 8010 --watch -m test/data/rest/headers.js",
"json-server:graphql": "node test/data/graphql/index.js",
"lint": "eslint bin/ examples/ lib/ test/ translations/ runio.js",
"lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runio.js --fix",
"docs": "./runio.js docs",
"lint": "eslint bin/ examples/ lib/ test/ translations/ runok.js",
"lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.js --fix",
"docs": "./runok.js docs",
"test:unit": "mocha test/unit --recursive",
"test:runner": "mocha test/runner --recursive",
"test": "npm run test:unit && npm run test:runner",
"test:appium-quick": "mocha test/helper/Appium_test.js --grep 'quick'",
"test:appium-other": "mocha test/helper/Appium_test.js --grep 'second'",
"def": "./runio.js def",
"def": "./runok.js def",
"dev:graphql": "nodemon test/data/graphql/index.js",
"publish:site": "./runio.js publish:site",
"publish:site": "./runok.js publish:site",
"update-contributor-faces": "contributor-faces .",
"dtslint": "dtslint typings --localTs './node_modules/typescript/lib'"
},
Expand Down Expand Up @@ -101,13 +101,13 @@
"chai-as-promised": "^5.2.0",
"chai-subset": "^1.6.0",
"contributor-faces": "^1.0.3",
"dtslint": "^3.6.12",
"documentation": "^12.3.0",
"dtslint": "^3.6.12",
"eslint": "^6.8.0",
"expect": "^26.0.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-mocha": "^6.3.0",
"expect": "^26.0.1",
"express": "^4.17.1",
"faker": "^4.1.0",
"graphql": "^14.6.0",
Expand All @@ -123,16 +123,16 @@
"puppeteer": "^4.0.0",
"qrcode-terminal": "^0.12.0",
"rosie": "^1.6.0",
"runio.js": "^1.0.20",
"runok": "^0.9.2",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"testcafe": "^1.8.6",
"ts-morph": "^3.1.3",
"typescript": "^3.7.5",
"xml2js": "^0.4.23",
"tsd-jsdoc": "^2.5.0",
"typescript": "^3.7.5",
"wdio-docker-service": "^1.5.0",
"webdriverio": "^6.1.19",
"xml2js": "^0.4.23",
"xmldom": "^0.1.31",
"xpath": "0.0.27"
},
Expand Down
10 changes: 6 additions & 4 deletions runio.js → runok.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ const path = require('path');
const axios = require('axios');
const documentation = require('documentation');
const {
stopOnFail, chdir, git, copy, exec, replaceInFile, npmRun, npx, writeToFile, runio,
} = require('runio.js');
stopOnFail, chdir, tasks: {
git, copy, exec, replaceInFile, npmRun, npx, writeToFile,
}, runok,
} = require('runok');

stopOnFail();

Expand All @@ -21,7 +23,7 @@ module.exports = {

async def() {
await Promise.all([
this.buildLibWithDocs(true),
// this.buildLibWithDocs(true),
this.docsPlugins(),
this.docsExternalHelpers(),
]);
Expand Down Expand Up @@ -411,4 +413,4 @@ async function processChangelog() {
});
}

if (require.main === module) runio(module.exports);
if (require.main === module) runok(module.exports);