diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..36128b4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "eslint.enable": false, + "java.configuration.updateBuildConfiguration": "automatic", + "editor.tabSize": 2, + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + // exclude .js and .js.map files, when in a TypeScript project + "**/*.js": { + "when": "$(basename).ts" + }, + "**/*.js.map": true, + "**/*.ngfactory.ts": true, + "**/*.ngsummary.json": true + }, + "vsicons.presets.angular": true, + "json.format.enable": false, + "javascript.format.enable": true, + "typescript.format.enable": true +} diff --git a/core/GalenApi.d.ts b/core/GalenApi.d.ts new file mode 100644 index 0000000..f8a4415 --- /dev/null +++ b/core/GalenApi.d.ts @@ -0,0 +1,55 @@ +declare interface GridSettings { + browser: string; + browserVersion: string; + platform: string; + size: string; + desiredCapabilities: { key: string, value: string } +} + +declare interface WebDriver { + +} + +export declare function load(jsFilePath: string): void + +export declare function createDriver(url: string, browserSize: string, browserType: string): WebDriver + +export declare function createGridDriver(gridHubUrl: string, settings: GridSettings): WebDriver + +export declare function resize(driver: WebDriver, size: string): void + +export declare function checkLayout(driver: WebDriver, specFile: String, tagsToInclude?: [string], tagsToExclude?: [string]): void + +export declare function checkLayout({}): void + +export declare function checkPageSpecLayout(driver: WebDriver, pageSpec: String, tagsToInclude?: [string], tagsToExclude?: [string]): void + +export declare function parsePageSpec({}): void + +export declare function loadProperties(filePath: String): Map + +export declare function readFile(filePath: String): string + +export declare function listDirectory(dirPath: String): [string] + +export declare function makeDirectory(dirPath: String): void + +export declare function fileExists(filePath: String): boolean + +export declare function isDirectory(dirPath: String): boolean + +export declare function retry(tries: number, callback: Function): void + +export declare function takeScreenshot(driver: WebDriver): string + +export declare function cookie(driver: WebDriver, cookieValue: string): void + +export declare function inject(driver: WebDriver, script: string): void + +export declare function createTestDataProvider(varableName: string): any + +export declare function dumpPage({}): void + +export declare function logged(text: string, callback: Function): void + +export declare function loggedFunction(textExpression: string, callback: Function): void diff --git a/core/package.json b/core/package.json index 880a6fa..2842dcd 100644 --- a/core/package.json +++ b/core/package.json @@ -20,6 +20,8 @@ "author": "Martin Reinhardt", "scripts": { "galen": "bin/galen", + "build": "npm run tsc", + "tsc": "tsc", "postinstall": "node postinstall.js", "test": "nodeunit --reporter=junit test/tests.js --output target", "pretest": "jshint -c ../.jshintrc --filename *.js && jshint -c ../.jshintrc --filename lib/helper.js && jshint -c ../.jshintrc --filename test/*.js", @@ -49,7 +51,11 @@ "istanbul-coveralls": "1.0.3", "jscoverage": "0.6.0", "jshint": "2.9.5", - "nodeunit": "0.9.1" + "nodeunit": "0.9.1", + "tsdoc": "0.0.4", + "tslint": "4.0.1", + "tslint-eslint-rules": "1.3.0", + "typescript": "2.6.1" }, "repository": { "type": "git", diff --git a/core/tsconfig.json b/core/tsconfig.json new file mode 100644 index 0000000..aec4580 --- /dev/null +++ b/core/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es5", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noEmitHelpers": true, + "noEmitOnError": true, + "lib": [ + "es2015", + "es2015.iterable", + "dom" + ], + "types": [ + "jasmine", + "node" + ] + }, + "exclude": [ + "node_modules" + ] +}