Skip to content

Commit

Permalink
fix(integration): cleanup of TestFrameworkAdapter interfaces
Browse files Browse the repository at this point in the history
affects: serenity-js
  • Loading branch information
jan-molak committed Mar 23, 2017
1 parent 0ccc69c commit 873c19c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
@@ -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[] = [];

Expand Down
@@ -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';

Expand All @@ -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;

Expand Down
@@ -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';
Expand Up @@ -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');
Expand All @@ -23,7 +23,7 @@ export class SerenityProtractorFramework {

private config: SerenityFrameworkConfig;

private framework: TestFramework;
private framework: TestFrameworkAdapter;
private reporter: ProtractorReporter;

private detect = new TestFrameworkDetector();
Expand Down
@@ -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);
}
Expand Down

0 comments on commit 873c19c

Please sign in to comment.