Skip to content

Latest commit

 

History

History
950 lines (863 loc) · 76.6 KB

TESTING.md

File metadata and controls

950 lines (863 loc) · 76.6 KB

Table of Contents

Table of contents generated with markdown-toc

Testing

The testing approach(described in detail in this testing readme) is as follows:

  1. Automated unit testing using the Django unit test framework
  2. Manual testing using emulators and real devices

Unit testing information

  • I wrote a number of unit tests(65) using the Django unit test framework
  • These test cases are structured in a number of suites(13)
  • A TDD(Test Driven development) approach was used for writing unit tests, where the test was written as and before the view was written, and the test passed as the view method was written/developed
  • The structure of the unit test is based on the model/form/view structure, for example test_views.py, test_model.py and test_forms.py on a per-app basis
  • I used coverage(coverage.py) for code coverage and to ensure a high code coverage was met on all python files in the project
  • An overall report image is available at the following link Coverage Report
  • To run the unit tests click on Run "Test with Coverage" in your IDE, or at the command line "python manage.py test"
    Unit test run 1
  • A test database is created and deleted for the test run, and each suite has a set-up:def setUp(self): and teardown:def tearDown(self): methods to create the relevant objects needed for the test suite
    Unit test run 2

Unit testing information for the Bag app

  • For the bag app one suite was written to test the views
  • The bag app does not have any forms or models
  • The views' suite contains 8 unit tests testing add/removing items from the bag
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Unit testing information for the Checkout app

  • For the checkout app three suites were written to test the views, form and models
  • The suites contain 3 unit tests testing the order creation and forms
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Unit testing information for the Favourites app

  • For the favourites' app two suites were written to test the views and models
  • The favourites' app does not have any forms
  • The two suites contain 8 unit tests testing adding and removing favourites
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Unit testing information for the Home app

  • For the home app one suite was written to test the views
  • The home app does not have any forms or models
  • The suite contains 1 unit tests testing the home page template
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Unit testing information for the News app

  • For the news app two suites were written to test the views and models
  • The forms are tested as part of these suites
  • The two suites contain 17 unit tests testing add/modify/views and delete of news items and comments
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Unit testing information for the Products app

  • For the product's app two suites were written to test the views and models
  • The forms are tested as part of these suites
  • The two suites contain 24 unit tests testing add/modify/views and delete of reviews and products
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Unit testing information for the Profile app

  • For the product's app two suites were written to test the views and models
  • The forms are tested as part of these suites
  • The two suites contain 4 unit tests testing the users profile and profile updates
    Suite
  • In terms of coverage when run as part of the 13 suites, it gives the following code coverage
    Coverage

Manual testing information

Testing was completed on the following browsers and device types

Device Number Physical/Emulator Device Name Device Type Browser Version
1 Physical iPad Tablet Safari 15.1
2 Physical iPhone Mobile Safari 15.1
3 Physical One Plus 5 Mobile Chrome 94.0
4 Physical Windows Desktop Desktop IE Edge 95.0
5 Physical Windows Desktop Desktop Mozilla Firefox 94.0
6 Physical Windows Desktop Desktop Chrome 94.0
7 Emulator Galaxy S5 Mobile Chrome Emulator 94.0
8 Emulator iPad Tablet Chrome Emulator 94.0
9 Emulator iPhone X Mobile Chrome Emulator 94.0
10 Emulator iPhone 5/SE Mobile Chrome Emulator 94.0
  • Below are the test results for testing the website requirements against a range of browsers and devices
  • For the purpose of the screenshots I used a Chrome emulator for desktop, tablet and mobile (Device numbers 6(Desktop), 8(Tablet), 9(Mobile))

Feature 1 Navigation Bar and Homepage

User Stories feature 1

  • User Story 1.1: As an admin/regular user the navigation bar is displayed with a logo on all pages with a search box, My account, Favourites and shopping bag icons on a desktop device
  • User Story 1.2: As an admin/regular user the navigation bar is displayed on all pages with a search box, My account, Favourites and shopping bag icons on a mobile/tablet device
  • User Story 1.3: As a regular user not logged in, I see a Register/Login link under the My Account dropdown
  • User Story 1.4: As a regular user not logged in, I am brought to the Login link if I click on the Favourites icon
  • User Story 1.5: As a regular logged in, I am brought to the Favourites page if I click on the Favourites icon
  • User Story 1.6: As a regular user logged in/not logged in, I am brought to my shopping bag if I click on the Bag icon
  • User Story 1.7: As a regular user logged in, I see a "My Profile"/Logout under the My Account dropdown and the footer contains links for My Profile, News and Sale
  • User Story 1.8: As an admin user logged in, I see a Product Management/News Item Management/My Profile/Logout under the My Account dropdown
  • User Story 1.9: As a regular/admin user logged in, if I click on the My Profile under My Account I am brought to the My Profile page
  • User Story 1.10: As a regular/admin user logged in, if I click on the My Profile under My Account I am brought to the Logout page. If I click Logout I am Logged out. If I click cancel I am brought back to the homepage
  • User Story 1.11: As an admin user logged in, if I click on Product Management under My Account I am brought to the Product Management(Add Product) page
  • User Story 1.12: As an admin user logged in, if I click on News Item Management under My Account I am brought to the News Item Management page
  • User Story 1.13: As a regular/admin user I can view the Home link in the header, and clicking it will bring the user to the homepage
  • User Story 1.15: As a regular/admin user I can click on the "All Products" filter, click By Price, and will be brought to the Products page, with products price low to high displayed
  • User Story 1.16: As a regular/admin user I can click on the "All Products" filter, click By Rating, and will be brought to the Products page, with products rating high to low displayed
  • User Story 1.17: As a regular/admin user I can click on the "All Products" filter, click By Category, and will be brought to the Products page, with products category a-z displayed
  • User Story 1.18: As a regular/admin user I can click on the "Rugby Boots" filter, and filter by Adidas Kakari, Adidas Malice or All Rugby Boots
  • User Story 1.19: As a regular/admin user I can click on the "Jerseys" filter, and filter by Leinster, Munster, Ulster or All Jerseys
  • User Story 1.20: As a regular/admin user I can click on the "Accessories" filter, and filter by Balls, Gum shields, Protection or All Accessories
  • User Story 1.21: As a regular/admin user if I encounter an error on the site, I will be navigated to the applicable 400, 403, 404 or 500 error page

