Serenity BDD Trader Demo App
Home > Tag > Trading
Report generated 15-08-2024 19:49:45

Tag: Trading

3 tests |

Overview

Test Outcomes

Test Performance

Functional Coverage Overview

Features

Key Statistics

Number of Scenarios 3
Total Number of Test Cases 3
Tests Started Aug 15, 2024 19:49:39
Tests Finished Aug 15, 2024 19:49:43
Total Duration 3s
Fastest Test 313ms
Slowest Test 3s
Average Execution Time 2s
Total Execution Time 7s

Functional Coverage Details

Features

Feature Scenarios StepsText Test Cases % Pass Result Coverage
Buying and selling shares 2 Given Tom Smith is a registered trader Tom registers a client Tom Smith Tom executes a POST on the resource /client POST http://localhost:8080/api/client Tom executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/1/portfolio When he purchases 5 AAPL shares at $100 each He place order he executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/1/portfolio he executes a POST on the resource /portfolio/{portfolioId}/order POST http://localhost:8080/api/portfolio/1/order Then the response status should be (200) And he sells 3 AAPL shares for $150 each He place order he executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/1/portfolio he executes a POST on the resource /portfolio/{portfolioId}/order POST http://localhost:8080/api/portfolio/1/order Then the response status should be (200) Then he should have the following positions: | securityCode | amount | | CASH | 95000 | | AAPL | 2 | he executes a GET on the resource /client/{clientId}/portfolio/positions GET http://localhost:8080/api/client/1/portfolio/positions Given Tom Smith is a registered trader Tom registers a client Tom Smith Tom executes a POST on the resource /client POST http://localhost:8080/api/client Tom executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/4/portfolio When he purchases 5 AAPL shares at $100 each He place order he executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/4/portfolio he executes a POST on the resource /portfolio/{portfolioId}/order POST http://localhost:8080/api/portfolio/4/order Then the response status should be (200) Then he should have the following positions: | securityCode | amount | | CASH | 50000 | | AAPL | 5 | he executes a GET on the resource /client/{clientId}/portfolio/positions GET http://localhost:8080/api/client/4/portfolio/positions 2 100%
Viewing positions 1 Given the following market prices: | securityCode | price | | SNAP | 200 | | IBM | 60 | Market Forces executes a POST on the resource /stock/{securityCode}/price POST http://localhost:8080/api/stock/SNAP/price Market Forces executes a POST on the resource /stock/{securityCode}/price POST http://localhost:8080/api/stock/IBM/price And Sarah Smith is a registered trader Sarah registers a client Sarah Smith Sarah executes a POST on the resource /client POST http://localhost:8080/api/client Sarah executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/3/portfolio Given Sarah has purchased 5 SNAP shares at $100 each Sarah place order Sarah executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/3/portfolio Sarah executes a POST on the resource /portfolio/{portfolioId}/order POST http://localhost:8080/api/portfolio/3/order Then the response status should be (200) Then she should have the following position details: | securityCode | amount | totalValueInDollars | profit | | CASH | 50000 | 500.00 | 0.00 | | SNAP | 5 | 1000.00 | 500.00 | she executes a GET on the resource /client/{clientId}/portfolio/positions GET http://localhost:8080/api/client/3/portfolio/positions 1 100%

Key Statistics

Number of Scenarios 3 Total Duration 3s
Total Number of Test Cases 3 Fastest Test 313ms
Number of Manual Test Cases 0 Slowest Test 3s
Tests Started Aug 15, 2024 19:49:39 Average Execution Time 2s
Tests Finished Aug 15, 2024 19:49:43 Total Execution Time 7s

Automated Scenarios

feature Scenario Context Steps StepsText Started Total Duration Result
Buying and selling shares Buying and selling shares 4 Given Tom Smith is a registered trader When he purchases 5 AAPL shares at $100 each And he sells 3 AAPL shares for $150 each Then he should have the following positions: | securityCode | amount | |---|---| | CASH | 95000 | | AAPL | 2 | 19:49:39 3s 829ms SUCCESS
Buying and selling shares Buying shares 3 Given Tom Smith is a registered trader When he purchases 5 AAPL shares at $100 each Then he should have the following positions: | securityCode | amount | |---|---| | CASH | 50000 | | AAPL | 5 | 19:49:42 313ms SUCCESS
Viewing positions Making a profit on a single share 4 Given the following market prices: | securityCode | price | |---|---| | SNAP | 200 | | IBM | 60 | And Sarah Smith is a registered trader Given Sarah has purchased 5 SNAP shares at $100 each Then she should have the following position details: | securityCode | amount | totalValueInDollars | profit | |---|---|---|---| | CASH | 50000 | 500.00 | 0.00 | | SNAP | 5 | 1000.00 | 500.00 | 19:49:39 3s 770ms SUCCESS

Manual Tests

No manual tests were recorded
Serenity BDD version 4.1.20