Skip to content

Test_Cases

Phillweston edited this page May 6, 2024 · 2 revisions

Test Cases

  • Last Modified: 2024-04-29
  • Author: Phill Weston

Introduction

The following test cases are performed according to the diagram of REST API endpoints for Lotso-Twitter-Auth. The test cases are designed to ensure that the API endpoints are functioning correctly and that the expected responses are returned.

Table of Contents

Twitter OAuth Sequence

  1. Test Case: Verify that a user can successfully log in with Twitter and perform actions (Retweet, Like, Follow).

    • Steps:
      • Step 1: Click 'Log in with Twitter'.
      • Step 2: Log in and authorize on the Twitter auth page.
      • Step 3: Click 'Retweet', 'Like', or 'Follow'.
    • Expected Result:
      • After Step 1, a new tab for OAuth is opened and the user is redirected to the Twitter auth page.
      • After Step 2, the user is redirected back to the application with access tokens passed to the frontend.
      • After Step 3, the requested action is performed and the result (Success or Error) is displayed.
  2. Test Case: Verify that a user cannot log in with Twitter if they do not authorize the application.

    • Steps:
      • Step 1: Click 'Log in with Twitter'.
      • Step 2: Do not authorize on the Twitter auth page.
    • Expected Result:
      • After Step 1, a new tab for OAuth is opened and the user is redirected to the Twitter auth page.
      • After Step 2, the user is not redirected back to the application and no access tokens are passed to the frontend.
  3. Test Case: Verify that a user cannot perform actions (Retweet, Like, Follow) if they are not logged in.

    • Steps:
      • Step 3: Click 'Retweet', 'Like', or 'Follow'.
    • Expected Result:
      • After Step 3, the user is not able to perform the requested action and an error message is displayed.

Actions

All endpoint tests are passed based on the previous test cases.

Actions Check

All endpoint tests are passed based on the previous test cases.

Airdrop Claim and Promotion Code Generation for Parent User

  1. Test Case: Verify that a parent user can successfully claim the airdrop and generate a promotion code.

    • Steps:
      • Step 1: Click the 'Check Eligibility' button.
      • Step 2: Click 'Claim Airdrop'.
      • Step 3: Click 'Confirm Airdrop'.
      • Step 4: Click 'Generate Promotion Code'.
    • Expected Result:
      • After Step 1, the user purchase status is displayed (rejected if not purchased).
      • After Step 2, the transaction succeed result is displayed (rejected if airdrop is not available).
      • After Step 3, the transaction result is displayed and a promotion code pops up.
      • After Step 4, a promotion code is displayed.
  2. Test Case: Verify that a user cannot claim the airdrop if they have not purchased the $Lotso 1st generation token.

    • Steps:
      • Step 1: Click the 'Check Eligibility' button.
    • Expected Result:
      • After Step 1, the user is rejected because they have not purchased the token.
  3. Test Case: Verify that a user cannot claim the airdrop if they have not finished the required steps.

    • Steps:
      • Step 1: Click the 'Check Eligibility' button.
    • Expected Result:
      • After Step 1, the user is rejected because they have not finished the required steps.
  4. Test Case: Verify that a user cannot claim the airdrop if it is not available.

    • Steps:
      • Step 2: Click 'Claim Airdrop'.
    • Expected Result:
      • After Step 2, the user is rejected because the airdrop is not available.
  5. Test Case: Verify that a user cannot generate a promotion code if they have not finished the required steps.

    • Steps:
      • Step 4: Click 'Generate Promotion Code'.
    • Expected Result:
      • After Step 4, the user is rejected because they have not finished the required steps.

Airdrop Claim and Promotion Code Generation for Child User

  1. Test Case: Verify that a child user can successfully claim the airdrop and generate a promotion code using the parent user's promotion code.

    • Steps:
      • Step 1: Input the parent user's promotion code after finishing the required missions.
      • Step 2: Click the 'Check Eligibility' button.
      • Step 3: Click 'Claim Airdrop'.
      • Step 4: Click 'Confirm Airdrop'.
      • Step 5: Click 'Generate Promotion Code'.
    • Expected Result:
      • After Step 1, the user purchase status is displayed (rejected if not purchased).
      • After Step 2, the transaction succeed result is displayed (rejected if airdrop is not available).
      • After Step 3, the transaction result is displayed and a promotion code pops up.
      • After Step 4, a promotion code is displayed.
  2. Test Case: Verify that a child user cannot claim the airdrop if they have not purchased the $Lotso 1st generation token and input the parent user's promotion code.

    • Steps:
      • Step 1: Click the 'Check Eligibility' button.
    • Expected Result:
      • After Step 1, the user need to input the promotion code to claim the airdrop.
  3. Test Case: Verify that a child user cannot claim the airdrop if the promotion code is invalid.

    • Steps:
      • Step 1: Input an invalid promotion code.
      • Step 2: Click the 'Check Eligibility' button.
    • Expected Result:
      • After Step 1, the user is rejected because the promotion code is invalid.
  4. Test Case: Verify that a child user cannot claim the airdrop if they have not finished the required steps.

    • Steps:
      • Step 1: Click the 'Check Eligibility' button.
    • Expected Result:
      • After Step 1, the user is rejected because they have not finished the required steps.
  5. Test Case: Verify that a child user cannot claim the airdrop if it is not available.

    • Steps:
      • Step 2: Click 'Claim Airdrop'.
    • Expected Result:
      • After Step 2, the user is rejected because the airdrop is not available.
  6. Test Case: Verify that a child user cannot generate a promotion code if they have not finished the required steps.

    • Steps:
      • Step 4: Click 'Generate Promotion Code'.
    • Expected Result:
      • After Step 4, the user is rejected because they have not finished the required steps.

Email Subscription

Not tested.