Permalink
Browse files

feat(core): @serenity-js/core is independent of Protractor

affects: @serenity-js/core, @serenity-js/cucumber-2, serenity-js

The core of Serenity/JS, providing building blocks of the Screenplay Pattern as well as the
reporting capabilities, is now independent of Protractor and distributed as a separate NPM package.
This will enable plugging @serenity-js/core into other test runners and executing acceptance tests
that don't require a browser.

ISSUES CLOSED: #6
  • Loading branch information...
jan-molak committed Jun 11, 2017
1 parent 8e3ae67 commit 5dc4dd1610fe307ea4fcdce78c186355705d4c15
Showing with 169 additions and 3,736 deletions.
  1. +1 −1 examples/todomvc-model/src/questions/item_status.ts
  2. +2 −2 examples/todomvc-model/src/tasks/add_todo_items.ts
  3. +7 −4 package.json
  4. +1 −1 packages/core/package.json
  5. +1 −1 packages/cucumber-2/package.json
  6. +9 −18 packages/serenity-js/package.json
  7. +0 −101 packages/serenity-js/spec/api/config.spec.ts
  8. +0 −132 packages/serenity-js/spec/api/screenplay/abilities/take_notes.spec.ts
  9. +7 −8 packages/serenity-js/spec/api/serenity-protractor/framework/protractor_reporter.spec.ts
  10. +3 −3 packages/serenity-js/spec/api/serenity-protractor/framework/serenity_protractor_framework.spec.ts
  11. +5 −4 packages/serenity-js/spec/api/{ → serenity-protractor}/screenplay/interactions/click.spec.ts
  12. +5 −4 packages/serenity-js/spec/api/{ → serenity-protractor}/screenplay/interactions/enter.spec.ts
  13. 0 packages/serenity-js/spec/api/{ → serenity-protractor}/screenplay/interactions/fake_browser.ts
  14. +5 −4 packages/serenity-js/spec/api/{ → serenity-protractor}/screenplay/interactions/open.spec.ts
  15. +5 −5 ...renity-js/spec/api/{ → serenity-protractor}/screenplay/interactions/resize_browser_window.spec.ts
  16. +3 −3 packages/serenity-js/spec/api/{ → serenity-protractor}/screenplay/interactions/see.spec.ts
  17. +4 −4 packages/serenity-js/spec/api/{ → serenity-protractor}/screenplay/ui/target.spec.ts
  18. +16 −16 packages/serenity-js/spec/api/serenity-protractor/stage/photographer.spec.ts
  19. +0 −37 packages/serenity-js/spec/api/serenity.spec.ts
  20. +0 −34 packages/serenity-js/spec/api/serenity/domain/events.spec.ts
  21. +0 −68 packages/serenity-js/spec/api/serenity/domain/model.spec.ts
  22. +0 −24 packages/serenity-js/spec/api/serenity/io/attempt_require.spec.ts
  23. +0 −107 packages/serenity-js/spec/api/serenity/io/file_system.spec.ts
  24. +0 −113 packages/serenity-js/spec/api/serenity/recording.spec.ts
  25. +0 −55 packages/serenity-js/spec/api/serenity/recording/activity_description.spec.ts
  26. +0 −187 packages/serenity-js/spec/api/serenity/recording/step_annotation.spec.ts
  27. +0 −687 packages/serenity-js/spec/api/serenity/reporting/serenity_bdd_reporter.spec.ts
  28. +0 −223 packages/serenity-js/spec/api/serenity/screenplay.spec.ts
  29. +0 −96 packages/serenity-js/spec/api/serenity/stage/console_reporter.spec.ts
  30. +0 −74 packages/serenity-js/spec/api/serenity/stage/stage.spec.ts
  31. +0 −319 packages/serenity-js/spec/api/serenity/stage/stage_manager.spec.ts
  32. +1 −1 packages/serenity-js/spec/expect.ts
  33. +2 −1 packages/serenity-js/spec/integration/cucumber/recognises_scenario_results.ts
  34. +2 −1 packages/serenity-js/spec/integration/cucumber/recognises_scenario_tags.ts
  35. +2 −1 packages/serenity-js/spec/integration/cucumber/recognises_timed_out_scenarios.ts
  36. +1 −1 packages/serenity-js/spec/integration/mocha/recognises_scenario_results.ts
  37. +2 −2 packages/serenity-js/spec/support/child_process_reporter.ts
  38. +1 −2 packages/serenity-js/spec/support/spawner.ts
  39. +1 −4 packages/serenity-js/src/index.ts
  40. +1 −2 packages/serenity-js/src/screenplay-protractor.ts
  41. +2 −2 packages/serenity-js/src/screenplay.ts
  42. +2 −2 packages/serenity-js/src/serenity-cucumber/cucumber_serenity_notifier.ts
  43. +1 −1 packages/serenity-js/src/serenity-cucumber/cucumber_test_framework.ts
  44. +1 −1 packages/serenity-js/src/serenity-cucumber/stage_cue.ts
  45. +1 −1 packages/serenity-js/src/serenity-cucumber/webdriver_synchroniser.ts
  46. +3 −2 packages/serenity-js/src/serenity-mocha/mocha_test_framework.ts
  47. +1 −1 packages/serenity-js/src/serenity-mocha/model.ts
  48. +1 −1 packages/serenity-js/src/serenity-mocha/stage_cue.ts
  49. +1 −1 packages/serenity-js/src/serenity-protractor/framework/serenity_framework_config.ts
  50. +4 −2 packages/serenity-js/src/serenity-protractor/framework/serenity_protractor_framework.ts
  51. +4 −3 packages/serenity-js/src/serenity-protractor/framework/stand_ins.ts
  52. +3 −2 packages/serenity-js/src/serenity-protractor/reporting/protractor_notifier.ts
  53. +1 −1 packages/serenity-js/src/serenity-protractor/reporting/protractor_report.ts
  54. +5 −6 packages/serenity-js/src/serenity-protractor/reporting/protractor_reporter.ts
  55. +4 −5 packages/serenity-js/src/serenity-protractor/screenplay/abilities/browse_the_web.ts
  56. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/clear.ts
  57. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/click.ts
  58. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/double_click.ts
  59. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/enter.ts
  60. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/evaluate.ts
  61. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/execute.ts
  62. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/hit.ts
  63. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/open.ts
  64. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/resize_browser_window.ts
  65. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/scroll.ts
  66. +2 −2 packages/serenity-js/src/serenity-protractor/screenplay/interactions/select.ts
  67. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/use_angular.ts
  68. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/interactions/wait.ts
  69. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/questions/attribute.ts
  70. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/questions/selected_value.ts
  71. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/questions/text.ts
  72. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/questions/value.ts
  73. +2 −1 packages/serenity-js/src/serenity-protractor/screenplay/questions/web_element.ts
  74. +1 −1 packages/serenity-js/src/serenity-protractor/screenplay/questions/website.ts
  75. +1 −1 packages/serenity-js/src/serenity-protractor/screenplay/ui/target.ts
  76. +2 −1 packages/serenity-js/src/serenity-protractor/stage/photographer-timing.ts
  77. +5 −5 packages/serenity-js/src/serenity-protractor/stage/photographer.ts
  78. +0 −30 packages/serenity-js/src/serenity/config.ts
  79. +0 −21 packages/serenity-js/src/serenity/domain/events.ts
  80. +0 −2 packages/serenity-js/src/serenity/domain/index.ts
  81. +0 −151 packages/serenity-js/src/serenity/domain/model.ts
  82. +0 −2 packages/serenity-js/src/serenity/index.ts
  83. +0 −9 packages/serenity-js/src/serenity/io/attempt_require.ts
  84. +0 −49 packages/serenity-js/src/serenity/io/file_system.ts
  85. +0 −3 packages/serenity-js/src/serenity/io/index.ts
  86. +0 −6 packages/serenity-js/src/serenity/io/json.ts
  87. +0 −35 packages/serenity-js/src/serenity/recording/activity_description.ts
  88. +0 −19 packages/serenity-js/src/serenity/recording/async.ts
  89. +0 −2 packages/serenity-js/src/serenity/recording/index.ts
  90. +0 −31 packages/serenity-js/src/serenity/recording/step_annotation.ts
  91. +0 −4 packages/serenity-js/src/serenity/reporting/index.ts
  92. +0 −140 packages/serenity-js/src/serenity/reporting/rehearsal_report.ts
  93. +0 −7 packages/serenity-js/src/serenity/reporting/report_exporter.ts
  94. +0 −75 packages/serenity-js/src/serenity/reporting/serenity_bdd_report.ts
  95. +0 −208 packages/serenity-js/src/serenity/reporting/serenity_bdd_reporter.ts
  96. +0 −1 packages/serenity-js/src/serenity/screenplay/abilities/index.ts
  97. +0 −26 packages/serenity-js/src/serenity/screenplay/abilities/take_notes.ts
  98. +0 −24 packages/serenity-js/src/serenity/screenplay/activities.ts
  99. +0 −158 packages/serenity-js/src/serenity/screenplay/actor.ts
  100. +0 −2 packages/serenity-js/src/serenity/screenplay/expectations.ts
  101. +0 −5 packages/serenity-js/src/serenity/screenplay/index.ts
  102. +0 −28 packages/serenity-js/src/serenity/screenplay/interactions/compare_notes.ts
  103. +0 −3 packages/serenity-js/src/serenity/screenplay/interactions/index.ts
  104. +0 −15 packages/serenity-js/src/serenity/screenplay/interactions/see.ts
  105. +0 −20 packages/serenity-js/src/serenity/screenplay/interactions/take_note.ts
  106. +0 −2 packages/serenity-js/src/serenity/screenplay/lists.ts
  107. +0 −5 packages/serenity-js/src/serenity/screenplay/question.ts
  108. +0 −43 packages/serenity-js/src/serenity/serenity.ts
  109. +0 −33 packages/serenity-js/src/serenity/stage/console_reporter.ts
  110. +0 −3 packages/serenity-js/src/serenity/stage/index.ts
  111. +0 −49 packages/serenity-js/src/serenity/stage/stage.ts
  112. +0 −114 packages/serenity-js/src/serenity/stage/stage_manager.ts
  113. +3 −3 packages/serenity-js/src/stage_crew.ts