User Stories Steps 1

  1. Navigate to https://ci-ms4-loverugby.herokuapp.com/, and click on the My Account link as a regular user
  2. Login to the website with a valid username and password, and click on the My Account link
  3. Navigate to the "All Products" filter, and then click By Price
  4. Navigate to the "All Products" filter, and then click By Rating
  5. Navigate to the "All Products" filter, and then click By Category
  6. Navigate to the "Rugby Boots" filter, and filter by Adidas Kakari
  7. Navigate to the "Jerseys" filter, and filter by Leinster
  8. Navigate to the "Accessories" filter, and filter by Balls
  9. Navigate to the page https://ci-ms4-loverugby.herokuapp.com/nosuchpage
  10. Click the Logout link under My profile and logout
  11. Login as an admin user

User Story Testing Results 1

Step Result Desktop Tablet Mobile Status
Step 1 The homepage is displayed, Login and Register links are displayed under My Account and the footer items are displayed with website links(Register/Login) Desktop Tablet Mobile Passed
Step 2 The homepage is displayed with a header logo(desktop), search box(expands on tablet/mobile), My account, Favourites and shopping bag icons. My Profile/Logout is visible under My Account and the footer contains links for My Profile, News and Sale Desktop Tablet Mobile Passed
Step 3 Products on the page are filtered by Price (Low-High) Desktop Tablet Mobile Passed
Step 4 Products on the page are filtered by Rating (High-Low) Desktop Tablet Mobile Passed
Step 5 Products on the page are filtered by Category (A-Z) Desktop Tablet Mobile Passed
Step 6 Products on the page are filtered by Adidas Kakari "Rugby Boots" Desktop Tablet Mobile Passed
Step 7 Products on the page are filtered by Leinster "Jerseys" Desktop Tablet Mobile Passed
Step 8 Products on the page are filtered by Balls in Accessories Desktop Tablet Mobile Passed
Step 9 A 404 page is displayed with a link to the homepage Desktop Tablet Mobile Passed
Step 10 The user is logged out Desktop Tablet Mobile Passed
Step 11 The homepage is displayed with a header logo(desktop), search box(expands on tablet/mobile), My Account, Favourites and shopping bag icons. Product Management/News Item Management/My Profile/Logout is visible under My Account and the footer contains links for Product Management and News Item Management Desktop Tablet Mobile Passed

Feature 2 Footer

User Stories feature 2

  • User Story 2.1: As an admin/regular user logged in four text messages are displayed with icons regarding delivery, packaging, dispatch and knowledge
  • User Story 2.2: As a regular user the footer is displayed with a logo, product links(Rugby Boots, Jerseys, Accessories), website links(Profile/News/Sale)
  • User Story 2.3: As an admin user logged in the footer is displayed with a logo, product links(Rugby Boots, Jerseys, Accessories), website links(Product Management/News Item Management)
  • User Story 2.4: As a regular user I can sign up for a newsletter by entering my email address and clicking Signup. I will receive an email after signing up

User Stories Steps 2

  1. As a regular user scroll down to the footer on the homepage
  2. As an admin user scroll down to the footer on the homepage
  3. As a regular user sign up to the newsletter

User Story Testing Results 2

Step Result Desktop Tablet Mobile Status
Step 1 The footer items are displayed with website links(Profile/News/Sale) Desktop Tablet Mobile Passed
Step 2 The footer items are displayed with website links(Product Management/News Item Management) Desktop Tablet Mobile Passed
Step 3 The user receives an email Desktop Tablet Mobile Passed

Feature 3 Register

User Stories feature 3

  • User Story 3.1: As a regular user I can register on the website by providing an email address, email address(confirmation), username, password, password confirmation
  • User Story 3.1: As a regular user I will receive an email to verify my account after registering
  • User Story 3.1: As a regular user I can log in to my account once I click on the verification link in the email I receive regarding my registration

User Stories Steps 3

  1. As a regular user, navigate to the registration page, fill in email address, email address(confirmation), username, password, password confirmation and click Sign Up
  2. Open the email received
  3. Click on the verification link in the email received
  4. Confirm the email address for the account
  5. Sign in to the account
  6. Attempt to register with the same account and do not fill in all the mandatory fields: email address, email address(confirmation), username, password, password confirmation

User Story Testing Results 3

Step Result Desktop Tablet Mobile Status
Step 1 The user registers for an account Desktop Tablet Mobile Passed
Step 2 The user receives the email Desktop Tablet Mobile Passed
Step 3 The user clicks on the verification link Desktop Tablet Mobile Passed
Step 4 The user confirms the email address Desktop Tablet Mobile Passed
Step 5 The user logs in to the site Desktop Tablet Mobile Passed
Step 6 A message is displayed to the user Desktop Tablet Mobile Passed

