Permalink
Browse files

fix(integration): cleanup of TestFrameworkAdapter interfaces

affects: serenity-js
  • Loading branch information...
jan-molak committed Mar 23, 2017
1 parent 0ccc69c commit 873c19c12ee6183c516ee2959fcec4bafddf7243
@@ -1,11 +1,11 @@
import { TestFramework } from '../serenity-protractor/framework';
import { TestFrameworkAdapter } from '../serenity-protractor/framework';
import { attemptToRequire } from '../serenity/io/attempt_require';
import _ = require('lodash');
import glob = require('glob');
import path = require('path');
export class CucumberTestFramework implements TestFramework {
export class CucumberTestFramework implements TestFrameworkAdapter {
private args: string[] = [];
@@ -1,5 +1,5 @@
import { serenity } from '..';
import { TestFramework } from '../serenity-protractor/framework';
import { TestFrameworkAdapter } from '../serenity-protractor/framework';
import { wrapped } from './controlflow';
import { endOf, ExecutedScenario, isPending, Scenario, startOf } from './model';
@@ -10,7 +10,7 @@ import { attemptToRequire } from '../serenity/io';
import { MochaConfig } from './mocha_config';
export class MochaTestFramework implements TestFramework {
export class MochaTestFramework implements TestFrameworkAdapter {
private mocha;
@@ -0,0 +1,4 @@
export interface Config<T> {
cwd: string;
options: T;
}
@@ -1,4 +1,5 @@
import { SerenityProtractorFramework } from './serenity_protractor_framework';
export { run, SerenityProtractorFramework } from './serenity_protractor_framework';
export { TestFramework } from './test_framework';
export { Config } from './config';
export { TestFrameworkAdapter } from './test_framework_adapter';
@@ -6,7 +6,7 @@ import { ProtractorNotifier } from '../reporting/protractor_notifier';
import { photographer } from '../stage/photographer';
import { SerenityFrameworkConfig } from './serenity_framework_config';
import { StandIns } from './stand_ins';
import { TestFramework } from './test_framework';
import { TestFrameworkAdapter } from './test_framework_adapter';
import { TestFrameworkDetector } from './test_framework_detector';
import _ = require('lodash');
@@ -23,7 +23,7 @@ export class SerenityProtractorFramework {
private config: SerenityFrameworkConfig;
private framework: TestFramework;
private framework: TestFrameworkAdapter;
private reporter: ProtractorReporter;
private detect = new TestFrameworkDetector();
@@ -1,3 +1,3 @@
export interface TestFramework {
export interface TestFrameworkAdapter {
run(specs: string[]): PromiseLike<any>;
}
@@ -1,11 +1,11 @@
import { CucumberTestFramework } from '../../serenity-cucumber/cucumber_test_framework';
import { MochaTestFramework } from '../../serenity-mocha';
import { SerenityFrameworkConfig } from './serenity_framework_config';
import { TestFramework } from './test_framework';
import { TestFrameworkAdapter } from './test_framework_adapter';
export class TestFrameworkDetector {
frameworkFor(config: SerenityFrameworkConfig): TestFramework {
frameworkFor(config: SerenityFrameworkConfig): TestFrameworkAdapter {
if (this.definesDialect(config)) {
return this.tryToInstantiate(config.serenity.dialect.toLowerCase(), config);
}

0 comments on commit 873c19c

Please sign in to comment.