@@ -1,5 +1,5 @@
import { Question, UsesAbilities } from 'serenity-js/lib/screenplay';
import { BrowseTheWeb } from 'serenity-js/lib/serenity-protractor';
import { Question, UsesAbilities } from 'serenity-js/lib/serenity/screenplay';
import { TodoList } from '../user_interface';
@@ -1,4 +1,4 @@
import { Performable, PerformsTasks, step, Task } from 'serenity-js/lib/screenplay-protractor';
import { PerformsTasks, step, Task } from 'serenity-js/lib/screenplay-protractor';
import { AddATodoItem } from './add_a_todo_item';
@@ -23,7 +23,7 @@ export class AddTodoItems implements Task {
: 'no items';
}
private addAll(items: string[]): Performable[] {
private addAll(items: string[]): Task[] {
return items.map(item => AddATodoItem.called(item));
}
}
View
@@ -19,16 +19,19 @@
"testing"
],
"scripts": {
"clean": "lerna run clean",
"verify": "lerna run verify --stream",
"verify:pull-request": "lerna run verify:pull-request --stream",
"clean": "rimraf target",
"verify": "lerna run verify --stream && npm run report",
"verify:pull-request": "lerna run verify:pull-request --stream && npm run report",
"book:clean": "rimraf _book",
"book:build": "gitbook build",
"prebook:publish": "npm run book:clean && npm run book:build",
"book:publish": "node ./gh-pages.js -d _book --dotfiles",
"semantic-release": "lerna-semantic-release pre && lerna-semantic-release post && lerna-semantic-release perform",
"semantic-release-dry-run": "lerna-semantic-release pre && lerna-semantic-release post",
"coverage:publish": "cat ./packages/serenity-js/staging/reports/coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js",
"report": "npm run coverage:merge && npm run coverage:report",
"coverage:merge": "istanbul-merge --out=./target/coverage/coverage-final.json ./target/coverage/**/coverage-final.json",
"coverage:report": "nyc report --reporter=html --reporter=lcov --temp-directory=./target/coverage --report-dir=./target/coverage",
"coverage:publish": "cat ./target/coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js",
"commit": "git-cz",
"lerna": "lerna",
"gitbook": "gitbook",
@@ -20,7 +20,7 @@
"scripts": {
"clean": "rimraf lib",
"lint": "tslint --project=tsconfig.json --config=../../tslint.json --format=prose",
"test": "nyc --report-dir=./staging/reports/coverage mocha --opts ./mocha.opts 'spec/**/*.spec.*'",
"test": "nyc --report-dir=../../target/coverage/core mocha --opts ./mocha.opts 'spec/**/*.spec.*'",
"package": "tsc --project tsconfig.json",
"verify": "npm run clean && npm run lint && npm test && npm run package"
},
@@ -24,7 +24,7 @@
"scripts": {
"clean": "rimraf lib",
"lint": "tslint --project=tsconfig.json --config=../../tslint.json --format=prose",
"test": "nyc --report-dir=./staging/reports/coverage mocha --opts ./mocha.opts 'spec/**/*.spec.*'",
"test": "nyc --report-dir=../../target/coverage/cucumber-2 mocha --opts ./mocha.opts 'spec/**/*.spec.*'",
"package": "tsc --project tsconfig.json",
"verify": "npm run clean && npm run lint && npm test && npm run package"
},
@@ -26,37 +26,27 @@
"test": "npm run spec",
"lint": "tslint --project=tsconfig.json --config=../../tslint.json --format=prose",
"package": "tsc --project tsconfig-export.json",
"verify": "npm run clean && npm run lint && npm test && npm run package && npm run report",
"verify:pull-request": "npm run clean && npm run lint && npm run spec:pull-request && npm run package && npm run report",
"verify": "npm run clean && npm run lint && npm test && npm run package",
"verify:pull-request": "npm run clean && npm run lint && npm run spec:pull-request && npm run package",
"rebuild": "npm run clean && npm run verify",
"spec:api": "nyc --report-dir=./staging/reports/coverage/api mocha --opts ./mocha.opts 'spec/api/**/*.spec.*'",
"spec:cookbook": "nyc --report-dir=./staging/reports/coverage/cookbook protractor ./spec/protractor-cookbook.conf.js --params.browsers=chrome",
"spec:cookbook:pull-request": "nyc --report-dir=./staging/reports/coverage/cookbook protractor ./spec/protractor-cookbook.conf.js --params.browsers=phantomjs",
"spec:integration": "nyc --report-dir=./staging/reports/coverage/integration mocha --opts ./mocha.opts 'spec/integration/*/*.ts'",
"spec:api": "nyc --report-dir=../../target/coverage/api mocha --opts ./mocha.opts 'spec/api/**/*.spec.*'",
"spec:cookbook": "nyc --report-dir=../../target/coverage/cookbook protractor ./spec/protractor-cookbook.conf.js --params.browsers=chrome",
"spec:cookbook:pull-request": "nyc --report-dir=../../target/coverage/cookbook protractor ./spec/protractor-cookbook.conf.js --params.browsers=phantomjs",
"spec:integration": "nyc --report-dir=../../target/coverage/integration mocha --opts ./mocha.opts 'spec/integration/*/*.ts'",
"spec": "npm run spec:api && npm run spec:cookbook && npm run spec:integration",
"spec:pull-request": "npm run spec:api && npm run spec:cookbook:pull-request && npm run spec:integration",
"coverage:merge": "istanbul-merge --out=./staging/reports/coverage/coverage-final.json ./staging/reports/coverage/**/coverage-final.json",
"coverage:report": "nyc report --reporter=html --reporter=lcov --temp-directory=./staging/reports/coverage --report-dir=./staging/reports/coverage",
"report": "npm run coverage:merge && npm run coverage:report"
"spec:pull-request": "npm run spec:api && npm run spec:cookbook:pull-request && npm run spec:integration"
},
"peerDependencies": {
"protractor": "5.x"
},
"dependencies": {
"@types/graceful-fs": "2.0.29",
"@types/lodash": "4.14.55",
"@types/mkdirp": "0.3.29",
"@types/node": "6.0.73",
"@serenity-js/core": "^1.1.2",
"@types/selenium-webdriver": "2.53.39",
"co": "4.6.0",
"glob": "7.1.1",
"graceful-fs": "4.1.11",
"is-generator": "1.0.3",
"lodash": "4.17.4",
"mkdirp": "0.5.1",
"moment": "2.18.1",
"selenium-webdriver": "3.0.1",
"stacktrace-js": "2.0.0",
"ts-md5": "1.2.0",
"util-arity": "1.1.0"
},
@@ -67,6 +57,7 @@
"@types/glob": "5.0.30",
"@types/mock-fs": "3.6.30",
"@types/nock": "8.2.0",
"@types/node": "6.0.73",
"@types/stacktrace-js": "0.0.30",
"chai-smoothie": "^0.2.0",
"cucumber": "1.3.2",

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,7 +1,3 @@
import sinon = require('sinon');
import expect = require('../../../expect');
import { given } from 'mocha-testdata';
import { Runner } from 'protractor/built/runner';
import {
ActivityFinished,
ActivityStarts,
@@ -12,13 +8,16 @@ import {
Result,
SceneFinished,
SceneStarts,
} from '../../../../src/serenity/domain';
} from '@serenity-js/core/lib/domain';
import { RehearsalReport } from '@serenity-js/core/lib/reporting';
import { Journal, Stage, StageManager } from '@serenity-js/core/lib/stage';
import sinon = require('sinon');
import expect = require('../../../expect');
import { given } from 'mocha-testdata';
import { Runner } from 'protractor/built/runner';
import { ProtractorReporter } from '../../../../src/serenity-protractor/reporting';
import { ProtractorReportExporter } from '../../../../src/serenity-protractor/reporting/protractor_reporter';
import { RehearsalReport } from '../../../../src/serenity/reporting';
import { Stage } from '../../../../src/serenity/stage/stage';
import { Journal, StageManager } from '../../../../src/serenity/stage/stage_manager';
describe('serenity-protractor', () => {
@@ -1,14 +1,14 @@
import { Serenity } from '@serenity-js/core';
import { ConsoleReporter, SerenityBDDReporter } from '@serenity-js/core/lib/reporting';
import { Config } from 'protractor';
import { Runner } from 'protractor/built/runner';
import { SinonStub } from 'sinon';
import { SerenityProtractorFramework } from '../../../../src/serenity-protractor/framework/serenity_protractor_framework';
import { StandIns } from '../../../../src/serenity-protractor/framework/stand_ins';
import { ProtractorNotifier } from '../../../../src/serenity-protractor/reporting/protractor_notifier';
import { ProtractorReporter } from '../../../../src/serenity-protractor/reporting/protractor_reporter';
import { Photographer } from '../../../../src/serenity-protractor/stage/photographer';
import { SerenityBDDReporter } from '../../../../src/serenity/reporting/serenity_bdd_reporter';
import { Serenity } from '../../../../src/serenity/serenity';
import { ConsoleReporter } from '../../../../src/serenity/stage/console_reporter';
import sinon = require('sinon');
import expect = require('../../../expect');
Oops, something went wrong.

0 comments on commit 5dc4dd1

Please sign in to comment.