Serenity BDD Trader Demo App
Report generated 15-08-2024 19:49:45

Test Results: All Tests

8 tests

Overview

Test Outcomes

Test Performance

Functional Coverage Overview

Features

Key Statistics

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

Functional Coverage Details

Features

Feature Scenarios StepsText Test Cases % Pass Result Coverage
Registering a new client 2 1: New clients need to provide their full name and email address ({firstName=Joe, lastName=, email=joe@smith.com}) Given a trader with the following details: | firstName | lastName | email | | Joe | | joe@smith.com | When the trader attempts to register with BDD Trader Tim the trader registers a client Joe null Tim the trader executes a POST on the resource /client POST http://localhost:8080/api/client Then the registration should be rejected An appropriate error code was returned 2: New clients need to provide their full name and email address ({firstName=, lastName=Smith, email=joe@smith.com}) Given a trader with the following details: | firstName | lastName | email | | | Smith | joe@smith.com | When the trader attempts to register with BDD Trader Tim the trader registers a client null Smith Tim the trader executes a POST on the resource /client POST http://localhost:8080/api/client Then the registration should be rejected An appropriate error code was returned 3: New clients need to provide their full name and email address ({firstName=Joe, lastName=Smith, email=}) Given a trader with the following details: | firstName | lastName | email | | Joe | Smith | | When the trader attempts to register with BDD Trader Tim the trader registers a client Joe Smith Tim the trader executes a POST on the resource /client POST http://localhost:8080/api/client Then the registration should be rejected An appropriate error code was returned Given a trader with the following details: | firstName | lastName | email | | Jake | Smith | jack@smith.com | When the trader registers with BDD Trader Tim the trader registers a client Jake Smith Tim the trader executes a POST on the resource /client POST http://localhost:8080/api/client Tim the trader executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/2/portfolio Then the trader should have a portfolio with $1000 in cash Then Cash account balance should be (1000.0F) Tim the trader executes a GET on the resource /client/{clientId}/portfolio GET http://localhost:8080/api/client/2/portfolio 4 100%
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%
Market news 1 Given Tim is interested in Apple When Tim views the news about AAPL Tim gets news about AAPL Tim executes a GET on the resource /api/stock/{stockid}/news GET http://localhost:8080/api/stock/AAPL/news Then Tim should only see articles related to AAPL 1 100%

Key Statistics

Number of Scenarios 6 Total Duration 3s
Total Number of Test Cases 8 Fastest Test 54ms
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 16s

Automated Scenarios

feature Scenario Context Steps StepsText Started Total Duration Result
Registering a new client New clients need to provide their full name and email address
3 passing test cases
3 Given a trader with the following details: |firstName | lastName | email| |---|---|---| | | | | When the trader attempts to register with BDD Trader Then the registration should be rejected 19:49:39 3s 182ms SUCCESS
Registering a new client New clients are given a portfolio with $1000 to start with 3 Given a trader with the following details: | firstName | lastName | email | |---|---|---| | Jake | Smith | jack@smith.com | When the trader registers with BDD Trader Then the trader should have a portfolio with $1000 in cash 19:49:41 1s 595ms SUCCESS
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
Market news Viewing news about a particular share 3 Given Tim is interested in Apple When Tim views the news about AAPL Then Tim should only see articles related to AAPL 19:49:39 3s 517ms SUCCESS

Manual Tests

No manual tests were recorded
Serenity BDD version 4.1.20