Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodp committed Jun 2, 2020
0 parents commit b643f7e
Show file tree
Hide file tree
Showing 20 changed files with 7,246 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This project uses EditorConfig (http://editorconfig.org) to standardize
# tabulation, charset and other attributes of source files. Please head to
# http://editorconfig.org/#download to check if your editor comes with
# EditorConfig bundled or to download a plugin.

root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[{*.json,*.yml}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: node_js

os:
- linux
- osx
- windows

node_js:
- "12"
- "8"

cache:
npm: true
16 changes: 16 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
concordialang-codeceptjs-testcafe

Copyright (c) Thiago Delgado Pinto

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
11 changes: 11 additions & 0 deletions dist/TestCafeHelperConfiguration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { HelperConfiguration } from 'concordialang-codeceptjs-core';
import { TestScriptExecutionOptions } from 'concordialang-plugin';
export declare class TestCafeHelperConfiguration implements HelperConfiguration {
readonly _browser: string;
readonly _url: string;
constructor(_browser?: string, _url?: string);
/** @inheritdoc */
name(): string;
/** @inheritdoc */
generate(execOptions: TestScriptExecutionOptions): any;
}
25 changes: 25 additions & 0 deletions dist/TestCafeHelperConfiguration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestCafeHelperConfiguration = void 0;
class TestCafeHelperConfiguration {
constructor(_browser = 'chrome', _url = 'http://localhost') {
this._browser = _browser;
this._url = _url;
}
/** @inheritdoc */
name() {
return 'TestCafe';
}
/** @inheritdoc */
generate(execOptions) {
const [browser] = execOptions.target
? execOptions.target.split(',').map(t => t.trim())
: [this._browser];
return {
"browser": browser,
"url": this._url,
"show": !(true === execOptions.headless),
};
}
}
exports.TestCafeHelperConfiguration = TestCafeHelperConfiguration;
2 changes: 2 additions & 0 deletions dist/in-ci.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare function is(it: any): boolean;
declare function isInCI(): boolean;
10 changes: 10 additions & 0 deletions dist/in-ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function is(it) {
return !!it && it !== '0' && it !== 'false';
}
function isInCI() {
return is(process.env['CI']);
}
// Returns with an error when *not* in CI mode
if (!isInCI()) {
process.exit(1);
}
9 changes: 9 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { CodeceptJS, TestScriptExecutor } from 'concordialang-codeceptjs-core';
/**
* Plug-in for CodeceptJS with TestCafé.
*
* @author Thiago Delgado Pinto
*/
export declare class CodeceptJSTestCafe extends CodeceptJS {
protected createTestScriptExecutor(): TestScriptExecutor;
}
16 changes: 16 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CodeceptJSTestCafe = void 0;
const concordialang_codeceptjs_core_1 = require("concordialang-codeceptjs-core");
const TestCafeHelperConfiguration_1 = require("./TestCafeHelperConfiguration");
/**
* Plug-in for CodeceptJS with TestCafé.
*
* @author Thiago Delgado Pinto
*/
class CodeceptJSTestCafe extends concordialang_codeceptjs_core_1.CodeceptJS {
createTestScriptExecutor() {
return new concordialang_codeceptjs_core_1.TestScriptExecutor([new TestCafeHelperConfiguration_1.TestCafeHelperConfiguration()]);
}
}
exports.CodeceptJSTestCafe = CodeceptJSTestCafe;
Empty file added dist/postinstall.d.ts
Empty file.
16 changes: 16 additions & 0 deletions dist/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
console.log('\u001B[96m'); // cyan
console.log('Thank you for installing the plug-in\u001B[94m concordialang-codeceptjs-testcafe \u001B[96m\n');
console.log('To support database scripts in you tests, execute the corresponding command:\n');
console.log('| driver | command to install | note |');
console.log('| ------------- | ------------------------------ | ------------ |');
console.log('| CSV files |\u001B[94m npm i -D database-js-csv \u001B[96m | |');
console.log('| Excel files |\u001B[94m npm i -D database-js-xlsx \u001B[96m | |');
console.log('| Firebase |\u001B[94m npm i -D database-js-firebase \u001B[96m | |');
console.log('| INI files |\u001B[94m npm i -D database-js-ini \u001B[96m | |');
console.log('| JSON files |\u001B[94m npm i -D database-js-json \u001B[96m | |');
console.log('| MySQL |\u001B[94m npm i -D database-js-mysql \u001B[96m | |');
console.log('| MS Access |\u001B[94m npm i -D database-js-adodb \u001B[96m | Windows only |');
console.log('| MS SQL Server |\u001B[94m npm i -D database-js-mssql \u001B[96m | |');
console.log('| PostgreSQL |\u001B[94m npm i -D database-js-postgres \u001B[96m | |');
console.log('| SQLite |\u001B[94m npm i -D database-js-sqlite \u001B[96m | |');
console.log('\u001B[0m'); // light gray
Loading

0 comments on commit b643f7e

Please sign in to comment.