@serenity-js/protractor
Version:
Adapter that integrates @serenity-js/web with Protractor, enabling Serenity/JS reporting and using the Screenplay Pattern to write end-to-end test scenarios
27 lines (23 loc) • 873 B
text/typescript
import { serenity } from '@serenity-js/core';
import { Path } from '@serenity-js/core/lib/io';
import type { Runner } from 'protractor';
import { ProtractorFrameworkAdapter } from './ProtractorFrameworkAdapter';
import type { ProtractorReport } from './reporter';
import { TestRunnerDetector, TestRunnerLoader } from './runner';
/**
* ## Learn more
* - [Protractor framework adapters](https://github.com/angular/protractor/blob/master/lib/frameworks/README.md#framework-adapters-for-protractor)
*
* @param runner
* @param specs
*
* @group Integration
*/
export function run(runner: Runner, specs: string[]): Promise<ProtractorReport> {
const cwd = Path.from(runner.getConfig().configDir);
return new ProtractorFrameworkAdapter(
serenity,
runner,
new TestRunnerDetector(new TestRunnerLoader(cwd, process.pid)),
).run(specs);
}