Test web operation

In this step, we will test Web operation.

  1. Open API Gateway console.

    • Click APIs on the left menu.
    • Choose fcj-serverless-api. TestFrontEnd
    • Click Stages on the left menu.
    • Choose Staging.
    • Record Invoke URL. TestFrontEnd
  2. Open config.js file in source code folder of application - FCJ-Serverless-Workshop.

    • Replace APP_API_URL with InvokeURL. TestFrontEnd
  3. Open your terminal and run the below commands.

    yarn build
    aws s3 rm s3://fcj-book-shop-by-myself --recursive
    aws s3 cp build s3://fcj-book-shop-by-myself --recursive
    

You can download the image files here to add data to check the operation of the services.

  1. Enter the following links in a new tab in your web browser: http://www.DOMAIN, replace all DOMAIN with your domain name. All those links redirect to the new path, replace http with https. TestOperation

  2. Click Create new book.

    • Enter ID: 1.
    • Enter book name: Java.
    • Enter author: Jame Patterson.
    • Enter category: IT.
    • Enter price: 10.98.
    • Enter description: A beginner's guide to learning the basic of Java.
    • Click Choose File button và choose **LetGoBook.png`` image that you just downloaded.
    • Click Create button. TestOperation
    • Click OK button when popup opens. TestOperation
  3. Create the new book as the previous step.

    • Click Create new book.
    • Enter ID: 2.
    • Enter book name: Let's Go.
    • Enter author: Alex Edwards.
    • Enter category: IT.
    • Enter price: 15.8.
    • Enter description: A step-by-step guide to creating fast, secure web with Go.
    • Click Choose File button và choose **LetGoBook.png`` image that you just downloaded.
    • Click Create button. TestOperation
    • Click OK button when popup opens. TestOperation
  4. Back to Homepage.

    • Click Home.
    • Click Add to cart button to add both 2 books to the cart.
    • Then, click on Cart icon in the upper right corner. TestOperation
  5. At Cart Items page.

    • Click Checkout button. TestOperation
    • Then, click OK button. TestOperation
  6. Open Amazon SQS console.

    • Click Queues on the left menu.
    • Click checkout-queue queue. TestOperation
    • At checkout-queue page, click Send and receive messages button. TestOperation
    • At Send and receive messages page, click Poll for messages button. TestOperation
    • Then, click on the showing message. TestOperation
    • Check the Message: … popup and click Done button. TestOperation
  7. Open the email that you have subscribed to receive the notification. TestOperation

  8. Back to the application tab.

    • Click Orders and check the books you added to the cart. TestOperation
  9. Next, repeat the 5th step to add some more orders as you want.

  10. Open the application tab.

    • Click Orders and check the books you added to the cart. TestOperation
    • Click Handle button and then click OK button on the popup. TestOperation
  11. Open AWS DynamoDB.

    • Click Tables on the left menu.
    • Choose OrdersTable table. TestOperation
    • At OrdersTable page, click Explore table items button. TestOperation
    • You could see the two books in the order that you clicked the Handle button before. TestOperation
  12. Back to the application tab.

    • Click Orders and check the books you added to the cart.
    • Next, click Delete button and then click OK button on the popup. TestOperation
    • The deleted item are no longer displayed. TestOperation