Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipoliko committed Nov 9, 2018
1 parent 823720a commit c878cae
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Dockerfile
package-lock.json
README.md
server.js
opicak.conf.js
mankey.conf.js
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/package-lock.json
/lib/
/coverage/
/opicak.conf.js
/report/
/mankey.conf.js
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM node:8-slim

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

RUN mkdir -p /home/opicak
RUN mkdir -p /home/mankey

WORKDIR /home/opicak
WORKDIR /home/mankey

ADD package.json .

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
*Opicak is in alpha phase and still requires a lot of work. You can try it out, but expect breaking changes even between patch releases. Beta phase will be initialized via minor release and production phase will be initialized via major release.*
*Mankey is in alpha phase and still requires a lot of work. You can try it out, but expect breaking changes even between patch releases. Beta phase will be initialized via minor release and production phase will be initialized via major release.*

# Opicak
Opicak will try out your website and report any errors he finds. He will show you step by step scenario how to reproduce the error.
# Mankey
Mankey will try out your website and report any errors he finds. He will show you step by step scenario how to reproduce the error.

## Install
Simply install the latest version via npm install
```
npm install opicak
npm install mankey
```

Than you can run opicak like this
Than you can run mankey like this
```
node_modules/.bin/opicak -u https://www.example.com
node_modules/.bin/mankey -u https://www.example.com
```

If/When he finds an error, you can display reproducible errors like this
```
node_modules/.bin/opicak report/*minified.json -p -u https://www.example.com
node_modules/.bin/mankey report/*minified.json -p -u https://www.example.com
```

Display available options like this
```
node_modules/.bin/opicak --help
node_modules/.bin/mankey --help
```

### Configuration
Opicak will look for configuraition file in your current directory with name `opicak.conf.js`.
Mankey will look for configuraition file in your current directory with name `mankey.conf.js`.

```javascript
module.exports = {
Expand All @@ -37,12 +37,12 @@ module.exports = {
// (if error occures, the scenario is ended)
actionsPerScenario: 100,
// Number of execution errors of actions to abort the random scenario.
// This prevents from infinity loops, when opicak is not able to perform
// This prevents from infinity loops, when mankey is not able to perform
// any action on the page and keeps retrying.
numberOfActionFailuresToAbortRandomScenario: 20,
// Starting url for all random scenarios
url: 'http://localhost:4444',
// After an error occured, opicak will try to reproduce the error again
// After an error occured, mankey will try to reproduce the error again
// and will retry up to this number of actions before giving up.
numberOfAllowedActionsToReproduceErrorFromPreviousRun: 20,
// Disables random scenarios,
Expand Down Expand Up @@ -74,10 +74,10 @@ module.exports = {
// Page error handler, which should tell what is actually an error.
// Function is evaluated in the browser context via
// page.evaluateOnNewDocument() and has method
// "opicakError(error)" available.
// "mankeyError(error)" available.
pageErrorHandler: () => {
window.addEventListener('error', (event) => {
opicakError(event.error.toString());
mankeyError(event.error.toString());
});
},
// A browser websocket endpoint to connect to (i.e. ws://5.5.5.5:3505)
Expand All @@ -104,7 +104,7 @@ Run local testing website (from example)
```
node server.js
```
Start local version of opicak with source mapping
Start local version of mankey with source mapping
```
npm start -- [options]
```
2 changes: 1 addition & 1 deletion bin/opicak.js → bin/mankey.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var defaultConfigValues = require('../lib/config/template.js');
var version = require('../package.json').version;
var configValues = {};

const USER_CONFIG_PATH = path.join(process.cwd(), './opicak.conf.js');
const USER_CONFIG_PATH = path.join(process.cwd(), './mankey.conf.js');

function getOptionSyntax(option, type) {
let long = '--' + option.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "opicak",
"name": "mankey",
"version": "0.0.1",
"description": "Monkey testing library",
"main": "index.js",
"scripts": {
"test": "jest",
"build": "rm -rf lib && babel src --out-dir lib --ignore \"src/**/*Spec.js\" --copy-files --plugins=transform-es2015-modules-commonjs",
"dev": "npm run build -- --source-maps --watch",
"start": "node -r source-map-support/register bin/opicak.js"
"start": "node -r source-map-support/register bin/mankey.js"
},
"bin": {
"opicak": "./bin/opicak.js"
"mankey": "./bin/mankey.js"
},
"publishConfig": {
"registry": "https://npm.dev.dszn.cz"
Expand Down
2 changes: 1 addition & 1 deletion src/browser/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class Browser {
this._pageErrorHandler = this._getEventEmitter();
this._defaultPageErrorHandler = error => this._pageErrorHandler.emit('page-error', error);

await this._page.exposeFunction('opicakError', (error) => this._pageErrorHandler.emit('page-error', error));
await this._page.exposeFunction('mankeyError', (error) => this._pageErrorHandler.emit('page-error', error));
await this._page.evaluateOnNewDocument(this._config.pageErrorHandler);
}

Expand Down
2 changes: 1 addition & 1 deletion src/browser/__tests__/BrowserSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Browser', () => {
expect(browser._defaultPageErrorHandler)
.toEqual(jasmine.any(Function));
expect(page.exposeFunction)
.toHaveBeenCalledWith('opicakError', jasmine.any(Function));
.toHaveBeenCalledWith('mankeyError', jasmine.any(Function));
expect(page.evaluateOnNewDocument)
.toHaveBeenCalledWith(pageErrorHandler);
});
Expand Down
8 changes: 4 additions & 4 deletions src/config/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
},
numberOfActionFailuresToAbortRandomScenario: {
value: 20,
description: 'Number of execution errors of actions to abort the random scenario. This prevents from infinity loops, when opicak is not able to perform any action on the page and keeps retrying.',
description: 'Number of execution errors of actions to abort the random scenario. This prevents from infinity loops, when mankey is not able to perform any action on the page and keeps retrying.',
type: 'number'
},
url: {
Expand All @@ -27,7 +27,7 @@ module.exports = {
},
numberOfAllowedActionsToReproduceErrorFromPreviousRun: {
value: 20,
description: 'After an error occured, opicak will try to reproduce the error again and will retry up to this number of actions before giving up.',
description: 'After an error occured, mankey will try to reproduce the error again and will retry up to this number of actions before giving up.',
type: 'number'
},
randomScenariosDisabled: {
Expand Down Expand Up @@ -80,10 +80,10 @@ module.exports = {
pageErrorHandler: {
value: () => {
window.addEventListener('error', (event) => {
opicakError(event.error.toString());
mankeyError(event.error.toString());
});
},
description: 'Page error handler, which should tell what is actually an error. Function is evaluated in the browser context via page.evaluateOnNewDocument() and has method "opicakError(error)" available.',
description: 'Page error handler, which should tell what is actually an error. Function is evaluated in the browser context via page.evaluateOnNewDocument() and has method "mankeyError(error)" available.',
type: 'Function',
cli_disabled: true
},
Expand Down

0 comments on commit c878cae

Please sign in to comment.