Skip to content

Integration Tests

Soul Raj Joshi edited this page Dec 2, 2016 · 44 revisions

Here are the tests :)

1. Test Case ID: T1

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the login screen is displayed
Test Data: The URL of the site is input into the address bar of the web browser
Expected Result: The login page is displayed
Steps: i) Enter the URL of the site
Pre-conditions: i) node server is running, ii) mongodb instance is running, iii) exchange_simulator server is running
Post-conditions: i) Waiting for user to input login information

Result: PASS

Test T1

2. Test Case ID: T2

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the signup form is displayed
Test Data: None
Expected Result: The signup form is displayed
Steps: i) Click on the "Signup" link on the login page
Pre-conditions: i) node server is running, ii) mongodb instance is running, iii) exchange_simulator server is running
Post-conditions: i) Waiting for the user to input email and password to signup

Result: PASS

Test T2

3. Test Case ID: T3

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the user can signup as a new user
Test Data: Email and Password is input into the corresponding fields on the signup form
Expected Result: User's login information is stored in the database and the login page is displayed
Steps: i) Click the "Signup" link on the login page, ii) Enter the email and password in the corresponding fields of the signup form, iii) Press the "Signup" button
Pre-conditions: i) node server is running, ii) mongodb instance is running, iii) exchange_simulator server is running
Post-conditions: i) Waiting for user to log in using the account created

Result: PASS

Test T3

4. Test Case ID: T4

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the user can login
Test Data: Email and Password is input into the corresponding fields on the login form
Expected Result: User is able to log in and the dashboard is displayed
Steps: i) Enter the email and password in the corresponding fields of the login form, ii) Click the "Login" button
Pre-conditions: i) User's login information is stored in the database, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) User is logged in and the dashboard is displayed

Result: PASS

Test T4

5. Test Case ID: T5

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the dashboard is displayed correctly
Test Data: None
Expected Result: All the elements of the dashboard page are displayed correctly
Steps: i) Login to the site by entering a valid username and password, and pressing the "Login" button on the login page
Pre-conditions: i) User is logged in, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) Waiting for the user to submit an order

Result: PASS

Test T5

6. Test Case ID: T6

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the graph of ETF top bids over time is working correctly on the dashboard
Test Data: The ETF top bids from the server
Expected Result: The data is displayed correctly and the user is able to hover over a data-point in the graph to get more detail
Steps: i) User is logged in to the site and is on the dashboard page
Pre-conditions: i) User is logged in, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) Waiting for the user to submit an order

Result: PASS

Test T6

7. Test Case ID: T7

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the order history is clean for a new user
Test Data: The order history of a new user in the database
Expected Result: The order history is empty, i.e. no previous orders are displayed in the "Past Trades" page
Steps: i) Click the "Signup" link on the Login page, ii) Enter the email and password and click the "Signup" button on the Signup page to register a new user, iii) Login to the site by entering the email and password of the new user account and clicking the "Login" button on the Login page, iv) Click on the "Past Trades" link on the sidebar
Pre-conditions: i) User is logged in using a new account, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) The order history is displayed to the user

Result: PASS

Test T7

8. Test Case ID: T8

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the user can input an amount into the input box in the "Place Trade" section of the dashboard
Test Data: An amount is typed into the input box in the "Place Trade" section of the dashboard
Expected Result: The user is able to input an amount in the "Place Trade" section of the dashboard
Steps: i) Login to the site, ii) Enter an amount on the input box in the "Place Trade" section of the dashboard page
Pre-conditions: i) User is logged in, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) Waiting for user to click the "Add Trade" button

Result: PASS

Test T8

9. Test Case ID: T9

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether a confirmation message is displayed when the user adds a trade
Test Data: An amount is input by the user to add a new trade
Expected Result: A confirmation message is displayed, asking the user to either confirm or cancel the trade
Steps: i) Login to the site, ii) Enter an amount on the input box in the "Place Trade" section of the dasboard page, iii) Click the "Add Trade" button
Pre-conditions: i) User is logged in, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) Waiting for the user to confirm or cancel the trade

Result: PASS

Test T9

10. Test Case ID: T10

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether a newly added trade is displayed in the "5 Most Recent Trades" section of the dashboard
Test Data: The trade history of the user
Expected Result: The newly added trade is divided properly and displayed in the "5 Most Recent Trades" section of the dashboard
Steps: i) Login to the site, ii) Enter a valid amount in the input box in the "Place Trade" section of the dashboard page, iii) Click the "Add Trade" button, iv) Click the "OK" button to confirm adding the trade
Pre-conditions: i) User is logged in, ii) User has added a trade with a valid amount, iii) node server is running, iv) mongodb instance is running, v) exchange_simulator server is running
Post-conditions: i) The newly added trade is displayed in the "5 Most Recent Trades" section

Result: PASS

Test T10

11. Test Case ID: T11

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether a newly added trade is displayed in the "Past Trades" page
Test Data: The trade history of the user in the database
Expected Result: The newly added trade is displayed in the "Past Trades" page
Steps: i) Login to the site, ii) Enter a valid amount in the input box in the "Place Trade" section of the dashboard page, iii) Click the "Add Trade" button, iv) Click the "OK" button to confirm adding the trade, v) Click on the "Past Trades" link on the sidebar
Pre-conditions: i) User is logged in, ii) User has added a trade with a valid amount, iii) node server is running, iv) mongodb instance is running, v) exchange_simulator server is running
Post-conditions: i) The order history of the user is displayed in the "Past Trade" page, including the newly added trade

Result: PASS

Test T11

