/
Personal Info and Tenant Switch

Personal Info and Tenant Switch

Prepared by

Test Scenario for

Prepared by

Test Scenario for

Foivos Polykarpou

Personal Info and Tenant Switch

Overview

Title

Test Name

Objective

Title

Test Name

Objective

Personal Info and Tenant Switch

swtenantfc.js

Purpose

  • 1.1. This test verifies the functionality of switching tenants from the personal info page of a web application.

  • 1.2. It checks for any errors during the tenant switch and captures console logs for further analysis.

Prerequisites

Dependencies Installed: Make sure the required npm packages mentioned in Login with valid and wrong credentials are installed

  • Install minimist for environment variable (baseURL)

  • 2.1. Ensure that the loginfc.js module is correctly set up and exports the page, browser, and baseUrl objects.

  • 2.2. The chai library should be installed for assertions.

  • 2.3. The test environment should have access to the web application at the specified baseUrl.

npm install puppeteer minimist

Test Steps

  • 4.1. Before Hook

    • Capture console logs from the page to monitor any errors or warnings during the test.

  • 4.2. After Hook

    • Close the browser to clean up resources after the test execution.

  • 4.3. Test Case: Navigate and Switch Tenants

    • Navigate to Personal Info Page

      • Use the page.goto method to navigate to the personal info page.

    • Find and Switch Tenants

      • Wait for tenant selection buttons to be visible.

      • Identify all switchable tenant buttons.

      • Iterate through each switchable button, clicking to switch tenants.

      • Verify the switch by checking for the presence of a "Selected" button.

      • Navigate back to the personal info page for subsequent switches.

    • Log Console Messages

      • Log all console messages to inspect for errors.

  • 4.4. Error Handling

    • If an error occurs during the process, capture a screenshot and log the page's HTML content for debugging.

Expected Result

  • 5.1. The test should successfully switch between all available tenants without errors.

  • 5.2. Console logs should be free of errors, and the presence of a "Selected" button should confirm each switch.