Feature 4 Login

User Stories feature 4

  • User Story 4.1: As an admin/regular user I can log in to the website using my username or email address and password. Both fields are mandatory. Once correct, I will be navigated to the homepage and a message displayed
  • User Story 4.2: As an admin/regular user I can request a new password if I forget my current password. I will receive an email to reset my password. Once I reset I can log in

User Stories Steps 4

  1. Attempt to log in to the website with an account that does not exist or an incorrect password
  2. Request a new password
  3. Login to the site with the correct account details

User Story Testing Results 4

Step Result Desktop Tablet Mobile Status
Step 1 A message is displayed to the user Desktop Tablet Mobile Passed
Step 2 The user receives an email where they can reset their password Desktop Tablet Mobile Passed
Step 3 The user can successfully log in Desktop Tablet Mobile Passed

Feature 5 Products and Product Detail Pages

User Stories feature 5

  • User Story 5.1: As a regular user I can view the products page with product count and with each product image, title, category, price and presale price(if applicable)
  • User Story 5.2: As a regular user I can sort the products by Price(high to low, low to high), Rating(high to low, low to high), Name(A-Z, Z-A), Category(A-Z, Z-A)
  • User Story 5.3: As a regular user if there are more than four products on the page, the page is paginated with four products per page
  • User Story 5.4: As a regular user if I click on a product I will be navigated to the product detail page
  • User Story 5.5: As a regular user I can view the product image, description, colour, code, rating, category, description, features and reviews(the latest first)
  • User Story 5.6: As a regular user if the product is in my favourites list, the heart colour is red in the product detail page. If not the heart colour is white
  • User Story 5.7: As a regular user I can add a review, by selecting a rating and entering a comment(both fields are mandatory), the review is displayed and a message is displayed
  • User Story 5.8: As a regular user I can delete a review I have added(the comment and rating is removed from the product detail), but I cannot delete other users review
  • User Story 5.9: As a regular user if there are more than four reviews for a product, the reviews are paginated
  • User Story 5.9: As a regular user I can click on the Keep Shopping button on the product detail page, and it will navigate the user to the products page
  • User Story 5.9: As a regular user I can set the product size(if applicable for the product) and quantity for a product (one plus)
  • User Story 5.10: As an admin user I can view the Add product page by clicking on the Product Management link.
  • User Story 5.11: As an admin user I can view the Edit product page by clicking on the Edit button on the product.
  • User Story 5.12: As an admin user I can click on a product, and I am navigated to the product detail page. I can edit or delete the product by clicking on the Edit or Delete links on the page
  • User Story 5.13: As an admin user I can delete a review a regular user has added
  • User Story 5.14: As a regular user who has not registered or logged into the website, I cannot add a review to a product

User Stories Steps 5

  1. As a regular user login to the website and navigate to the products page
  2. Sort the products from Price(High to Low)
  3. Click on a product
  4. Add a review to the product
  5. Attempt to add another review to the product
  6. Add a product(Jersey) to the bag, with a quantity of 2 and a size of Medium
  7. As an admin user login and click on the add product(Product Management)
  8. Click on the edit button on the products page or in the product detail page and edit the product
  9. As an admin user delete a product
  10. As an admin user delete a review
  11. As a regular user log out, and select a product and try and add a review

User Story Testing Results 5

Step Result Desktop Tablet Mobile Status
Step 1 The products page is displayed Desktop Tablet Mobile Passed
Step 2 The products are sorted High to Low Desktop Tablet Mobile Passed
Step 3 The product detail is displayed Desktop Tablet Mobile Passed
Step 4 The review is added Desktop Tablet Mobile Passed
Step 5 The second review is not added and a message is displayed Desktop Tablet Mobile Passed
Step 6 The 2 products are added Desktop Tablet Mobile Passed
Step 7 The add product page is displayed Desktop Tablet Mobile Passed
Step 8 The edit product page is displayed Desktop Tablet Mobile Passed
Step 9 A modal is displayed and the user can delete the product Desktop Tablet Mobile Passed
Step 10 The review is deleted Desktop Tablet Mobile Passed
Step 11 The review cannot be added Desktop Tablet Mobile Passed

Feature 6 Sale items page

User Stories feature 6

  • User Story 6.1: As a regular user I can view the products with sale prices, the product image, category, presale price and price is displayed
  • User Story 6.2: As a regular user if I click on a product in the sale items, I am navigated to the product detail page for that product
  • User Story 6.3: As a regular user if there are more than four products on the sale items page, the page is paginated with four products per page

User Stories Steps 6

  1. Click on the sale items in the header
  2. Click on a product in the sale items
  3. Scroll down to view the pagination

User Story Testing Results 6

Step Result Desktop Tablet Mobile Status
Step 1 The sale items and count are displayed Desktop Tablet Mobile Passed
Step 2 The product detail is displayed Desktop Tablet Mobile Passed
Step 3 The pagination is displayed Desktop Tablet Mobile Passed

Feature 7 Favourites page

User Stories feature 7

  • User Story 7.1: As a regular user I can click on the heart icon on a product in the product details page, a message is displayed, and the product is added to my favourites list
  • User Story 7.2: As a regular user I can click on the heart icon on a product that is already in my favourites list, a message is displayed, and the product is removed to my favourites list
  • User Story 7.3: As a regular user I can view my favourites list, the product image, category, presale price and price is displayed
  • User Story 7.4: As a regular user I remove a product from my favorites list by clicking on the Delete button on the product. A confirmation modal and message is displayed
  • User Story 7.5: As a regular user if there are more than four products in my favourites page, the page is paginated with four products per page