12. Test Case ID: T12

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the user can add another order when there are unfulfilled orders pending
Test Data: A new order is added by the user
Expected Result: The new order is added to the database
Steps: i) Login to the site, ii) Enter a valid amount in the input box in the "Place Trade" section of the dashboard page, iii) Click the "Add Trade" button, iv) Click the "OK" button to confirm adding the trade, v) Repeat steps ii to iv to add another order
Pre-conditions: i) User is logged in, ii) User has unfulfilled orders pending, iii) User has added a trade with a valid amount, iv) node server is running, v) mongodb instance is running, vi) exchange_simulator server is running
Post-conditions: i) The new order is added to the database

Result: PASS

Test T12

13. Test Case ID: T13

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the previous orders of the user are displayed in the "Past Trades" page and are sorted by the date added
Test Data: The order history of the user in the database
Expected Result: The order history is displayed, sorted by the date added
Steps: i) Login to the site using an account that has added at least two orders, ii) Click on the "Past Trades" link on the sidebar
Pre-conditions: i) User is logged in, ii) User has added at least two orders, iii) node server is running, iv) mongodb instance is running, v) exchange_simulator server is running
Post-conditions: i) The order history of the user is displayed

Result: PASS

Test T13

14. Test Case ID: T14

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether orders of 0 amount are rejected
Test Data: An order of amount 0 is added by the user
Expected Result: An error message is displayed saying the amount is not valid
Steps: i) Login to the site, ii) Enter "0" on the input box in the "Place Order" section of the dashboard page, iii) Click on the "Add Trade" button
Pre-conditions: i) User is logged in, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) Error message is displayed saying the amount is not valid

Result: FAIL
(The order of 0 amount does not give an error and is added to the order history of the user)

Test T14

15. Test Case ID: T15

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether orders of negative amount are rejected
Test Data: An order of a negative amount is added by the user
Expected Result: An error message is displayed saying the amount is not valid
Steps: i) Login to the site, ii) Enter a negative amount on the input box in the "Place Order" section of the dashboard page, iii) Click on the "Add Trade" button
Pre-conditions: i) User is logged in, ii) node server is running, iii) mongodb instance is running, iv) exchange_simulator server is running
Post-conditions: i) Error message is displayed saying the amount is not valid

Result: FAIL
(The order of negative amount does not give an error and is added to the order history of the user)

Test T15

16. Test Case ID: T16

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the split trades are viewable when the trade is clicked on
Test Data: A valid order record
Expected Result: A number of splits calculated by the algorithm showing amount, order id, fulfilled date,fufilled by date and status
Steps: i) Input a valid order on dashboard ii) go to order history tab iii) click on order to view
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running iv) a valid order is placed v) exchange-simulator gets order vi) the exchanged simulator is polled
Post-conditions: i) None

Result: PASS

Test T16

17. Test Case ID: T17

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether a fulfilled trade shows in the recent 5 trades
Test Data: The divided trade that has a status of fulfilled
Expected Result: The fufilled trade is display with the correct data matching the order history
Steps: i) Submit a trade on the dashboard ii) Refresh Page until the status of a divided trade is set to fulfilled
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running, iv) exchange-simulator gets order, v) the exchanged simulator is polled vi) the order gets fulfilled at some point
Post-conditions: The order history gets overwritten when more trade occur

Result: PASS

Test T17

18. Test Case ID: T18

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether a negative invalid amount leads to a split trade
Test Data: An negative invalid amount
Expected Result: The split should not occur
Steps i) submit a negative amount to sell on the dashboard ii) go to order history iii)Click on the negative invalid amount
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running iv) An negative amount is accepted
Post-conditions: i) None

Result: PASS

Test T18

19. Test Case ID: T19

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether a 0 amount leads to a split trade
Test Data: An negative 0 amount
Expected Result: The split should not occur
Steps i) submit a negative amount to sell on the dashboard ii) go to order history iii)Click on the 0 invalid amount
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running iv) An 0 amount is accepted
Post-conditions: i) None

Result: PASS

Test T19

20. Test Case ID: T20

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether an invalid amount show up on recent trades
Test Data: An negative invalid amount
Expected Result: The invalid does not show up since a split should not occur
Steps: i) Submit an invalid amount ii) Refresh the page
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running, iv)the webpage accepts a negative invalid amount, v) Split does not occur
Post-conditions: None

Result: PASS

Test T20

21. Test Case ID: T21

Authors: Brett Jervey, Soul Joshi
Summary: The Dashboard chart refreshes after a set amount of time to display more data
Test Data: The Dasboard
Expected Result: The Dasboard is refreshed without the user having to refresh the page Steps: Other than being on the Dashboard the user does nothing
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running iv) The chart logic is working
Post-conditions: Should Update again

Result: PASS

Test T21

Test T22

22. Test Case ID: T22

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the user can log out
Test Data: None
Expected Result: A blank login page is displayed
Steps: i) User is on any of the pages, ii) The user clicks on logout
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running, iv) Passport logic works
Post-conditions: i) Waiting for user to input login information

Result: PASS

Test T22

23. Test Case ID: T23

Authors: Brett Jervey, Soul Joshi
Summary: Tests whether the database data exists after server shuts down
Test Data: Pre-existing database data
Expected Result: Existing data should be display in both recent trades and order history
Steps: i) User adds data via place trade, ii) User stops server, iii) user relaunches server, iv) goes to webpage, v)enters valid login information, iv) user goes to dashboard/trade history
Pre-conditions: i) node server is running, ii) mongodb is running, iii) exchange-simulator server is running, iv) passport logic works
Post-conditions: None

Result: FAIL
(As of the writing, the database is cleaned upon sever turn off thus data is not preserved)

Test T23

Clone this wiki locally