diff --git a/.github/workflows/diagrams.yml b/.github/workflows/diagrams.yml index b198ab7..0f89e17 100644 --- a/.github/workflows/diagrams.yml +++ b/.github/workflows/diagrams.yml @@ -6,56 +6,55 @@ permissions: on: push: branches: [main] - pull_request: workflow_dispatch: jobs: build: runs-on: ubuntu-latest - + steps: - - name: Get the code from the repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Create error logs directory - run: mkdir -p error-logs - - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - - - name: Set execute permissions on build scripts - run: chmod +x tools/generate/generate-plantuml-diagrams.sh || true - - - name: Debug script presence - run: | - ls -l tools/generate/ - file tools/generate/generate-plantuml-diagrams.sh - head -5 tools/generate/generate-plantuml-diagrams.sh - - - name: Install Graphviz - run: sudo apt-get install -y graphviz - - - name: Set up Git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - - name: Update .svg - run: ./tools/generate/generate-plantuml-diagrams.sh - - - name: Add SVG files - run: git add *.svg - - - name: Commit and push if there are changes - run: | - if ! git diff --cached --quiet; then - git commit -m "Update diagrams" - git push origin HEAD:main - else - echo "No changes to SVG files" - fi \ No newline at end of file + - name: Get the code from the repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create error logs directory + run: mkdir -p error-logs + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: "21" + distribution: "temurin" + + - name: Set execute permissions on build scripts + run: chmod +x tools/generate/generate-plantuml-diagrams.sh || true + + - name: Debug script presence + run: | + ls -l tools/generate/ + file tools/generate/generate-plantuml-diagrams.sh + head -5 tools/generate/generate-plantuml-diagrams.sh + + - name: Install Graphviz + run: sudo apt-get install -y graphviz + + - name: Set up Git user + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Update .svg + run: ./tools/generate/generate-plantuml-diagrams.sh + + - name: Add SVG files + run: git add *.svg + + - name: Commit and push if there are changes + run: | + if ! git diff --cached --quiet; then + git commit -m "Update diagrams" + git push origin main + else + echo "No changes to SVG files" + fi diff --git a/docs/global-artifacts/01.requirements-engineering/puml/use-case-diagram.puml b/docs/global-artifacts/01.requirements-engineering/puml/use-case-diagram.puml index b5aae8d..8827de9 100644 --- a/docs/global-artifacts/01.requirements-engineering/puml/use-case-diagram.puml +++ b/docs/global-artifacts/01.requirements-engineering/puml/use-case-diagram.puml @@ -1,13 +1,13 @@ -@startuml Use Case Diagram for Melmac Performance Testing Framework +@startuml use-case-diagram left to right direction actor "Developer or CI/CD Pipeline" as Dev rectangle "Melmac Performance Testing Framework" { - usecase "UC1: Create Test Suite" as UC1 - usecase "UC2: Create Test Plan" as UC2 - usecase "UC3: Run Test Suite" as UC3 - usecase "UC4: Run Test Plan" as UC4 + usecase "UC1: As a Developer, I want to create a Test Suite" as UC1 + usecase "UC2: As a Developer, I want to create a Test Plan" as UC2 + usecase "UC3: As a Developer, I want to run a Test Suite" as UC3 + usecase "UC4: As a Developer, I want to run a Test Plan" as UC4 } Dev --> UC1 diff --git a/docs/global-artifacts/03.design/implementation-view/level-2/drawio/L2-IV.drawio b/docs/global-artifacts/03.design/implementation-view/level-2/drawio/L2-IV.drawio index 771d5b5..b6d7518 100644 --- a/docs/global-artifacts/03.design/implementation-view/level-2/drawio/L2-IV.drawio +++ b/docs/global-artifacts/03.design/implementation-view/level-2/drawio/L2-IV.drawio @@ -15,10 +15,10 @@ - + - + diff --git a/docs/global-artifacts/03.design/implementation-view/level-2/svg/L2-IV.svg b/docs/global-artifacts/03.design/implementation-view/level-2/svg/L2-IV.svg index a43b894..98ed6fc 100644 --- a/docs/global-artifacts/03.design/implementation-view/level-2/svg/L2-IV.svg +++ b/docs/global-artifacts/03.design/implementation-view/level-2/svg/L2-IV.svg @@ -1 +1 @@ -Melmac Performance Testing FrameworkMelmac Performance Testing FrameworkMelmacBEMelmacBEDriverRunner (iOS)DriverRunner (iOS)Text is not SVG - cannot display \ No newline at end of file +Melmac Performance Testing FrameworkMelmac Performance Testing FrameworkMelmacBEMelmacBEDriverRunner (iOS)DriverRunner (iOS)Text is not SVG - cannot display \ No newline at end of file diff --git a/docs/global-artifacts/03.design/logical-view/level-3/drawio/L3-LV-MelmacBE-ALT.drawio b/docs/global-artifacts/03.design/logical-view/level-3/drawio/L3-LV-MelmacBE-ALT.drawio new file mode 100644 index 0000000..39411ce --- /dev/null +++ b/docs/global-artifacts/03.design/logical-view/level-3/drawio/L3-LV-MelmacBE-ALT.drawio @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/global-artifacts/03.design/logical-view/level-3/svg/L3-LV-MelmacBE-ALT.svg b/docs/global-artifacts/03.design/logical-view/level-3/svg/L3-LV-MelmacBE-ALT.svg new file mode 100644 index 0000000..0b8aa2c --- /dev/null +++ b/docs/global-artifacts/03.design/logical-view/level-3/svg/L3-LV-MelmacBE-ALT.svg @@ -0,0 +1 @@ +<<Component>><<Container (C4)>>MelmacBE<<Component>>...<<Component>>Routing<<Component>>...<<Component>>Execution Coordinator<<Component>>...MelmacBE APIMelmacBE API<<Component>>Execution Dispatcher<<Component>>...<<Component>>Platform Execution Engine<<Component>>...AUT (iOS)AUT (iOS)AUT (Android)AUT (Android)iOS DeviceiOS DeviceAndroid DeviceAndroid DeviceDriverRunner BridgeDriverRunner Br...<<Component>>Repository<<Component>>...SQL ServerSQL ServerText is not SVG - cannot display \ No newline at end of file diff --git a/docs/use-cases/UC01/puml/L1-PV-UC01.puml b/docs/use-cases/UC01/puml/L1-PV-UC01.puml new file mode 100644 index 0000000..bf8fa81 --- /dev/null +++ b/docs/use-cases/UC01/puml/L1-PV-UC01.puml @@ -0,0 +1,45 @@ +@startuml L1-PV-UC01 + +title Level 1 - Create Test Suite + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +participant "System" as System +participant "<>\nDatabase" as DB + +activate D +D -> System: Requests to create a new Test Suite +activate System +System -> DB: Asks to save Test Suite +activate DB +DB --> DB: Saves Test Suite +DB --> System: Returns saved Test Suite ID +deactivate DB +System -> DB: Asks to find latest Test Suite Version by Test Suite ID +activate DB +DB --> DB: Finds latest Test Suite Version ID +DB --> System: Returns latest Test Suite Version ID +deactivate DB +System -> DB: Asks to save Test Suite Version +activate DB +DB --> DB: Saves Test Suite Version +DB --> System: Returns saved Test Suite Version ID +deactivate DB +System --> D: Confirms creation of Test Suite +deactivate System + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC01/puml/L2-PV-UC01.puml b/docs/use-cases/UC01/puml/L2-PV-UC01.puml new file mode 100644 index 0000000..b2d53d9 --- /dev/null +++ b/docs/use-cases/UC01/puml/L2-PV-UC01.puml @@ -0,0 +1,47 @@ +@startuml L2-PV-UC01 + +title Level 2 - Create Test Suite + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> Melmac Performance Testing Framework" + participant "<>\nMelmacBE" as BE +end box +participant "<>\nDatabase" as DB + +activate D +D -> BE: Requests to create a new Test Suite +activate BE +BE -> DB: Asks to save Test Suite +activate DB +DB --> DB: Saves Test Suite +DB --> BE: Returns saved Test Suite ID +deactivate DB +BE -> DB: Asks to find latest Test Suite Version by Test Suite ID +activate DB +DB --> DB: Finds latest Test Suite Version ID +DB --> BE: Returns latest Test Suite Version ID +deactivate DB +BE -> DB: Asks to save Test Suite Version +activate DB +DB --> DB: Saves Test Suite Version +DB --> BE: Returns saved Test Suite Version ID +deactivate DB +BE --> D: Confirms creation of Test Suite +deactivate BE + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC01/puml/L3-PV-UC01.puml b/docs/use-cases/UC01/puml/L3-PV-UC01.puml new file mode 100644 index 0000000..1bd4833 --- /dev/null +++ b/docs/use-cases/UC01/puml/L3-PV-UC01.puml @@ -0,0 +1,90 @@ +@startuml L3-PV-UC01 + +title Level 3 - Create Test Suite (MelmacBE) + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> MelmacBE" + participant "<>\nTestSuiteController" as Controller + participant "<>\nTestSuiteService" as Service + participant "<>\nTestSuite" as TestSuite + participant "<>\nTestSuiteRepository" as SuiteRepo + participant "<>\nTestSuiteVersion" as TestSuiteVersion + participant "<>\nTestSuiteVersionRepository" as VersionRepo + participant "<>\nTestSuiteMapper" as Mapper + participant "<>\nTestSuiteResponseDTO" as ResponseDTO +end box +participant "<>\nDatabase" as DB + + +activate D +D -> Controller: Asks to create a new Test Suite +activate Controller +Controller -> Service: createTestSuite(TestSuiteRequestDTO) +activate Service +Service -> TestSuite: create(TestSuiteRequestDTO) +activate TestSuite +TestSuite --> TestSuite: Validates and initializes TestSuite +TestSuite --> Service: returns TestSuite +deactivate TestSuite +Service -> SuiteRepo: save(TestSuite) +activate SuiteRepo +SuiteRepo -> DB: Query to save TestSuite +activate DB +DB --> DB: Saves TestSuite +DB --> SuiteRepo: returns saved TestSuiteId +deactivate DB +SuiteRepo --> Service: returns TestSuiteId +deactivate SuiteRepo +Service -> SuiteRepo: findLatestVersionByTestSuiteId(TestSuiteId) +activate SuiteRepo +SuiteRepo -> DB: Query to find latest TestSuiteVersion by TestSuiteId +activate DB +DB --> DB: Finds latest TestSuiteVersionId +DB --> SuiteRepo: returns latest TestSuiteVersionId +deactivate DB +SuiteRepo --> Service: returns latest TestSuiteVersionId +deactivate SuiteRepo +Service -> TestSuiteVersion: create(TestSuiteVersionParams, TestSuiteVersionId + 1, TestSuiteId) +activate TestSuiteVersion +TestSuiteVersion --> TestSuiteVersion: Validates and initializes TestSuiteVersion +TestSuiteVersion --> Service: returns TestSuiteVersion +deactivate TestSuiteVersion +Service -> VersionRepo: save(TestSuiteVersion) +activate VersionRepo +VersionRepo -> DB: Query to save TestSuiteVersion +activate DB +DB --> DB: Saves TestSuiteVersion +DB --> VersionRepo: returns saved TestSuiteVersion +deactivate DB +VersionRepo --> Service: returns TestSuiteVersion +deactivate VersionRepo +Service -> Mapper: toDTO(TestSuite) +activate Mapper +Mapper --> ResponseDTO: create(TestSuite) +activate ResponseDTO +ResponseDTO --> Mapper: returns TestSuiteResponseDTO +deactivate ResponseDTO +Mapper --> Service: returns TestSuiteResponseDTO +deactivate Mapper +Service --> Controller: TestSuiteResponseDTO +deactivate Service +Controller --> D: TestSuiteResponseDTO (created) +deactivate Controller +deactivate D + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC02/puml/L1-PV-UC02.puml b/docs/use-cases/UC02/puml/L1-PV-UC02.puml new file mode 100644 index 0000000..da03b14 --- /dev/null +++ b/docs/use-cases/UC02/puml/L1-PV-UC02.puml @@ -0,0 +1,45 @@ +@startuml L1-PV-UC02 + +title Level 1 - Create Test Plan + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +participant "System" as System +participant "<>\nDatabase" as DB + +activate D +D -> System: Requests to create a new Test Plan +activate System +System -> DB: Asks to save Test Plan +activate DB +DB --> DB: Saves Test Plan +DB --> System: Returns saved Test Plan ID +deactivate DB +System -> DB: Asks to find latest Test Plan Version by Test Plan ID +activate DB +DB --> DB: Finds latest Test Plan Version ID +DB --> System: Returns latest Test Plan Version ID +deactivate DB +System -> DB: Asks to save Test Plan Version +activate DB +DB --> DB: Saves Test Plan Version +DB --> System: Returns saved Test Plan Version ID +deactivate DB +System --> D: Confirms creation of Test Plan +deactivate System + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC02/puml/L2-PV-UC02.puml b/docs/use-cases/UC02/puml/L2-PV-UC02.puml new file mode 100644 index 0000000..abf6022 --- /dev/null +++ b/docs/use-cases/UC02/puml/L2-PV-UC02.puml @@ -0,0 +1,47 @@ +@startuml L2-PV-UC02 + +title Level 2 - Create Test Plan + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> Melmac Performance Testing Framework" + participant "<>\nMelmacBE" as BE +end box +participant "<>\nDatabase" as DB + +activate D +D -> BE: Requests to create a new Test Plan +activate BE +BE -> DB: Asks to save Test Plan +activate DB +DB --> DB: Saves Test Plan +DB --> BE: Returns saved Test Plan ID +deactivate DB +BE -> DB: Asks to find latest Test Plan Version by Test Plan ID +activate DB +DB --> DB: Finds latest Test Plan Version ID +DB --> BE: Returns latest Test Plan Version ID +deactivate DB +BE -> DB: Asks to save Test Plan Version +activate DB +DB --> DB: Saves Test Plan Version +DB --> BE: Returns saved Test Plan Version ID +deactivate DB +BE --> D: Confirms creation of Test Plan +deactivate BE + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC02/puml/L3-PV-UC02-Part1.puml b/docs/use-cases/UC02/puml/L3-PV-UC02-Part1.puml new file mode 100644 index 0000000..c0789c4 --- /dev/null +++ b/docs/use-cases/UC02/puml/L3-PV-UC02-Part1.puml @@ -0,0 +1,190 @@ +@startuml L3-PV-UC02-Part1 + +title Level 3 - Create Test Plan (MelmacBE) - Part 1 + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> MelmacBE" + participant "<>\nTestPlanController" as Controller + participant "<>\nTestPlanService" as Service + participant "<>\nMetricRepository" as MetricRepo + participant "<>\nTestPlan" as TestPlan + participant "<>\nTestPlanRepository" as PlanRepo + participant "<>\nDeviceService" as DeviceService + participant "<>\nOSRepository" as OSRepo + participant "<>\nOSVersionRepository" as OSVersionRepo + participant "<>\nDeviceRepository" as DeviceRepo + participant "<>\nAppRepository" as AppRepo + participant "<>\nAppVersionRepository" as AppVersionRepo +end box +participant "<>\nDatabase" as DB + +activate D +D -> Controller: Asks to create a new Test Plan +activate Controller +Controller -> Service: createTestPlan(TestPlanVersionRequestDTO) +activate Service +Service -> MetricRepo: findByName(MetricName) +activate MetricRepo +MetricRepo -> DB: Query to find Metric by name +activate DB +DB --> DB: Finds Metric +DB --> MetricRepo: returns Metric +deactivate DB +MetricRepo --> Service: returns Metric +deactivate MetricRepo +Service -> TestPlan: create(TestPlanVersionRequestDTO, Metric) +activate TestPlan +TestPlan --> TestPlan: Validates and initializes TestPlan +TestPlan --> Service: returns TestPlan +deactivate TestPlan +Service -> PlanRepo: save(TestPlan) +activate PlanRepo +PlanRepo -> DB: Query to save TestPlan +activate DB +DB --> DB: Saves TestPlan +DB --> PlanRepo: returns saved TestPlanId +deactivate DB +PlanRepo --> Service: returns TestPlanId +deactivate PlanRepo +Service -> DeviceService: getDeviceByName(DeviceName) +activate DeviceService +DeviceService -> DeviceService: Finds Device by name +DeviceService --> Service: returns Device +deactivate DeviceService +Service -> OSRepo: findByName(OSName) +activate OSRepo +OSRepo -> DB: Query to find OS by name +activate DB +alt OS found + DB --> DB: Finds OS + DB --> OSRepo: returns OS +else OS not found + DB --> DB: OS not found + DB --> OSRepo: returns null + deactivate DB + OSRepo --> Service: throws NotFoundException + deactivate OSRepo + Service -> OSRepo: save(OperatingSystem) + activate OSRepo + OSRepo -> DB: Query to save OperatingSystem + activate DB + DB --> DB: Saves OperatingSystem + DB --> OSRepo: returns saved OperatingSystem +end +deactivate DB +OSRepo --> Service: returns OperatingSystem +deactivate OSRepo +Service -> OSVersionRepo: searchByOperSysId(OperatingSystemId) +activate OSVersionRepo +OSVersionRepo -> DB: Query to find OSVersions by OperatingSystemId +activate DB +alt OSVersions found + DB --> DB: Finds OSVersions + DB --> OSVersionRepo: returns OSVersions +else OSVersions not found + DB --> DB: No OSVersions found + DB --> OSVersionRepo: returns empty list +end +deactivate DB +OSVersionRepo --> Service: returns list of OSVersions +deactivate OSVersionRepo +alt OSVersion is not in the list + Service -> OSVersionRepo: save(OperatingSystemVersion) + activate OSVersionRepo + OSVersionRepo -> DB: Query to save OperatingSystemVersion + activate DB + DB --> DB: Saves OperatingSystemVersion + DB --> OSVersionRepo: returns saved OperatingSystemVersion + deactivate DB +end +OSVersionRepo --> Service: returns saved OperatingSystemVersion +deactivate OSVersionRepo +Service -> DeviceRepo: findBySerialNumber(DeviceSerialNumber) +activate DeviceRepo +DeviceRepo -> DB: Query to find Device by serial number +activate DB +alt Device found + DB --> DB: Finds Device + DB --> DeviceRepo: returns Device +else Device not found + DB --> DB: Device not found + DB --> DeviceRepo: returns null + deactivate DB + DeviceRepo --> Service: throws NotFoundException + deactivate DeviceRepo + Service -> DeviceRepo: save(Device) + activate DeviceRepo + DeviceRepo -> DB: Query to save Device + activate DB + DB --> DB: Saves Device + DB --> DeviceRepo: returns saved Device + deactivate DB +end +DeviceRepo --> Service: returns Device +deactivate DeviceRepo +Service -> AppRepo: findByName(AppName) +activate AppRepo +AppRepo -> DB: Query to find App by name +activate DB +alt App found + DB --> DB: Finds App + DB --> AppRepo: returns App +else App not found + DB --> DB: App not found + DB --> AppRepo: returns null + deactivate DB + AppRepo --> Service: throws NotFoundException + deactivate AppRepo + Service -> AppRepo: save(App) + activate AppRepo + AppRepo -> DB: Query to save App + activate DB + DB --> DB: Saves App + DB --> AppRepo: returns saved App + deactivate DB +end +AppRepo --> Service: returns App +deactivate AppRepo +Service -> AppVersionRepo: searchByAppIdAndVersion(AppId, AppVersion) +activate AppVersionRepo +AppVersionRepo -> DB: Query to find AppVersions by AppId and version +activate DB +alt AppVersions found + DB --> DB: Finds AppVersions + DB --> AppVersionRepo: returns AppVersions +else AppVersions not found + DB --> DB: No AppVersions found + DB --> AppVersionRepo: returns empty list + deactivate DB + AppVersionRepo --> Service: throws NotFoundException + deactivate AppVersionRepo + Service -> AppVersionRepo: save(AppVersion) + activate AppVersionRepo + AppVersionRepo -> DB: Query to save AppVersion + activate DB + DB --> DB: Saves AppVersion + DB --> AppVersionRepo: returns saved AppVersion + deactivate DB +end +AppVersionRepo --> Service: returns AppVersion +deactivate AppVersionRepo +ref over Service + "See Test Plan Creation Part 2" at [./UC02/L3-PV-UC02-Part2.puml] +end ref + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC02/puml/L3-PV-UC02-Part2.puml b/docs/use-cases/UC02/puml/L3-PV-UC02-Part2.puml new file mode 100644 index 0000000..568363e --- /dev/null +++ b/docs/use-cases/UC02/puml/L3-PV-UC02-Part2.puml @@ -0,0 +1,184 @@ +@startuml L3-PV-UC02-Part2 + +title Level 3 - Create Test Plan (MelmacBE) + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> MelmacBE" + participant "<>\nTestPlanController" as Controller + participant "<>\nTestPlanService" as Service + participant "<>\nExecutionTypeRepository" as ExecutionTypeRepo + participant "<>\nTestPlanVersion" as TestPlanVersion + participant "<>\nTestPlanVersionRepository" as PlanVersionRepo + participant "<>\nThresholdTypeRepository" as ThresholdTypeRepo + participant "<>\nTestThresholdMapper" as ThresholdMapper + participant "<>\nTestThreshold" as TestThreshold + participant "<>\nTestThresholdRepository" as ThresholdRepo + participant "<>\nMetricParameterRepository" as MetricParameterRepo + participant "<>\nTestMetricParameterMapper" as MetricParameterMapper + participant "<>\nTestMetricParameter" as TestMetricParameter + participant "<>\nTestMetricParameterRepository" as TestMetricParameterRepo + participant "<>\nTestExecutionTypeMapper" as ExecutionTypeMapper + participant "<>\nTestExecutionType" as TestExecutionType + participant "<>\nTestExecutionTypeRepository" as TestExecutionTypeRepo + participant "<>\nTestSuiteVersionPlan" as TestSuiteVersionPlan + participant "<>\nTestSuiteVersionPlanRepository" as TestSuiteVersionPlanRepo + participant "<>\nTestPlanVersionMapper" as TestPlanVersionMapper + participant "<>\nTestPlanVersionDTO" as TestPlanVersion +end box +participant "<>\nDatabase" as DB + +activate D +activate Controller +activate Service +ref over Service + "See Test Plan Creation Part 1" at [./UC02/L3-PV-UC02-Part1.puml] +end ref +Service -> ExecutionTypeRepo: findByName(ExecutionTypeName) +activate ExecutionTypeRepo +ExecutionTypeRepo -> DB: Query to find ExecutionType by name +activate DB +DB --> DB: Finds ExecutionType +DB --> ExecutionTypeRepo: returns ExecutionType +deactivate DB +ExecutionTypeRepo --> Service: returns ExecutionType +deactivate ExecutionTypeRepo +Service -> TestPlanVersion: create(TestPlanVersionParams) +activate TestPlanVersion +TestPlanVersion --> TestPlanVersion: Validates and initializes TestPlanVersion +TestPlanVersion --> Service: returns TestPlanVersion +deactivate TestPlanVersion +Service -> PlanVersionRepo: save(TestPlanVersion) +activate PlanVersionRepo +PlanVersionRepo -> DB: Query to save TestPlanVersion +activate DB +DB --> DB: Saves TestPlanVersion +DB --> PlanVersionRepo: returns saved TestPlanVersion +deactivate DB +PlanVersionRepo --> Service: returns TestPlanVersion +deactivate PlanVersionRepo +Service -> ThresholdTypeRepo: findByName(ThresholdTypeName) +activate ThresholdTypeRepo +ThresholdTypeRepo -> DB: Query to find ThresholdType by name +activate DB +DB --> DB: Finds ThresholdType +DB --> ThresholdTypeRepo: returns ThresholdType +deactivate DB +ThresholdTypeRepo --> Service: returns ThresholdType +deactivate ThresholdTypeRepo +Service -> ThresholdMapper: fromRequestDTO(Threshold, TestPlanVersionId, ThresholdTypeId) +activate ThresholdMapper +ThresholdMapper -> TestThreshold: create(TestThreshold) +activate TestThreshold +TestThreshold --> TestThreshold: Validates and initializes TestThreshold +TestThreshold --> ThresholdMapper: returns TestThreshold +deactivate TestThreshold +ThresholdMapper --> Service: returns TestThreshold +deactivate ThresholdMapper +Service -> ThresholdRepo: save(TestThreshold) +activate ThresholdRepo +ThresholdRepo -> DB: Query to save TestThreshold +activate DB +DB --> DB: Saves TestThreshold +DB --> ThresholdRepo: returns saved TestThreshold +deactivate DB +ThresholdRepo --> Service: returns TestThreshold +deactivate ThresholdRepo +Service -> MetricParameterRepo: findByMetricIdAndName(MetricId, MetricParameterName) +activate MetricParameterRepo +MetricParameterRepo -> DB: Query to find MetricParameter by MetricId and name +activate DB +DB --> DB: Finds MetricParameter +DB --> MetricParameterRepo: returns MetricParameter +deactivate DB +MetricParameterRepo --> Service: returns MetricParameter +deactivate MetricParameterRepo +Service -> MetricParameterMapper: fromRequestDTO(TestMetricParameter, TestPlanVersionId, MetricParameterId) +activate MetricParameterMapper +MetricParameterMapper -> TestMetricParameter: create(TestMetricParameter) +activate TestMetricParameter +TestMetricParameter --> TestMetricParameter: Validates and initializes TestMetricParameter +TestMetricParameter --> MetricParameterMapper: returns TestMetricParameter +deactivate TestMetricParameter +MetricParameterMapper --> Service: returns TestMetricParameter +deactivate MetricParameterMapper +Service -> TestMetricParameterRepo: save(TestMetricParameter) +activate TestMetricParameterRepo +TestMetricParameterRepo -> DB: Query to save TestMetricParameter +activate DB +DB --> DB: Saves TestMetricParameter +DB --> TestMetricParameterRepo: returns saved TestMetricParameter +deactivate DB +TestMetricParameterRepo --> Service: returns TestMetricParameter +deactivate TestMetricParameterRepo +Service -> ExecutionTypeRepo: findByExecutionTypeIdAndName(ExecutionTypeId, ExecutionTypeName) +activate ExecutionTypeRepo +ExecutionTypeRepo -> DB: Query to find ExecutionType by ExecutionTypeId and name +activate DB +DB --> DB: Finds ExecutionType +DB --> ExecutionTypeRepo: returns ExecutionType +deactivate DB +ExecutionTypeRepo --> Service: returns ExecutionType +deactivate ExecutionTypeRepo +Service -> ExecutionTypeMapper: fromRequestDTO(TestExecutionType, TestPlanVersionId, ExecutionTypeId) +activate ExecutionTypeMapper +ExecutionTypeMapper -> TestExecutionType: create(TestExecutionType) +activate TestExecutionType +TestExecutionType --> TestExecutionType: Validates and initializes TestExecutionType +TestExecutionType --> ExecutionTypeMapper: returns TestExecutionType +deactivate TestExecutionType +ExecutionTypeMapper --> Service: returns TestExecutionType +deactivate ExecutionTypeMapper +Service -> TestExecutionTypeRepo: save(TestExecutionType) +activate TestExecutionTypeRepo +TestExecutionTypeRepo -> DB: Query to save TestExecutionType +activate DB +DB --> DB: Saves TestExecutionType +DB --> TestExecutionTypeRepo: returns saved TestExecutionType +deactivate DB +TestExecutionTypeRepo --> Service: returns TestExecutionType +deactivate TestExecutionTypeRepo +Service -> TestSuiteVersionPlan: create(TestSuiteVersionPlanParams) +activate TestSuiteVersionPlan +TestSuiteVersionPlan --> TestSuiteVersionPlan: Validates and initializes TestSuiteVersionPlan +TestSuiteVersionPlan --> Service: returns TestSuiteVersionPlan +deactivate TestSuiteVersionPlan +Service -> TestSuiteVersionPlanRepo: save(TestSuiteVersionPlan) +activate TestSuiteVersionPlanRepo +TestSuiteVersionPlanRepo -> DB: Query to save TestSuiteVersionPlan +activate DB +DB --> DB: Saves TestSuiteVersionPlan +DB --> TestSuiteVersionPlanRepo: returns saved TestSuiteVersionPlan +deactivate DB +TestSuiteVersionPlanRepo --> Service: returns TestSuiteVersionPlan +deactivate TestSuiteVersionPlanRepo +Service -> TestPlanVersionMapper: toDTO(TestPlanVersion) +activate TestPlanVersionMapper +TestPlanVersionMapper -> TestPlanVersion: create(TestPlanVersion) +activate TestPlanVersion +TestPlanVersion --> TestPlanVersion: Validates and initializes TestPlanVersion +TestPlanVersion --> TestPlanVersionMapper: returns TestPlanVersion +deactivate TestPlanVersion +TestPlanVersionMapper --> Service: returns TestPlanVersion +deactivate TestPlanVersionMapper +Service -> Controller: returns TestPlanVersionResponseDTO +deactivate Service +Controller --> D: Confirms Test Plan creation +deactivate Controller +deactivate D + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC03/puml/L1-PV-UC03.puml b/docs/use-cases/UC03/puml/L1-PV-UC03.puml new file mode 100644 index 0000000..65b07d7 --- /dev/null +++ b/docs/use-cases/UC03/puml/L1-PV-UC03.puml @@ -0,0 +1,40 @@ +@startuml L1-PV-UC03 + +title Level 1 - Run Test Suite + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +participant "System" as System +participant "<>\nDatabase" as DB + +activate D +D -> System: Request to run Test Suite +activate System +loop For each Test Plan + ref over System + "See Test Plan Execution" at [../UC04/L1-PV-UC04.puml] + end ref +end loop +System -> DB: Save Test Suite Execution Results +activate DB +DB --> System: Test Suite Execution Results Saved +deactivate DB +System -> D: Test Suite Execution Completed +deactivate System +deactivate D + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC03/puml/L2-PV-UC03.puml b/docs/use-cases/UC03/puml/L2-PV-UC03.puml new file mode 100644 index 0000000..6f3b691 --- /dev/null +++ b/docs/use-cases/UC03/puml/L2-PV-UC03.puml @@ -0,0 +1,42 @@ +@startuml L2-PV-UC03 + +title Level 2 - Run Test Suite + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> Melmac Performance Testing Framework" + participant "<>\nMelmacBE" as BE +end box +participant "<>\nDatabase" as DB + +activate D +D -> BE: Request to run Test Suite +activate BE +loop For each Test Plan + ref over BE + "See Test Plan Execution" at [../UC04/L2-PV-UC04.puml] + end ref +end loop +BE -> DB: Save Test Suite Execution Results +activate DB +DB --> BE: Test Suite Execution Results Saved +deactivate DB +BE -> D: Test Suite Execution Completed +deactivate BE +deactivate D + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC03/puml/L3-PV-UC03.puml b/docs/use-cases/UC03/puml/L3-PV-UC03.puml new file mode 100644 index 0000000..e328ed3 --- /dev/null +++ b/docs/use-cases/UC03/puml/L3-PV-UC03.puml @@ -0,0 +1,92 @@ +@startuml L3-PV-UC03 + +title Level 3 - Run Test Suite + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> MelmacBE" + participant "<>\nTestSuiteController" as Controller + participant "<>\nTestSuiteService" as Service + participant "<>\nTestSuiteVersionRepository" as SuiteRepo + participant "<>\nTestSuiteVersionPlanRepository" as VersionRepo + participant "<>\nTestExecutionService" as TestExecutionService + participant "<>\nSuiteExecution" as SuiteExecution + participant "<>\nSuiteExecutionRepository" as ExecutionRepo + participant "<>\nSuiteExecutionMapper" as ExecutionMapper + participant "<>\nSuiteExecutionResponseDTO" as ResponseDTO +end box +participant "<>\nDatabase" as DB + +activate D +D -> Controller: Request to run Test Suite +activate Controller +Controller -> Service: runTestSuite(TestSuiteId) +activate Service +Service -> SuiteRepo: findLatestVersionByTestSuiteId(TestSuiteId) +activate SuiteRepo +SuiteRepo -> DB: Query to find latest TestSuiteVersion by TestSuiteId +activate DB +DB --> DB: Finds latest TestSuiteVersionId +DB --> SuiteRepo: returns latest TestSuiteVersionId +deactivate DB +SuiteRepo --> Service: returns latest TestSuiteVersionId +deactivate SuiteRepo +Service -> VersionRepo: findAllByTestSuiteVersionId(TestSuiteVersionId) +activate VersionRepo +VersionRepo -> DB: Query to find all TestPlans by TestSuiteVersionId +activate DB +DB --> DB: Finds all TestPlans +DB --> VersionRepo: returns TestPlans +deactivate DB +VersionRepo --> Service: returns TestPlans +deactivate VersionRepo +loop For each Test Plan + Service -> TestExecutionService: runTestExecution(TestPlan) + activate TestExecutionService + ref over TestExecutionService + "See Test Plan Execution Part 1" at [../UC04/L3-PV-UC04-MelmacBE-Part1.puml] + "See Test Plan Execution Part 2" at [../UC04/L3-PV-UC04-MelmacBE-Part2.puml] + "See DriverRunner Execution" at [../UC04/L3-PV-UC04-DriverRunner.puml] + end ref + TestExecutionService --> Service: returns Test Plan Execution Results + deactivate TestExecutionService +end +Service -> ExecutionRepo: save(SuiteExecution) +activate ExecutionRepo +ExecutionRepo -> DB: Query to save SuiteExecution +activate DB +DB --> DB: Saves SuiteExecution +DB --> ExecutionRepo: returns saved SuiteExecution +deactivate DB +ExecutionRepo --> Service: returns saved SuiteExecution +deactivate ExecutionRepo +Service -> ExecutionMapper: toDTO(SuiteExecution) +activate ExecutionMapper +ExecutionMapper -> ResponseDTO: map(SuiteExecution) +activate ResponseDTO +ResponseDTO --> ResponseDTO: Validates and initializes SuiteExecutionResponseDTO +ResponseDTO --> ExecutionMapper: returns SuiteExecutionResponseDTO +deactivate ResponseDTO +ExecutionMapper --> Service: returns SuiteExecutionResponseDTO +deactivate ExecutionMapper +Service -> Controller: return(SuiteExecutionResponseDTO) +deactivate Service +Controller -> D: Test Suite Execution Completed +deactivate Controller +deactivate D + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC04/puml/L1-PV-UC04.puml b/docs/use-cases/UC04/puml/L1-PV-UC04.puml new file mode 100644 index 0000000..1d141ac --- /dev/null +++ b/docs/use-cases/UC04/puml/L1-PV-UC04.puml @@ -0,0 +1,90 @@ +@startuml L1-PV-UC04 + +title Level 1 - Run Test Plan + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +participant "System" as System +participant "<>\nAndroid Device" as AndroidDevice +participant "<>\nAUT (Android)" as AUTA +participant "<>\niOS Device" as iOSDevice +participant "<>\nAUT (iOS)" as AUTI +participant "<>\nDatabase" as DB + +activate D +D -> System: Request to run Test Plan +activate System +alt Test Plan for Android + System -> AndroidDevice: Boot Android Device + activate AndroidDevice + AndroidDevice --> System: Android Device Ready + deactivate AndroidDevice + System -> AndroidDevice: Install AUT on Android Device + activate AndroidDevice + AndroidDevice --> System: AUT Installed + deactivate AndroidDevice + System -> AUTA: Launch AUT on Android Device + activate AUTA + AUTA --> System: AUT Launched + deactivate AUTA + System -> AndroidDevice: Execute Test Plan Steps + activate AndroidDevice + AndroidDevice --> System: Test Plan Steps Executed + deactivate AndroidDevice + System -> AndroidDevice: Uninstall AUT from Android Device + activate AndroidDevice + AndroidDevice --> System: AUT Uninstalled + deactivate AndroidDevice + System -> AndroidDevice: Shutdown Android Device + activate AndroidDevice + AndroidDevice --> System: Android Device Shutdown + deactivate AndroidDevice +else Test Plan for iOS + System -> iOSDevice: Boot iOS Device + activate iOSDevice + iOSDevice --> System: iOS Device Ready + deactivate iOSDevice + System -> iOSDevice: Install AUT on iOS Device + activate iOSDevice + iOSDevice --> System: AUT Installed + deactivate iOSDevice + System -> AUTI: Launch AUT on iOS Device + activate AUTI + AUTI --> System: AUT Launched + deactivate AUTI + System -> iOSDevice: Execute Test Plan Steps + activate iOSDevice + iOSDevice --> System: Test Plan Steps Executed + deactivate iOSDevice + System -> iOSDevice: Uninstall AUT from iOS Device + activate iOSDevice + iOSDevice --> System: AUT Uninstalled + deactivate iOSDevice + System -> iOSDevice: Shutdown iOS Device + activate iOSDevice + iOSDevice --> System: iOS Device Shutdown + deactivate iOSDevice + end alt + System -> DB: Save Test Plan Results + activate DB + DB --> System: Results Saved + deactivate DB + System -> D: Test Plan Execution Completed + deactivate System + deactivate D + + @enduml \ No newline at end of file diff --git a/docs/use-cases/UC04/puml/L2-PV-UC04.puml b/docs/use-cases/UC04/puml/L2-PV-UC04.puml new file mode 100644 index 0000000..95b2e26 --- /dev/null +++ b/docs/use-cases/UC04/puml/L2-PV-UC04.puml @@ -0,0 +1,97 @@ +@startuml L2-PV-UC04 + +title Level 2 - Run Test Plan + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> Melmac Performance Testing Framework" + participant "<>\nMelmacBE" as BE + participant "<>\nDriverRunner" as DriverRunner +end box + +participant "<>\nAndroid Device" as AndroidDevice +participant "<>\nAUT (Android)" as AUTA +participant "<>\niOS Device" as iOSDevice +participant "<>\nAUT (iOS)" as AUTI +participant "<>\nDatabase" as DB + +activate D +D -> BE: Request to run Test Plan +activate BE +alt Test Plan for Android + BE -> AndroidDevice: Boot Android Device + activate AndroidDevice + AndroidDevice --> BE: Android Device Ready + deactivate AndroidDevice + BE -> AndroidDevice: Install AUT on Android Device + activate AndroidDevice + AndroidDevice --> BE: AUT Installed + deactivate AndroidDevice + BE -> AUTA: Launch AUT on Android Device + activate AUTA + AUTA --> BE: AUT Launched + deactivate AUTA + BE -> AndroidDevice: Execute Test Plan Steps + activate AndroidDevice + AndroidDevice --> BE: Test Plan Steps Executed + deactivate AndroidDevice + BE -> AndroidDevice: Uninstall AUT from Android Device + activate AndroidDevice + AndroidDevice --> BE: AUT Uninstalled + deactivate AndroidDevice + BE -> AndroidDevice: Shutdown Android Device + activate AndroidDevice + AndroidDevice --> BE: Android Device Shutdown + deactivate AndroidDevice +else Test Plan for iOS + BE -> iOSDevice: Boot iOS Device + activate iOSDevice + iOSDevice --> BE: iOS Device Ready + deactivate iOSDevice + BE -> iOSDevice: Install AUT on iOS Device + activate iOSDevice + iOSDevice --> BE: AUT Installed + deactivate iOSDevice + BE -> DriverRunner: Execute Test Plan Steps on iOS Device + activate DriverRunner + DriverRunner -> AUTI: Launch AUT on iOS Device + activate AUTI + AUTI --> DriverRunner: AUT Launched + deactivate AUTI + DriverRunner -> iOSDevice: Execute Test Plan Steps + activate iOSDevice + iOSDevice --> DriverRunner: Test Plan Steps Executed + deactivate iOSDevice + DriverRunner --> BE: Return results for iOS Test Plan + deactivate DriverRunner + BE -> iOSDevice: Uninstall AUT from iOS Device + activate iOSDevice + iOSDevice --> BE: AUT Uninstalled + deactivate iOSDevice + BE -> iOSDevice: Shutdown iOS Device + activate iOSDevice + iOSDevice --> BE: iOS Device Shutdown + deactivate iOSDevice + end alt +BE -> DB: Save Test Plan Results +activate DB +DB --> BE: Results Saved +deactivate DB +BE -> D: Test Plan Execution Completed +deactivate BE +deactivate D +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC04/puml/L3-PV-UC04-DriverRunner.puml b/docs/use-cases/UC04/puml/L3-PV-UC04-DriverRunner.puml new file mode 100644 index 0000000..70c588a --- /dev/null +++ b/docs/use-cases/UC04/puml/L3-PV-UC04-DriverRunner.puml @@ -0,0 +1,71 @@ +@startuml L3-PV-UC04-DriverRunner + +title Level 3 - Run Test Plan (DriverRunner) + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +participant "<>\nMelmacBE" as BE + +box "<> DriverRunner" + participant "<>\nXCUITest" as XCUITest + participant "<>\nConfigLoader" as ConfigLoader + participant "<>\nEnvironmentReader" as EnvironmentReader + participant "<>\nTestCoordinator" as TestCoordinator + participant "<>\nTestRunner" as TestRunner + participant "<>\nUIInteractionEngine" as UiInteractionEngine +end box + +participant "<>\nAUT (iOS)" as AUTI +participant "<>\niOS Device" as iOSDevice + +activate BE +BE -> XCUITest: Ask to run Test Plan +activate XCUITest +XCUITest -> ConfigLoader: Load configuration +activate ConfigLoader +ConfigLoader -> ConfigLoader: Reads configuration from xctestplan +ConfigLoader -> XCUITest: Returns configuration +deactivate ConfigLoader +XCUITest -> EnvironmentReader: Read environment variables +activate EnvironmentReader +EnvironmentReader -> EnvironmentReader: Reads environment variables +EnvironmentReader -> XCUITest: Returns environment variables +deactivate EnvironmentReader +XCUITest -> TestCoordinator: Initialize test coordinator +activate TestCoordinator +TestCoordinator -> TestCoordinator: Determines execution order +TestCoordinator -> XCUITest: Returns test execution order +deactivate TestCoordinator +XCUITest -> TestRunner: Start test execution +activate TestRunner +TestRunner -> AUTI: Launch AUT on iOS Device +activate AUTI +AUTI --> TestRunner: AUT Launched +deactivate AUTI +TestRunner -> UiInteractionEngine: Execute test steps on iOS Device +activate UiInteractionEngine +UiInteractionEngine -> iOSDevice: Interacts with iOS Device +activate iOSDevice +iOSDevice --> UiInteractionEngine: Test Steps Executed +deactivate iOSDevice +UiInteractionEngine -> TestRunner: Returns interaction results +deactivate UiInteractionEngine +TestRunner --> XCUITest: Returns test execution results +deactivate TestRunner +XCUITest --> BE: Returns results of Test Plan execution +deactivate XCUITest +deactivate BE + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC04/puml/L3-PV-UC04-MelmacBE-Part1.puml b/docs/use-cases/UC04/puml/L3-PV-UC04-MelmacBE-Part1.puml new file mode 100644 index 0000000..cf08cdc --- /dev/null +++ b/docs/use-cases/UC04/puml/L3-PV-UC04-MelmacBE-Part1.puml @@ -0,0 +1,219 @@ +@startuml L3-PV-UC04-MelmacBE-Part1 + +title Level 3 - Run Test Plan (MelmacBE) - Part 1 + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> MelmacBE" + participant "<>\nTestExecutionController" as Controller + participant "<>\nTestExecutionService" as Service + participant "<>\nTestPlanVersionRepository" as TestPlanVersionRepository + participant "<>\nTestPlanRepository" as TestPlanRepository + participant "<>\nMetricRepository" as MetricRepository + participant "<>\nExecutionTypeRepository" as ExecutionTypeRepository + participant "<>\nDeviceRepository" as DeviceRepository + participant "<>\nOsRepository" as OsRepository + participant "<>\nAppVersionRepository" as AppVersionRepository + participant "<>\nAppRepository" as AppRepository + participant "<>\nTestPlanExecutionTypeParamValueRepo" as TestPlanExecutionTypeParamValueRepo + participant "<>\nTestPlanMetricParamValueRepo" as TestPlanMetricParamValueRepo + participant "<>\nExecutionTypeParameterRepository" as ExecutionTypeParameterRepository + participant "<>\nMetricParameterRepository" as MetricParameterRepository + participant "<>\nMetricOutputRepository" as MetricOutputRepository + participant "<>\nTestThresholdRepository" as TestThresholdRepository + participant "<>\nThresholdTypeRepository" as ThresholdTypeRepository + participant "<>\nTestExecutionRepository" as TestExecutionRepository + participant "<>\nTestMetricOutputResultRepository" as TestMetricOutputResultRepository + participant "<>\nTestExecutionMapper" as TestExecutionMapper + participant "<>\nTestConfigurationDTO" as ResponseDTO + participant "<>\nTestRunner" as TestRunner +end box + +participant "<>\nDriverRunner" as DriverRunner +participant "<>\nAndroid Device" as AndroidDevice +participant "<>\nAUT (Android)" as AUTA +participant "<>\niOS Device" as iOSDevice +participant "<>\nDatabase" as DB + +activate D +D -> Controller: Asks to run Test Plan +activate Controller +Controller -> Service: runTestExecution(TestPlanVersionId) +activate Service +Service -> TestPlanVersionRepository: findById(TestPlanVersionId) +activate TestPlanVersionRepository +TestPlanVersionRepository -> DB: Query to find TestPlanVersion by Id +activate DB +DB --> DB: Finds TestPlanVersion +DB --> TestPlanVersionRepository: returns TestPlanVersion +deactivate DB +TestPlanVersionRepository --> Service: returns TestPlanVersion +deactivate TestPlanVersionRepository +Service -> TestPlanRepository: findById(TestPlanId) +activate TestPlanRepository +TestPlanRepository -> DB: Query to find TestPlan by Id +activate DB +DB --> DB: Finds TestPlan +DB --> TestPlanRepository: returns TestPlan +deactivate DB +TestPlanRepository --> Service: returns TestPlan +deactivate TestPlanRepository +Service -> MetricRepository: findById(MetricId) +activate MetricRepository +MetricRepository -> DB: Query to find Metric by Id +activate DB +DB --> DB: Finds Metric +DB --> MetricRepository: returns Metric +deactivate DB +MetricRepository --> Service: returns Metric +deactivate MetricRepository +Service -> ExecutionTypeRepository: findById(ExecutionTypeId) +activate ExecutionTypeRepository +ExecutionTypeRepository -> DB: Query to find ExecutionType by Id +activate DB +DB --> DB: Finds ExecutionType +DB --> ExecutionTypeRepository: returns ExecutionType +deactivate DB +ExecutionTypeRepository --> Service: returns ExecutionType +deactivate ExecutionTypeRepository +Service -> DeviceRepository: findById(DeviceId) +activate DeviceRepository +DeviceRepository -> DB: Query to find Device by Id +activate DB +DB --> DB: Finds Device +DB --> DeviceRepository: returns Device +deactivate DB +DeviceRepository --> Service: returns Device +deactivate DeviceRepository +Service -> OsRepository: findById(OsId) +activate OsRepository +OsRepository -> DB: Query to find Os by Id +activate DB +DB --> DB: Finds Os +DB --> OsRepository: returns Os +deactivate DB +OsRepository --> Service: returns Os +deactivate OsRepository +Service -> AppVersionRepository: findById(AppVersionId) +activate AppVersionRepository +AppVersionRepository -> DB: Query to find AppVersion by Id +activate DB +DB --> DB: Finds AppVersion +DB --> AppVersionRepository: returns AppVersion +deactivate DB +AppVersionRepository --> Service: returns AppVersion +deactivate AppVersionRepository +Service -> AppRepository: findById(AppId) +activate AppRepository +AppRepository -> DB: Query to find App by Id +activate DB +DB --> DB: Finds App +DB --> AppRepository: returns App +deactivate DB +AppRepository --> Service: returns App +deactivate AppRepository +Service -> TestPlanExecutionTypeParamValueRepo: findAllByTestPlanVersionId(TestPlanVersionId) +activate TestPlanExecutionTypeParamValueRepo +TestPlanExecutionTypeParamValueRepo -> DB: Query to find all TestPlanExecutionTypeParamValues by TestPlanVersionId +activate DB +DB --> DB: Finds all TestPlanExecutionTypeParamValues +DB --> TestPlanExecutionTypeParamValueRepo: returns TestPlanExecutionTypeParamValues +deactivate DB +TestPlanExecutionTypeParamValueRepo --> Service: returns TestPlanExecutionTypeParamValues +deactivate TestPlanExecutionTypeParamValueRepo +Service -> TestPlanMetricParamValueRepo: findAllByTestPlanVersionId(TestPlanVersionId) +activate TestPlanMetricParamValueRepo +TestPlanMetricParamValueRepo -> DB: Query to find all TestPlanMetricParamValues by TestPlanVersionId +activate DB +DB --> DB: Finds all TestPlanMetricParamValues +DB --> TestPlanMetricParamValueRepo: returns TestPlanMetricParamValues +deactivate DB +TestPlanMetricParamValueRepo --> Service: returns TestPlanMetricParamValues +deactivate TestPlanMetricParamValueRepo +loop For each Test Plan Execution Type Param Value + Service -> ExecutionTypeParameterRepository: findById(ExecutionTypeParameterId) + activate ExecutionTypeParameterRepository + ExecutionTypeParameterRepository -> DB: Query to find ExecutionTypeParameter by Id + activate DB + DB --> DB: Finds ExecutionTypeParameter + DB --> ExecutionTypeParameterRepository: returns ExecutionTypeParameter + deactivate DB + ExecutionTypeParameterRepository --> Service: returns ExecutionTypeParameter + deactivate ExecutionTypeParameterRepository +end +loop For each Test Plan Metric Param Value + Service -> MetricParameterRepository: findById(MetricParameterId) + activate MetricParameterRepository + MetricParameterRepository -> DB: Query to find MetricParameter by Id + activate DB + DB --> DB: Finds MetricParameter + DB --> MetricParameterRepository: returns MetricParameter + deactivate DB + MetricParameterRepository --> Service: returns MetricParameter + deactivate MetricParameterRepository +end +Service -> MetricOutputRepository: findByMetricId(MetricId) +activate MetricOutputRepository +MetricOutputRepository -> DB: Query to find MetricOutputs by MetricId +activate DB +DB --> DB: Finds MetricOutputs +DB --> MetricOutputRepository: returns MetricOutputs +deactivate DB +MetricOutputRepository --> Service: returns MetricOutputs +deactivate MetricOutputRepository +Service -> TestThresholdRepository: findByTestPlanVersionId(TestPlanVersionId) +activate TestThresholdRepository +TestThresholdRepository -> DB: Query to find TestThresholds by TestPlanVersionId +activate DB +DB --> DB: Finds TestThresholds +DB --> TestThresholdRepository: returns TestThresholds +deactivate DB +TestThresholdRepository --> Service: returns TestThresholds +deactivate TestThresholdRepository +loop For each Test Threshold + Service -> ThresholdTypeRepository: findById(ThresholdTypeId) + activate ThresholdTypeRepository + ThresholdTypeRepository -> DB: Query to find ThresholdType by Id + activate DB + DB --> DB: Finds ThresholdType + DB --> ThresholdTypeRepository: returns ThresholdType + deactivate DB + ThresholdTypeRepository --> Service: returns ThresholdType + deactivate ThresholdTypeRepository + Service --> Service: Joins TestThreshold with ThresholdType and MetricOutput +end +Service -> TestExecutionMapper: toConfigDTO(parameters) +activate TestExecutionMapper +TestExecutionMapper -> ResponseDTO: map(parameters) +activate ResponseDTO +ResponseDTO --> ResponseDTO: Validates and initializes TestConfigurationResponseDTO +ResponseDTO --> TestExecutionMapper: returns TestConfigurationResponseDTO +deactivate ResponseDTO +TestExecutionMapper --> Service: returns TestConfigurationResponseDTO +deactivate TestExecutionMapper +Service -> TestRunner: runTestExecution(TestConfigurationDTO) +activate TestRunner +ref over TestRunner + "See Test Plan Execution Part 2" at [../UC04/L3-PV-UC04-MelmacBE-Part2.puml] +end ref +deactivate TestRunner +deactivate Service +deactivate Controller +deactivate D + + +@enduml \ No newline at end of file diff --git a/docs/use-cases/UC04/puml/L3-PV-UC04-MelmacBE-Part2.puml b/docs/use-cases/UC04/puml/L3-PV-UC04-MelmacBE-Part2.puml new file mode 100644 index 0000000..29f9bb8 --- /dev/null +++ b/docs/use-cases/UC04/puml/L3-PV-UC04-MelmacBE-Part2.puml @@ -0,0 +1,166 @@ +@startuml L3-PV-UC04-MelmacBE-Part2 + +title Level 3 - Run Test Plan (MelmacBE) - Part 2 + +hide empty members + +skinparam class { + BackgroundColor<> #D6EAF8 + BackgroundColor<> #FDEBD0 + BackgroundColor<> #D1F2EB + BackgroundColor #FEF9E7 + ArrowColor Black +} + +skinparam package { + BackgroundColor #EBF5FB +} + +actor Developer as D + +box "<> MelmacBE" + participant "<>\nTestExecutionController" as Controller + participant "<>\nTestExecutionService" as Service + participant "<>\nTestRunner" as TestRunner + participant "<>\nDeviceManager" as DeviceManager + participant "<>\nAppManager" as AppManager + participant "<>\nAndroidTestRunner" as AndroidTestRunner + participant "<>\nTestExecutionRepository" as TestExecutionRepository + participant "<>\nTestMetricOutputResultRepository" as TestMetricOutputResultRepository + participant "<>\nTestExecutionMapper" as TestExecutionMapper + participant "<>\nTestExecutionResponseDTO" as TestExecutionResponseDTO +end box + +participant "<>\nDriverRunner" as DriverRunner +participant "<>\nAndroid Device" as AndroidDevice +participant "<>\nAUT (Android)" as AUTA +participant "<>\niOS Device" as iOSDevice +participant "<>\nDatabase" as DB + +activate D +activate Controller +activate Service +activate TestRunner +ref over TestRunner + "See Test Plan Execution Part 1" at [../UC04/L3-PV-UC04-MelmacBE-Part1.puml] +end ref +alt Test Execution for Android + TestRunner -> DeviceManager: boot(Device) + activate DeviceManager + DeviceManager -> AndroidDevice: boot(Device) + activate AndroidDevice + AndroidDevice --> DeviceManager: Android Device Ready + deactivate AndroidDevice + DeviceManager --> TestRunner: Android Device Ready + deactivate DeviceManager + TestRunner -> AppManager: install(App) + activate AppManager + AppManager -> AndroidDevice: Install App + activate AndroidDevice + AndroidDevice --> AppManager: AUT Installed + deactivate AndroidDevice + AppManager --> TestRunner: AUT Installed + deactivate AppManager + TestRunner -> AndroidTestRunner: launchAndRun(TestConfigurationDTO) + activate AndroidTestRunner + AndroidTestRunner -> AUTA: Launch AUT on Android Device + activate AUTA + AUTA --> AndroidTestRunner: AUT Launched + deactivate AUTA + AndroidTestRunner -> AndroidDevice: Execute Test Plan Steps + activate AndroidDevice + AndroidDevice --> AndroidTestRunner: Test Plan Steps Executed + deactivate AndroidDevice + AndroidTestRunner --> TestRunner: Return results for Android Test Plan + deactivate AndroidTestRunner + TestRunner -> AppManager: uninstall(App) + activate AppManager + AppManager -> AndroidDevice: Uninstall App + activate AndroidDevice + AndroidDevice --> AppManager: AUT Uninstalled + deactivate AndroidDevice + AppManager --> TestRunner: AUT Uninstalled + deactivate AppManager + TestRunner -> DeviceManager: shutdown(Device) + activate DeviceManager + DeviceManager -> AndroidDevice: Shutdown Android Device + activate AndroidDevice + AndroidDevice --> DeviceManager: Android Device Shutdown + deactivate AndroidDevice + DeviceManager --> TestRunner: Android Device Shutdown + deactivate DeviceManager +else Test Execution for iOS + TestRunner -> DeviceManager: boot(Device) + activate DeviceManager + DeviceManager -> iOSDevice: boot(Device) + activate iOSDevice + iOSDevice --> DeviceManager: iOS Device Ready + deactivate iOSDevice + DeviceManager --> TestRunner: iOS Device Ready + deactivate DeviceManager + TestRunner -> AppManager: install(App) + activate AppManager + AppManager -> iOSDevice: Install App + activate iOSDevice + iOSDevice --> AppManager: AUT Installed + deactivate iOSDevice + AppManager --> TestRunner: AUT Installed + deactivate AppManager + TestRunner -> DriverRunner: launchAndRun(TestConfigurationDTO) + activate DriverRunner + DriverRunner --> DriverRunner: Runs Test Plan Steps on iOS Device + DriverRunner --> TestRunner: Return results for iOS Test Plan + deactivate DriverRunner + TestRunner -> AppManager: uninstall(App) + activate AppManager + AppManager -> iOSDevice: Uninstall App + activate iOSDevice + iOSDevice --> AppManager: AUT Uninstalled + deactivate iOSDevice + AppManager --> TestRunner: AUT Uninstalled + deactivate AppManager + TestRunner -> DeviceManager: shutdown(Device) + activate DeviceManager + DeviceManager -> iOSDevice: Shutdown iOS Device + activate iOSDevice + iOSDevice --> DeviceManager: iOS Device Shutdown + deactivate iOSDevice + DeviceManager --> TestRunner: iOS Device Shutdown + deactivate DeviceManager +end alt +TestRunner --> Service: returns TestExecution +deactivate TestRunner +Service -> TestExecutionRepository: save(TestExecution) +activate TestExecutionRepository +TestExecutionRepository -> DB: Query to save TestExecution +activate DB +DB --> DB: Saves TestExecution +DB --> TestExecutionRepository: returns saved TestExecution +deactivate DB +TestExecutionRepository --> Service: returns TestExecution +deactivate TestExecutionRepository +Service -> TestMetricOutputResultRepository: saveAll(TestMetricOutputResults) +activate TestMetricOutputResultRepository +TestMetricOutputResultRepository -> DB: Query to save TestMetricOutputResults +activate DB +DB --> DB: Saves TestMetricOutputResults +DB --> TestMetricOutputResultRepository: returns saved TestMetricOutputResults +deactivate DB +TestMetricOutputResultRepository --> Service: returns TestMetricOutputResults +deactivate TestMetricOutputResultRepository +Service -> TestExecutionMapper: toDTO(TestExecution) +activate TestExecutionMapper +TestExecutionMapper -> TestExecutionResponseDTO: map(TestExecution) +activate TestExecutionResponseDTO +TestExecutionResponseDTO --> TestExecutionResponseDTO: Validates and initializes TestExecutionResponseDTO +TestExecutionResponseDTO --> TestExecutionMapper: returns TestExecutionResponseDTO +deactivate TestExecutionResponseDTO +TestExecutionMapper --> Service: returns TestExecutionResponseDTO +deactivate TestExecutionMapper +Service --> Controller: TestExecutionResponseDTO +deactivate Service +Controller --> D: Confirmation of Test Plan Execution +deactivate Controller +deactivate D + +@enduml \ No newline at end of file diff --git a/script.txt b/script.txt new file mode 100644 index 0000000..5648ed0 --- /dev/null +++ b/script.txt @@ -0,0 +1,80 @@ +# 1. Create Test Suite +curl -X POST http://localhost:8080/test-suites \ + -H "Content-Type: application/json" \ + -d '{ + "testSuiteName": "My Test Suite", + "testSuiteDescription": "Description of my test suite" + }' + +# 2. Create Android Test Plan +curl -X POST http://localhost:8080/test-plans \ + -H "Content-Type: application/json" \ + -d '{ + "notes": "Test plan for Android", + "testName": "Android Startup Time", + "metricName": "App Startup Time", + "deviceName": "Medium_Phone_API_35", + "appName": "Alfie.apk", + "appVersion": "0.8.0", + "appPackage": "au.com.alfie.ecomm.debug", + "mainActivity": "au.com.alfie.ecomm.MainActivity", + "executionType": "Cold Start", + "thresholds": [ + { + "targetValue": 20000, + "thresholdType": "Max", + "metricOutputMetricOutputId": 1 + } + ], + "metricParameters": [ + { + "parameterValue": "home-tab", + "metricParameter": "elementToWaitFor" + }, + { + "parameterValue": "200000", + "metricParameter": "timeout" + } + ], + "executionTypeParameters": [], + "testSuiteVersionId": 1 + }' + +# 3. Create iOS Test Plan +curl -X POST http://localhost:8080/test-plans \ + -H "Content-Type: application/json" \ + -d '{ + "notes": "Test plan for iOS", + "testName": "iOS Startup Time", + "metricName": "App Startup Time", + "deviceName": "iPhone 16 Pro", + "appName": "Alfie.app", + "appVersion": "0.8.1", + "appPackage": "com.mindera.alfie.debug", + "executionType": "Cold Start", + "thresholds": [ + { + "targetValue": 5000, + "thresholdType": "Max", + "metricOutputMetricOutputId": 1 + } + ], + "metricParameters": [ + { + "parameterValue": "account-btn", + "metricParameter": "elementToWaitFor" + }, + { + "parameterValue": "200000", + "metricParameter": "timeout" + } + ], + "executionTypeParameters": [], + "testSuiteVersionId": 1 + }' + +# 4. Execute Test Suite +curl -X POST http://localhost:8080/test-suites/1/run + +# 5. Execute Single Test Plan +curl -X POST "http://localhost:8080/test-executions/run?testPlanVersionId=2"