User Stories Steps 7

  1. Click on a product and click the heart icon
  2. Go to the favourites page to view the product
  3. Click on the heart icon on the product to click on the delete button to remove the item from the favourites

User Story Testing Results 7

Step Result Desktop Tablet Mobile Status
Step 1 The product is added to the users favourites list Desktop Tablet Mobile Passed
Step 2 The product is displayed in the favourites list Desktop Tablet Mobile Passed
Step 3 The product is removed from the users favourites list Desktop Tablet Mobile Passed

Feature 8 News Page

User Stories feature 8

  • User Story 8.1: As a regular user I can view 4 news items on a page with a news image, and 150 characters of the news item text and a read more button
  • User Story 8.2: As a regular user I can click on the read more button on the News page, I will be navigated to the news item with a news item image, news item text and any comments will be displayed
  • User Story 8.3: As a regular user I can add a comment to a "news" item
  • User Story 8.4: As a regular user I can delete a comment that I had originally added on a "news item"
  • User Story 8.5: As an admin user I can delete a comment on a news item, even if I did not add the comment
  • User Story 8.6: As a regular user who has not registered or logged into the website, I cannot add a comment to a "news item"

User Stories Steps 8

  1. As a regular user click on the News page
  2. Click on the read more button on a "news item"
  3. Add a comment to a "news item"
  4. Delete a comment from a "news item"
  5. As an admin user delete a comment created by a regular user
  6. As a regular user not logged in, select a news item and try to add a comment

User Story Testing Results 8

Step Result Desktop Tablet Mobile Status
Step 1 The news page is displayed Desktop Tablet Mobile Passed
Step 2 The news item is displayed Desktop Tablet Mobile Passed
Step 3 The comment is added Desktop Tablet Mobile Passed
Step 4 The comment is deleted Desktop Tablet Mobile Passed
Step 5 The comment is deleted by the admin user Desktop Tablet Mobile Passed
Step 6 A comment cannot be added Desktop Tablet Mobile Passed

Feature 9 Profile Page

User Stories feature 9

  • User Story 9.1: As a regular user I can view my Default delivery information: Phone Number, Street Address 1, Street Address 2, Town or City, County, State or Locality, Postal Code and Country
  • User Story 9.2: As a regular user I can update my Default delivery information: Phone Number, Street Address 1, Street Address 2, Town or City, County, State or Locality, Postal Code and Country
  • User Story 9.3: As a regular user I can view my order history(Order Number, Date, Items and Order Total)
  • User Story 9.4: As a regular user I can click on an order number to view the order information (Order number, Order date/time, Full Name, Street Address 1, Street Address 2, Town or City, County, State or Locality, Postal Code and Country, Phone Number, Order Total, Deliver, Grand Total)

User Stories Steps 9

  1. Click on the My Profile link under My Account
  2. Update one field in the default delivery information (Street Address 2)
  3. Click on an order number

User Story Testing Results 9

Step Result Desktop Tablet Mobile Status
Step 1 The users default delivery information and order history is displayed Desktop Tablet Mobile Passed
Step 2 The users default delivery information is updated and displayed (Street Address 2) Desktop Tablet Mobile Passed
Step 3 The users order details is displayed Desktop Tablet Mobile Passed

Feature 10 Product Management

User Story 10-1

  • User Story 10.1: As an admin user I can add a product by clicking on the Product Management link in My Account. I must enter a name, category, price, colour, code, description and can optionally add a feature (1-4), has Sizes(Unknown, Yes, No), Rating, Pre-sale price, Image url, upload an image and click the Add Product button. Clicking cancel navigates the user to the product page.

User Story Steps 10-1

  • Step 1: As an admin user login navigate to Product Management under MyAccount, and add details to a product and click the Add Product button
  • Step 2: Click on the product detail for the product

User Story Testing Results 10-1

Step Result Desktop Tablet Mobile Status
Step 1 The add product page is displayed Desktop Tablet Mobile Passed
Step 2 The product detail is displayed Desktop Tablet Mobile Passed

User Story 10-2

  • User Story 10.2: As an admin user I can edit a product by clicking on the Edit button on the Products page for the product. I can update thea name, category, price, colour, code, description, feature (1-4), has Sizes(Unknown, Yes, No), Rating, Pre-sale price, Image url, update an image and click the Edit Product button. Clicking cancel navigates the user to the product page

User Story Steps 10-2

  • Step 1: As an admin user login navigate to a product in the products page and click on a product, and click the Edit button
  • Step 2: Update the product, for example the price

User Story Testing Results 10-2

Step Result Desktop Tablet Mobile Status
Step 1 The edit product page is displayed Desktop Tablet Mobile Passed
Step 2 The product detail is updated with the news price Desktop Tablet Mobile Passed

User Story 10-3

  • User Story 10.3: As an admin user I can delete a product by clicking on the Delete button on the product. A modal will appearing asking to confirm, and a message displayed once I confirm.

User Story Steps 10-3

  • Step 1: As an admin user login navigate to a product in the products page and click on a product, and click the Delete button
  • Step 2: Delete the product

User Story Testing Results 10-3

Step Result Desktop Tablet Mobile Status
Step 1 The delete-product modal is displayed Desktop Tablet Mobile Passed
Step 2 The product is deleted and the count is reduced Desktop Tablet Mobile Passed

Feature 11 News item Management

