Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat(rest): @serenity-js/rest 2.0
affects: @serenity-js/assertions, @serenity-js/core, @serenity-js/cucumber, @serenity-js/rest, @serenity-js-examples/calculator-app, @serenity-js-examples/cucumber-rest-api-level-testing, @documentation/esdoc-template, @documentation/website Completely re-designed version of the REST module
- Loading branch information
Showing
with
9,003 additions
and 225 deletions.
- +3 −0 .gitignore
- +8 −7 documentation/esdoc-template/src/class.html
- +6 −6 documentation/esdoc-template/src/details.html
- +1 −1 documentation/website/build.js
- +1 −0 documentation/website/package.json
- +9 −3 documentation/website/plugins/highlighEsdoc.js
- +1 −1 documentation/website/src/guides/screenplay-pattern.md
- +24 −0 examples/calculator-app/index.js
- +10 −0 examples/calculator-app/nodemon.json
- +3,216 −0 examples/calculator-app/package-lock.json
- +12 −3 examples/calculator-app/package.json
- +86 −18 examples/calculator-app/spec/Calculator.spec.ts
- +1 −1 examples/calculator-app/spec/domain/model/Operator.spec.ts
- +35 −1 examples/calculator-app/spec/expect.ts
- +37 −0 examples/calculator-app/spec/rest-api/controllers.spec.ts
- +72 −0 examples/calculator-app/spec/rest-api/model/Expression.spec.ts
- +6 −2 examples/calculator-app/src/Calculator.ts
- +6 −0 examples/calculator-app/src/domain/model/Operand.ts
- +1 −1 examples/calculator-app/src/domain/model/Operator.ts
- +3 −1 examples/calculator-app/src/domain/query-handlers/ResultCalculator.ts
- +52 −0 examples/calculator-app/src/rest-api/controllers.ts
- +6 −0 examples/calculator-app/src/rest-api/index.ts
- +77 −0 examples/calculator-app/src/rest-api/model/Expression.ts
- +17 −0 examples/calculator-app/src/rest-api/model/Result.ts
- +2 −0 examples/calculator-app/src/rest-api/model/index.ts
- +7 −0 examples/cucumber-rest-api-level-testing/.gitignore
- +15 −0 examples/cucumber-rest-api-level-testing/features/api/calculations.feature
- +17 −0 examples/cucumber-rest-api-level-testing/features/step_definitions/api-level.steps.ts
- +20 −0 examples/cucumber-rest-api-level-testing/features/support/configure_serenity.ts
- +11 −0 examples/cucumber-rest-api-level-testing/features/support/screenplay/Actors.ts
- +2 −0 examples/cucumber-rest-api-level-testing/features/support/screenplay/index.ts
- +10 −0 examples/cucumber-rest-api-level-testing/features/support/screenplay/tasks/RequestCalculationOf.ts
- +10 −0 examples/cucumber-rest-api-level-testing/features/support/screenplay/tasks/VerifyResultAt.ts
- +2 −0 examples/cucumber-rest-api-level-testing/features/support/screenplay/tasks/index.ts
- +2,784 −0 examples/cucumber-rest-api-level-testing/package-lock.json
- +52 −0 examples/cucumber-rest-api-level-testing/package.json
- +10 −0 examples/cucumber-rest-api-level-testing/tsconfig-lint.json
- +13 −0 examples/cucumber-rest-api-level-testing/tsconfig.json
- +4 −4 package-lock.json
- +3 −3 package.json
- +25 −19 packages/assertions/spec/Ensure.spec.ts
- +1 −1 packages/assertions/spec/assertions/equals.spec.ts
- +1 −1 packages/assertions/spec/assertions/not.spec.ts
- +2 −2 packages/assertions/src/{assertions → }/Assertion.ts
- +7 −8 packages/assertions/src/Ensure.ts
- +3 −3 packages/assertions/src/assertions/equals.ts
- +1 −0 packages/assertions/src/assertions/index.ts
- +1 −1 packages/assertions/src/assertions/not.ts
- +20 −0 packages/assertions/src/assertions/startsWith.ts
- +1 −0 packages/assertions/src/index.ts
- +15 −15 packages/assertions/src/values.ts
- +2 −1 packages/assertions/tsconfig.json
- +4 −4 packages/core/spec/screenplay/Interaction.spec.ts
- +2 −2 packages/core/spec/screenplay/actor/Actor.spec.ts
- +5 −5 packages/core/spec/stage/crew/artifact-archiver/ArtifactArchiver.spec.ts
- +2 −10 packages/core/src/index.ts
- +9 −0 packages/core/src/instance.ts
- +16 −0 packages/core/src/io/proxies.ts
- +22 −0 packages/core/src/model/artifacts/HTTPRequestResponse.ts
- +8 −0 packages/core/src/model/artifacts/TestReport.ts
- +2 −0 packages/core/src/model/artifacts/index.ts
- +7 −18 packages/core/src/screenplay/Interaction.ts
- +8 −0 packages/core/src/screenplay/KnowableUnknown.ts
- +0 −6 packages/core/src/screenplay/KnownUnknown.ts
- +3 −2 packages/core/src/screenplay/activities/ActivityDescriber.ts
- +8 −4 packages/core/src/screenplay/activities/TrackedActivity.ts
- +44 −23 packages/core/src/screenplay/actor/Actor.ts
- +2 −2 packages/core/src/screenplay/actor/AnswersQuestions.ts
- +19 −0 packages/core/src/screenplay/actor/CollectsArtifacts.ts
- +1 −0 packages/core/src/screenplay/actor/index.ts
- +1 −1 packages/core/src/screenplay/index.ts
- +4 −1 packages/core/src/stage/Clock.ts
- +34 −21 packages/core/src/stage/crew/artifact-archiver/ArtifactArchiver.ts
- +3 −3 packages/core/src/stage/crew/serenity-bdd-reporter/SerenityBDDJsonSchema.ts
- +2 −2 packages/core/src/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.ts
- +51 −12 packages/core/src/stage/crew/serenity-bdd-reporter/reports/SceneReport.ts
- +3 −2 packages/core/src/stage/crew/serenity-bdd-reporter/strategies/SceneReportingStrategy.ts
- +1 −1 packages/core/src/stage/index.ts
- +2 −1 packages/core/tsconfig.json
- +2 −1 packages/cucumber/tsconfig.json
- +1 −0 packages/rest/.esdoc.js
- +9 −0 packages/rest/.gitignore
- +14 −0 packages/rest/.npmignore
- +201 −0 packages/rest/LICENSE.md
- +1 −0 packages/rest/NOTICE.md
- +39 −0 packages/rest/README.md
- +82 −0 packages/rest/package.json
- +3 −0 packages/rest/register.js
- +14 −0 packages/rest/spec/actors.ts
- +6 −0 packages/rest/spec/expect.ts
- +37 −0 packages/rest/spec/model/DeleteRequest.spec.ts
- +37 −0 packages/rest/spec/model/GetRequest.spec.ts
- +37 −0 packages/rest/spec/model/HeadRequest.spec.ts
- +37 −0 packages/rest/spec/model/OptionsRequest.spec.ts
- +51 −0 packages/rest/spec/model/PatchRequest.spec.ts
- +42 −0 packages/rest/spec/model/PostRequest.spec.ts
- +51 −0 packages/rest/spec/model/PutRequest.spec.ts
- +180 −0 packages/rest/spec/screenplay/abilities/CallAnApi.spec.ts
- +120 −0 packages/rest/spec/screenplay/interactions/Send.spec.ts
- +70 −0 packages/rest/spec/screenplay/questions/LastResponse.spec.ts
- +2 −0 packages/rest/src/index.ts
- +69 −0 packages/rest/src/model/DeleteRequest.ts
- +71 −0 packages/rest/src/model/GetRequest.ts
- +77 −0 packages/rest/src/model/HTTPRequest.ts
- +61 −0 packages/rest/src/model/HeadRequest.ts
- +62 −0 packages/rest/src/model/OptionsRequest.ts
- +72 −0 packages/rest/src/model/PatchRequest.ts
- +111 −0 packages/rest/src/model/PostRequest.ts
- +84 −0 packages/rest/src/model/PutRequest.ts
- +8 −0 packages/rest/src/model/index.ts
- +168 −0 packages/rest/src/screenplay/abilities/CallAnApi.ts
- +1 −0 packages/rest/src/screenplay/abilities/index.ts
- +3 −0 packages/rest/src/screenplay/index.ts
- +76 −0 packages/rest/src/screenplay/interactions/Send.ts
- +1 −0 packages/rest/src/screenplay/interactions/index.ts
- +75 −0 packages/rest/src/screenplay/questions/LastResponse.ts
- +1 −0 packages/rest/src/screenplay/questions/index.ts
- +10 −0 packages/rest/tsconfig-lint.json
- +22 −0 packages/rest/tsconfig.json
- +1 −1 scripts/travis/script.sh
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -2,6 +2,9 @@ | ||
.idea | ||
*.iml | ||
|
||
# Serenity BDD | ||
*.jar | ||
|
||
# OS | ||
.DS_Store | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -39,6 +39,7 @@ | ||
"@serenity-js/assertions": "*", | ||
"@serenity-js/core": "*", | ||
"@serenity-js/cucumber": "*", | ||
"@serenity-js/rest": "*", | ||
"cheerio": "1.0.0-rc.2", | ||
"clean-css": "4.2.1", | ||
"glob": "7.1.3", | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,24 @@ | ||
const | ||
port = process.env.PORT || 3000, | ||
runningInDevMode = `${ process.env.NODE_ENV }`.toLocaleLowerCase() === 'test'; | ||
|
||
(runningInDevMode ? inMemoryServer() : compiledServer()) | ||
.use(require('morgan')('combined')) | ||
.listen(port, () => console.log(`Calculator server started on port ${ port }`)); | ||
|
||
// --- | ||
|
||
function inMemoryServer() { | ||
require('ts-node/register'); | ||
return require('./src/rest-api'); | ||
} | ||
|
||
function compiledServer() { | ||
try { | ||
return require('./lib/rest-api'); | ||
} | ||
catch(e) { | ||
console.error('Remember to compile the module before trying to start the server: npm run compile'); | ||
process.exit(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,10 @@ | ||
{ | ||
"ignore": [ | ||
"spec/**/*.ts", | ||
"node_modules" | ||
], | ||
"watch": [ | ||
"src" | ||
], | ||
"ext": "ts" | ||
} |
Oops, something went wrong.