Skip to content

Commit

Permalink
Added valid type in plugin init function and type separated from code.
Browse files Browse the repository at this point in the history
  • Loading branch information
flops committed Oct 9, 2018
1 parent ffae6b9 commit e8412e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/plugin-selenium-driver/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from 'path';
import { Config } from 'webdriverio';
import { SeleniumPluginConfig } from './types';
import { PluginAPI } from '@testring/plugin-api';

export default function(pluginAPI: PluginAPI, userConfig: Config) {
export default function(pluginAPI: PluginAPI, userConfig: SeleniumPluginConfig) {
const pluginPath = path.join(__dirname, './plugin');
const browserProxy = pluginAPI.getBrowserProxy();

Expand Down
6 changes: 1 addition & 5 deletions packages/plugin-selenium-driver/src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import * as deepmerge from 'deepmerge';
import { IBrowserProxyPlugin } from '@testring/types';
import { spawn } from '@testring/child-process';
import { Config, Client, RawResult, remote } from 'webdriverio';
import { SeleniumPluginConfig } from '../types';
import { ChildProcess } from 'child_process';
import { loggerClient } from '@testring/logger';

const extensionPath = path.dirname(require.resolve('@testring/recorder-extension'));

type SeleniumPluginConfig = Config & {
clientCheckInterval: number;
clientTimeout: number;
};

type browserClientItem = {
client: Client<any>;
initTime: number;
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-selenium-driver/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Config } from 'webdriverio';

export type SeleniumPluginConfig = Config & {
clientCheckInterval: number;
clientTimeout: number;
};

0 comments on commit e8412e6

Please sign in to comment.