-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from jgiven/WR24
Wr24
- Loading branch information
Showing
28 changed files
with
23,001 additions
and
989 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- Refactor Application - SingleScenarioView l. 19ff | ||
- Refactor APplication - ScenarioOverview l. 123 | ||
--> involves extracting Items to new components | ||
- Fix width-problem | ||
- Implement Top bar with search bar | ||
- Create links between pages | ||
- Create Bookmark functionality | ||
- Provide a few more tests | ||
- Make sidebar inflatable |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# The HTML App of JGiven and JsGiven - Workshop Edition 2024 | ||
|
||
Please perform the following steps before our Workshop takes place. This way, we can investigate any errors which might occur | ||
during installation procedure. | ||
|
||
## Prerequisites | ||
|
||
Ensure you have the following tooling: | ||
* `npm` (https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) | ||
* Typescript | ||
* An IDE supporting Typescript (like IntelliJ ;)) | ||
* Firefox or Chrome (perhaps even both). | ||
|
||
## Installation | ||
|
||
Perform the following steps: | ||
1. Clone the repo `https://github.com/jgiven/jgiven-html-app` and checkout the branch `WR24`. | ||
|
||
The repo consists of the existing HTML App (folder `legacy`) and the new HTML App (folder `new`). | ||
|
||
2. Navigate to `new` and run `npm install` as well as `npm run build`. | ||
3. After performing `npm start` you should be able to see the new HTML App in your browser on `localhost:3000`. | ||
|
||
## Advice | ||
|
||
Have a look at JGiven (http://jgiven.org/, https://github.com/TNG/JGiven) and investigate the | ||
existing HTML-App (https://jgiven.org/jgiven-report/html5/) to get an idea on what we plan to modernize. |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,268 @@ | ||
import { repository } from "./repository"; | ||
import { ScenarioModel } from "./reportModel"; | ||
import { filterByStatus } from "./ReportFilter"; | ||
import { ScenarioStatusFilter } from "./components/ScenarioOverview/ScenarioCollectionHead"; | ||
|
||
describe("Report filter status filter", () => { | ||
const fullReport = { | ||
tagFile: { tagTypeMap: {}, tags: {} }, | ||
scenarios: [ | ||
{ | ||
className: "com.tngtech.jgiven.junit5.JUnit5ExecutorTest", | ||
name: "J Unit 5 Executor", | ||
scenarios: [ | ||
createSampleScenario({ executionStatus: "SUCCESS" }), | ||
createSampleScenario({ executionStatus: "FAILED" }) | ||
] | ||
}, | ||
{ | ||
className: "com.tngtech.jgiven.tests.TestScenarios", | ||
name: "Test Scenarios", | ||
scenarios: [createSampleScenario({ executionStatus: "FAILED" })] | ||
} | ||
] | ||
}; | ||
test("should filter by status", () => { | ||
jest.spyOn(repository, "getReport").mockReturnValue(fullReport); | ||
|
||
expect(filterByStatus(ScenarioStatusFilter.SUCCESS)).toEqual([ | ||
fullReport.scenarios[0].scenarios[0] | ||
]); | ||
}); | ||
|
||
test("should ignore undefined status", () => { | ||
jest.spyOn(repository, "getReport").mockReturnValue(fullReport); | ||
|
||
expect(filterByStatus(ScenarioStatusFilter.SUCCESS, undefined)).toEqual([ | ||
fullReport.scenarios[0].scenarios[0] | ||
]); | ||
}); | ||
|
||
test("should return the full report if no status is provided", () => { | ||
jest.spyOn(repository, "getReport").mockReturnValue(fullReport); | ||
|
||
expect(filterByStatus()).toEqual(fullReport.scenarios.flatMap(s => s.scenarios)); | ||
}); | ||
|
||
test("should return the full report if null is provided", () => { | ||
jest.spyOn(repository, "getReport").mockReturnValue(fullReport); | ||
|
||
expect(filterByStatus(undefined)).toEqual(fullReport.scenarios.flatMap(s => s.scenarios)); | ||
}); | ||
}); | ||
|
||
function createSampleScenario(scenario: Partial<ScenarioModel>): ScenarioModel { | ||
return { | ||
className: "com.tngtech.jgiven.junit5.JUnit5ExecutorTest", | ||
testMethodName: "after_stage_methods_of_stages_following_failing_stages_are_ignored", | ||
description: "after stage methods of stages following failing stages are ignored", | ||
tagIds: ["com.tngtech.jgiven.tags.FeatureJUnit5"], | ||
explicitParameters: [], | ||
derivedParameters: [], | ||
scenarioCases: [ | ||
{ | ||
caseNr: 1, | ||
steps: [ | ||
{ | ||
name: "a failing test with $ steps", | ||
words: [ | ||
{ | ||
value: "Given", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "a failing test with" | ||
}, | ||
{ | ||
value: "2", | ||
argumentInfo: { | ||
argumentName: "n", | ||
formattedValue: "2" | ||
} | ||
}, | ||
{ | ||
value: "steps" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 429103, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "the test has $ failing stages", | ||
words: [ | ||
{ | ||
value: "and", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "the test has" | ||
}, | ||
{ | ||
value: "2", | ||
argumentInfo: { | ||
argumentName: "n", | ||
formattedValue: "2" | ||
} | ||
}, | ||
{ | ||
value: "failing stages" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 413003, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "stage $ has a failing after stage method", | ||
words: [ | ||
{ | ||
value: "and", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "stage" | ||
}, | ||
{ | ||
value: "2", | ||
argumentInfo: { | ||
argumentName: "i", | ||
formattedValue: "2" | ||
} | ||
}, | ||
{ | ||
value: "has a failing after stage method" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 297902, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "step $ fails", | ||
words: [ | ||
{ | ||
value: "and", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "step" | ||
}, | ||
{ | ||
value: "1", | ||
argumentInfo: { | ||
argumentName: "i", | ||
formattedValue: "1" | ||
} | ||
}, | ||
{ | ||
value: "fails" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 1022008, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "the test is executed with JUnit5", | ||
words: [ | ||
{ | ||
value: "When", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "the test is executed with JUnit5" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 518574231, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "the test fails", | ||
words: [ | ||
{ | ||
value: "Then", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "the test fails" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 1932714, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "step $ is reported as failed", | ||
words: [ | ||
{ | ||
value: "and", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "step" | ||
}, | ||
{ | ||
value: "1", | ||
argumentInfo: { | ||
argumentName: "i", | ||
formattedValue: "1" | ||
} | ||
}, | ||
{ | ||
value: "is reported as failed" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 1136408, | ||
depth: 0, | ||
parentFailed: false | ||
}, | ||
{ | ||
name: "step $ is reported as skipped", | ||
words: [ | ||
{ | ||
value: "and", | ||
isIntroWord: true | ||
}, | ||
{ | ||
value: "step" | ||
}, | ||
{ | ||
value: "2", | ||
argumentInfo: { | ||
argumentName: "i", | ||
formattedValue: "2" | ||
} | ||
}, | ||
{ | ||
value: "is reported as skipped" | ||
} | ||
], | ||
status: "PASSED", | ||
durationInNanos: 287102, | ||
depth: 0, | ||
parentFailed: false | ||
} | ||
], | ||
explicitArguments: [], | ||
derivedArguments: [], | ||
status: "SUCCESS", | ||
durationInNanos: 525725382 | ||
} | ||
], | ||
casesAsTable: false, | ||
durationInNanos: 525725382, | ||
executionStatus: "SUCCESS", | ||
tags: [{}], | ||
classTitle: "J Unit 5 Executor", | ||
...scenario | ||
}; | ||
} |
Oops, something went wrong.