User Stories feature 11

  • User Story 11.1: As an admin user I can view News items by clicking on the News Item Management link under My account. The news item count and title, create date, status(Published or Draft), and Edit and Delete buttons is displayed
  • User Story 11.2: As an admin user if there are more than four news items added, the page is paginated
  • User Story 11.3: As an admin user I can add a news item, by clicking on the Add button. I can enter a Title and news item text, add an image and set the item to Published or Draft
  • User Story 11.4: As an admin user I can edit a news item, by clicking on the Edit button for the news item. I can update a Title and news item text, update an image and update the item to Published or Draft
  • User Story 11.5: As an admin user if a news item is set to Draft, admin and regular users will NOT see this item on the News Page.
  • User Story 11.6: As an admin user if a news item is set to Published, admin regular users will see this item on the News Page.
  • User Story 11.7: As an admin user I can delete a news item, and I will be asked to confirm the deletion

User Stories Steps 11

  1. As an admin user click on the News Item Management under My account
  2. Click on the Add news item button to add a news item with text and image
  3. Click on the Edit news item button to update a "news item"
  4. Click on the News page to see Published items and click on the edited news item, Draft items are not displayed
  5. Delete a "news item"

User Story Testing Results 11

Step Result Desktop Tablet Mobile Status
Step 1 The manage news items page is displayed Desktop Tablet Mobile Passed
Step 2 The add news item page is displayed and the news item is added Desktop Tablet Mobile Passed
Step 3 The edit news item page is displayed and the news item is updated Desktop Tablet Mobile Passed
Step 4 The published news item is displayed Desktop Tablet Mobile Passed
Step 5 The news item is deleted Desktop Tablet Mobile Passed

Feature 12 Bag and Checkout

User Stories feature 12

  • User Story 12.1: As a regular user I can click on a product, set the size(if applicable) and quantity, click Add to Bag and the product will be added to my bag, a message displayed, and a toast will be displayed with the bag contents
  • User Story 12.2: As a regular user I can click on the bag icon, I will be brought to my bag. If there are no items in the bag, a message will be displayed
  • User Story 12.3: As a regular user I can click on the bag icon, I will be brought to my bag. If there are items, the product image, detail, price, quantity, subtotal will be displayed for the item. The bag total, delivery(if applicable), grand total would be displayed
  • User Story 12.4: As a regular user I can update the quantity or remove an item from my shopping bag
  • User Story 12.5: As a regular user I can click on the Secure Checkout button on the bag page or toast message, and I will be brought to the Checkout page
  • User Story 12.6: As a regular user on the checkout page I can set my details(Full Name, email address, both mandatory) and Delivery Information(Phone Number(mandatory), Street Address 1(mandatory), Street Address 2, Town or City(mandatory, County, State or Locality, Postal Code and Country(mandatory), which is populated from my profile if filled in
  • User Story 12.7: As a regular user on the checkout page I can view the order summary(item image, title, size, quantity, subtotal, order total, delivery, grand total)
  • User Story 12.8: As a regular user on the checkout page if the order total is greater than 99 euros, there is no delivery charge
  • User Story 12.9: As a regular user on the checkout page if the order total is less than 99 euros, there is delivery charge(10% of the order total) A message is displayed to the user on the toast message of what they need to add to the bag to avail of no delivery charge
  • User Story 12.10: As a regular user on the checkout page if I click "Save this delivery information to my profile", the details entered will be saved on the users profile
  • User Story 12.11: As a regular user on the checkout page I can enter a credit card number(16 digits), expiry date(2 digits/2digits), cvc(3 digits) and a postal code(up to 5 digits), these fields are mandatory
  • User Story 12.12: As a regular user on the checkout page if I click the Keep Shopping button I will be navigated to the products page
  • User Story 12.13: As a regular user on the checkout page if I click the Complete Order button, and the transaction is not successful, a message will be displayed
  • User Story 12.14: As a regular user on the checkout page if I click the Complete Order button, and the transaction is successful, the user will be navigated to a checkout success page, and an email is sent to the user
  • User Story 12.15: As a regular user on the checkout page if I click the Complete Order button, and the transaction is successful, the order is saved to my order history in My profile page
  • User Story 12.16: As a regular user on the checkout success page, the Order details will be displayed (Order number, Order date/time, Full NameStreet Address 1, Street Address 2, Town or City, County, State or Locality, Postal Code and Country, Phone Number, Order Total, Deliver, Grand Total) and a link to the sales item page is displayed
  • User Story 12.17: As a regular user not logged in, I can add items to my bag and make a purchase

User Stories Steps 12

Note: Some screenshots show dollars, I have since changed all instances to euros

  1. As a regular user add some items to your bag, so the order is less than 99 euros
  2. Empty the bag
  3. Add the items back into the bag
  4. Add the items back into the bag, and Update the quantity on one item by one, so the order goes above 99 euros
  5. Checkout the order
  6. Go to the order details on the users my profile page
  7. Check the users email address
  8. Logout, and as a user not logged in add items to a bag
  9. Checkout and complete the purchase

User Story Testing Results 12

Step Result Desktop Tablet Mobile Status
Step 1 The items are added to the bag, and there is a delivery charge(10%) and message displayed Desktop Tablet Mobile Passed
Step 2 A message "Your bag is empty" is displayed with a button to go shopping Desktop Tablet Mobile Passed
Step 3 The items are added to the bag, and there is a delivery charge(10%) and message displayed Desktop Tablet Mobile Passed
Step 4 The items are added to the bag, and there is no delivery charge Desktop Tablet Mobile Passed
Step 4 The user receives an email(confirmation) Desktop Tablet Mobile Passed
Step 6 The order is complete Desktop Tablet Mobile Passed
Step 7 The order is displayed on the "my profile" page Desktop Tablet Mobile Passed
Step 8 The items are added to the bag Desktop Tablet Mobile Passed
Step 9 The purchase is successful and the checkout success page is displayed Desktop Tablet Mobile Passed

Feature 13 Admin

User Story 13-1

  • User Story 13.1: As an admin user I can view users orders in the django admin page and can view order number, date, full name, order total, delivery cost, grand total

User Story Steps 13-1

User Story Testing Results 13-1

Step Result Result Status
Step 1 The orders are displayed Result Passed

User Story 13-2

  • User Story 13.2: As an admin user I can view users orders in the django admin page and can search by order number, full name and filter by order number, full name and order date

User Story Steps 13-2

User Story Testing Results 13-2

Step Result Result Status
Step 1 The order is filtered Result Passed

User Story 13-3

  • User Story 13.3: As an admin user I can view users favourites in the django admin page and can view all favourites

User Story Steps 13-3

User Story Testing Results 13-3

Step Result Result Status
Step 1 The favourites are displayed Result Passed

User Story 13-4

  • User Story 13.4: As an admin user I can view users favourites in the django admin page and can search and filter by username

User Story Steps 13-4

User Story Testing Results 13-4

Step Result Result Status
Step 1 The favourites are displayed for the user Result Passed

User Story 13-5

  • User Story 13.5: As an admin user I can view news items in the django admin page and can view a news item title, user, news item text and image

User Story Steps 13-5

User Story Testing Results 13-5

Step Result Result Status
Step 1 The news items are displayed Result Passed

User Story 13-6

  • User Story 13.6: As an admin user I can view news items in the django admin page and can search and search by title, user, news item text and image, create date, update date status and filter by title, user, create date

User Story Steps 13-6

User Story Testing Results 13-6

Step Result Result Status
Step 1 The news item is filtered Result Passed

User Story Expected Result 13-7

  • User Story 13.7: As an admin user I can view products in the django admin page and can view a products code, name, category, has sizes, price, presale price, rating, image, image url

User Story Steps 13-7

User Story Testing Results 13-7

Step Result Result Status
Step 1 The products are displayed Result Passed

User Story 13-8

  • User Story 13.8: As an admin user I can view products in the django admin page and can view search and filter by code, category, name and price

User Story Steps 13-8

User Story Testing Results 13-8

Step Result Result Status
Step 1 The filtered products are displayed for the category Result Passed

User Story 13-9

  • User Story 13.9: As an admin user I can view users in the django admin page and can view their username, email address, first name, last name, staff status

User Story Steps 13-9

User Story Testing Results 13-9

Step Result Result Status
Step 1 The users are displayed Result Passed

User Story 13-10

  • User Story 13.10: As an admin user I can view users in the django admin page and can search by username and email address and filter by staff status, superuser status and active status

User Story Steps 13-10

User Story Testing Results 13-10

Step Result Result Status
Step 1 The non superuser users are displayed Result Passed

User Story 13-11

  • User Story 13.11: As an admin user I can view news items comments in the django admin page and can view a comment user, title, text and create date

User Story Steps 13-11

User Story Testing Results 13-11

Step Result Result Status
Step 1 The comments are displayed Result Passed

User Story 13.12

  • User Story 13.12: As an admin user I can view news items comments in the django admin page and can filter by user, title, create date and search by user, title, text and create date

User Story Steps 13.12

User Story Testing Results 13.12

Step Result Result Status
Step 1 The comment is displayed Result Passed

User Story 13.13

  • User Story 13.13: As an admin user I can view reviews in the django admin page and can view a review user, product, rating, text and create date

User Story Steps 13.13

User Story Testing Results 13.13

Step Result Result Status
Step 1 The reviews are displayed Result Passed

User Story 13.14

  • User Story 13.14: As an admin user I can view reviews in the django admin page and can filter by user, product rating, create date and search by user, product, rating, text

User Story Steps 13.14

User Story Testing Results 13.14

Step Result Result Status
Step 1 The users reviews are displayed Result Passed

User Story 13.15

  • User Story 13.15: As an admin user I can view categories in the django admin page and can view a category name and friendly name

User Story Steps 13.15

User Story Testing Results 13.15

Step Result Result Status
Step 1 The categories are displayed Result Passed

Bugs found during the testing phase

Bug no. Bug description Bug fix
1 When running html validation, sales_items had same id as news, The fix was to give both a unique id (main-nav.html)
2 When running html validation, alt text for a number of images in a loop was the same The fix was the set it to the product name (products.html)
3 If a user has 0 favourites, pagination setup call in the view is being called even though there are no items The fix was to move the location of the pagination setup call(util.py)
4 Ths stripe webhook was not working on production. I had the same secret set on heroku and local development, even though I had two different webhooks defined(development and production) The fix was to set the correct webhook secret as an environment variable in Heroku
5 The following error was displayed in logs "norderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'products.models.Product'> QuerySet." The fix was to update the product and review models to order by id (models.py in Product app)
6 Combining filtering and pagination does not include the filter text in the pagination page link Fix was to implement a product_tools template tags from https://www.caktusgroup.com/blog/2018/10/18/filtering-and-pagination-django/
7 The news item count on the news page was incorrect as it included draft and published in its count The fix was to update the filter to only include published items News.objects.filter(status=1).count()
8 On a mobile device the pagination on the products page was overlapping over the div The fix was to set the flex wrap class flex-wrap: wrap
9 If items are greater than four, the product, sale, favourites page with pagination doesnt scale right Update the bootstrap class html to col-sm-6 col-md-6 col-lg-6 col-xl-3
10 Reviews were not displaying the latest first The fix was to filter the reviews in the query by order_by('-create_date')
11 Products were not sorting by rating The fix was to change the update statement to filter on the id, then update Product.objects.filter(id=product.id).update(rating=average_rating_rounded)
12 The product rating was different on paginated product review pages The fix was to display product.rating, not the average_rating as it was being calculated per paginated page and not per product

Code Validators and Website Analysis

The website's pages was tested against the following validators:

HTML Markup Validation Service

I used https://validator.w3.org/ to validate the html files

Page Result Test Detail/Screenshot
bag/templates/bag/bag.html 0 errors and 0 contrast errors Results
bag/templates/bag/bag.html (Empty) 0 errors and 0 contrast errors Results
checkout/templates/checkout/checkout.html 0 errors and 0 contrast errors Results
checkout/templates/checkout/checkout_success.html 0 errors and 0 contrast errors Results
favourites/templates/favourites/favourites.html 0 errors and 0 contrast errors Results
home/templates/home/index.html 0 errors and 0 contrast errors Results
news/templates/news/add_news_item.html 0 errors and 0 contrast errors Results
news/templates/news/edit_news_item.html 0 errors and 0 contrast errors Results
news/templates/news/manage_news_items.html 0 errors and 0 contrast errors Results
news/templates/news/news.html 0 errors and 0 contrast errors Results
news/templates/news/news_item.html 0 errors and 0 contrast errors Results
products/templates/products/add_product.html 0 errors and 0 contrast errors Results
products/templates/products/edit_product.html 0 errors and 0 contrast errors Results
products/templates/products/product_detail.html 0 errors and 0 contrast errors Results
products/templates/products/products.html 0 errors and 0 contrast errors Results
products/templates/products/sale_items.html 0 errors and 0 contrast errors Results
profile/templates/profile/profile.html 0 errors and 0 contrast errors Results
profile/templates/profile/order_history.html 0 errors and 0 contrast errors Results
templates/allauth/account/login.html 0 errors and 0 contrast errors Results
templates/allauth/account/logout.html 0 errors and 0 contrast errors Results
templates/allauth/account/register.html 0 errors and 0 contrast errors Results
templates/allauth/account/password_change.html 0 errors and 0 contrast errors Results
templates/allauth/account/password_reset.html 0 errors and 0 contrast errors Results
templates/allauth/account/password_reset_done.html 0 errors and 0 contrast errors Results
templates/allauth/account/verification_sent.html 0 errors and 0 contrast errors Results

CSS Validation Service

I used https://jigsaw.w3.org/css-validator/ to validate the css(style.css)

Valid CSS!

Page Result Test Detail/Screenshot
static/css/base.css Passed, No errors found Results
checkout/static/checkout/css/checkout.css Passed, No errors found Results

Chrome Dev tools Lighthouse

  • I used Lighthouse (https://developers.google.com/web/tools/lighthouse) to test the performance, seo, best practices and accessibility of the site
  • Overall the results are very good for the 4 values: Performance, Accessibility, Best Practices and SEO

Desktop

Page Performance (%) Accessibility (%) Best Practices (%) SEO (%)
bag/templates/bag/bag.html 96 96 80 100
checkout/templates/checkout/checkout.html 82 100 80 100
checkout/templates/checkout/checkout_success.html 95 100 87 100
favourites/templates/favourites/favourites.html 97 100 87 90
home/templates/home/index.html 91 100 87 100
news/templates/news/add_news_item.html 97 92 87 100
news/templates/news/edit_news_item.html 98 92 87 100
news/templates/news/manage_news_items.html 98 100 87 90
news/templates/news/news.html 95 100 87 90
news/templates/news/news_item.html 96 100 87 100
products/templates/products/add_product.html 94 92 87 100
products/templates/products/edit_product.html 97 92 87 100
products/templates/products/product_detail.html 96 100 80 100
products/templates/products/products.html 96 100 87 100
products/templates/products/sale_items.html 96 100 87 100
profile/templates/profile/profile.html 97 100 87 100
profile/templates/profile/order_history.html 95 100 87 100
templates/allauth/account/login.html 94 100 87 100
templates/allauth/account/logout.html 93 100 87 100
templates/allauth/account/register.html 98 100 87 100

Mobile

Page Performance (%) Accessibility (%) Best Practices (%) SEO (%)
bag/templates/bag/bag.html 60 93 87 100
checkout/templates/checkout/checkout.html 65 98 87 100
checkout/templates/checkout/checkout_success.html 67 97 87 100
favourites/templates/favourites/favourites.html 70 97 87 100
home/templates/home/index.html 62 97 87 100
news/templates/news/add_news_item.html 81 89 87 100
news/templates/news/edit_news_item.html 74 89 87 100
news/templates/news/manage_news_items.html 73 98 87 92
news/templates/news/news.html 72 97 80 92
news/templates/news/news_item.html 71 98 87 100
products/templates/products/add_product.html 77 89 87 100
products/templates/products/edit_product.html 79 89 87 100
products/templates/products/product_detail.html 70 98 80 100
products/templates/products/products.html 76 97 87 92
products/templates/products/sale_items.html 72 97 87 92
profile/templates/profile/profile.html 76 98 87 100
profile/templates/profile/order_history.html 70 97 87 100
templates/allauth/account/login.html 78 97 87 98
templates/allauth/account/logout.html 74 97 87 100
templates/allauth/account/register.html 73 97 87 100

Wave Accessibility

Page Result Test Detail/Screenshot
bag/templates/bag/bag.html 0 errors and 0 contrast errors Results
bag/templates/bag/bag.html (Empty) 0 errors and 0 contrast errors Results
checkout/templates/checkout/checkout.html 0 errors and 0 contrast errors Results
checkout/templates/checkout/checkout_success.html 0 errors and 0 contrast errors Results
favourites/templates/favourites/favourites.html 0 errors and 0 contrast errors Results
home/templates/home/index.html 0 errors and 0 contrast errors Results
news/templates/news/add_news_item.html 0 errors and 0 contrast errors Results
news/templates/news/edit_news_item.html 0 errors and 0 contrast errors Results
news/templates/news/manage_news_items.html 0 errors and 0 contrast errors Results
news/templates/news/news.html 0 errors and 0 contrast errors Results
news/templates/news/news_item.html 0 errors and 0 contrast errors Results
products/templates/products/add_product.html 0 errors and 0 contrast errors Results
products/templates/products/edit_product.html 0 errors and 0 contrast errors Results
products/templates/products/product_detail.html 0 errors and 0 contrast errors Results
products/templates/products/products.html 0 errors and 0 contrast errors Results
products/templates/products/sale_items.html 0 errors and 0 contrast errors Results
profile/templates/profile/profile.html 0 errors and 0 contrast errors Results
profile/templates/profile/order_history.html 0 errors and 0 contrast errors Results
templates/allauth/account/login.html 0 errors and 0 contrast errors Results
templates/allauth/account/logout.html 0 errors and 0 contrast errors Results
templates/allauth/account/register.html 0 errors and 0 contrast errors Results
templates/allauth/account/password_change.html 0 errors and 0 contrast errors Results
templates/allauth/account/password_reset.html 0 errors and 0 contrast errors Results
templates/allauth/account/password_change_done.html 0 errors and 0 contrast errors Results
templates/allauth/account/verification_sent.html 0 errors and 0 contrast errors Results)
templates/allauth/account/verification_email_required.html 0 errors and 0 contrast errors Results

JSHint

Page Result Test Detail/Screenshot
bag/templates/bag/bag.html 0 errors and 0 warnings Results
checkout/static/checkout/carousel.js 0 errors and 0 warnings Results
home/static/home/carousel.js 0 errors and 0 warnings Results
news/static/news/carousel.js 0 errors and 0 warnings Results
favourites/static/favourites/favourites.js 0 errors and 0 warnings Results
products/static/products/products.js 0 errors and 0 warnings Results
static/js/toast.js 0 errors and 0 warnings Results
static/js/send_email.js 0 errors and 0 warnings Results

PEP8online

  • PEP8online was used to analyse the Python files (https://pep8online.com/)
  • I used the pep8 checker in my IDE Pycharm, and created a scope and included the following files
    PEP8 scope
  • The report shows no errors/warnings for the files listed below
    PEP8 report
  • One of the main errors on several files was to ensure the character count was less than 80 characters
Page Result
bag/admin.py No errors/warnings
bag/apps.py No errors/warnings
bag/contexts.py No errors/warnings
bag/models.py No errors/warnings
bag/test_views.py No errors/warnings
bag/urls.py No errors/warnings
bag/views.py No errors/warnings
checkout/admin.py No errors/warnings
checkout/apps.py No errors/warnings
checkout/forms.py No errors/warnings
checkout/models.py No errors/warnings
checkout/signals.py No errors/warnings
checkout/test_forms.py No errors/warnings
checkout/test_models.py No errors/warnings
checkout/test_views.py No errors/warnings
checkout/urls.py No errors/warnings
checkout/views.py No errors/warnings
checkout/webhook_handler.py No errors/warnings
checkout/webhooks.py No errors/warnings
favourites/admin.py No errors/warnings
favourites/apps.py No errors/warnings
favourites/contexts.py No errors/warnings
favourites/models.py No errors/warnings
favourites/test_models.py No errors/warnings
favourites/test_views.py No errors/warnings
favourites/urls.py No errors/warnings
favourites/views.py No errors/warnings
home/admin.py No errors/warnings
home/apps.py No errors/warnings
home/models.py No errors/warnings
home/test_views.py No errors/warnings
home/urls.py No errors/warnings
home/views.py No errors/warnings
news/admin.py No errors/warnings
news/apps.py No errors/warnings
news/forms.py No errors/warnings
news/models.py No errors/warnings
news/test_models.py No errors/warnings
news/test_views.py No errors/warnings
news/urls.py No errors/warnings
news/views.py No errors/warnings
products/admin.py No errors/warnings
products/apps.py No errors/warnings
products/forms.py No errors/warnings
products/models.py No errors/warnings
products/test_forms.py No errors/warnings
products/test_models.py No errors/warnings
products/test_views.py No errors/warnings
products/urls.py No errors/warnings
products/views.py No errors/warnings
products/widgets.py No errors/warnings
profiles/admin.py No errors/warnings
profiles/apps.py No errors/warnings
profiles/forms.py No errors/warnings
profiles/models.py No errors/warnings
profiles/test_models.py No errors/warnings
profiles/test_views.py No errors/warnings
profiles/urls.py No errors/warnings
profiles/views.py No errors/warnings
custom_storages.py No errors/warnings
env.py No errors/warnings
manage.py No errors/warnings
unit/unit.py No errors/warnings