RiseVest Automation Project

This project is an end-to-end test automation suite using Playwright for testing a web application, focusing on functionalities like user login, wallet balance verification, and plan creation. The test scripts are written in JavaScript and configured to run in different browsers (Chrome, Firefox, and Edge) across various environments.

Table of Contents



Project Structure

The key files and folders in this project include:

├── pageObject/                   # Folder containing Page Object Model classes
│ ├── POManager.js                   # Manager class to initialize and manage page objects
│ ├── LoginPage.js                   # Page object for login functionality
│ ├── WalletPage.js                   # Page object for wallet functionality
│ └── PlanPage.js                   # Page object for plan functionality
├── tests/                   # Folder containing test scripts
├── helper/                   # Folder containing any helpers
├── env/                   # Folder containing the environment variables
├── .env.prod/                   # Production Enviroment variables
│ ├── Login.spec.js                   # Test file for login functionality
│ ├── Wallet.spec.js                   # Test file for wallet functionality
│ └── Plan.spec.js                   # Test file for plan functionality
│ └── regression.spec.js                  # Test file for regression
├── utils/                   # Utility folder for configuration and helper functions
│ ├── env.js                  # Environment configuration file
│ └── globalSetup.js                   # Global setup file for test initialization
├── .gitignore                   # Git ignore file
├── playwright.config.js                   # Playwright configuration file
├── package.json                   # Project's package configuration
└── README.md                   # Documentation for the project

Prerequisites

Ensure you have the following installed on your machine:

  • Node-js - for running JavaScript on the server
  • Playwright - for end-to-end testing
  • Git - for version control


Setup and Installation

  1. Clone the Repository: Clone this repository to your local machine.
    git clone https://github.com/amige9/riseVest-Automation.git <br>
    cd riseVest-Automation <br>
  2. Install Dependencies: Run the following command to install all required dependencies:
    npm install   
  3. Install Browsers: Playwright requires specific versions of browsers. Run the following command to install them:
    npx playwright install   

Environment Variables

To manage sensitive data (like login credentials), this project uses environment variables.
Navigate to the helper folder > env > .env.prod to insert your login details

EMAIL = "your-email@example.com"
PASSWORD = "your-password"


Scripts

The package.json includes scripts for running specific tests in different environments and browsers(chrome, edge):

  • Run Login Tests:
    npm run env:prodLoginTest
  • Run Wallet Tests:
     npm run env:prodWalletTest
  • Run Plans Tests:
     npm run env:prodPlanTest
  • Run Full Regression Tests:
     npm run env:prodRegressionTest


Generating Reports

This project is set up to generate reports using Allure Playwright Reporter:

  1. Generate Allure Report

    allure generate ./allure-results --clean
  2. View Allure Report

    allure open ./allure-report


Configuration

The playwright.config.js file includes settings like:

  • timeout: Maximum time a test can run (set to 120 seconds).
  • expect: Configurations for assertion timeouts.
  • projects: Defines browsers and configurations for running tests in Chrome, Edge.
  • reporter: Defines the type of report generated (HTML by default).
  • use: Shared settings for all tests, like enabling screenshots, trace, and video capture.

To modify any of these settings, edit the respective sections in playwright.config.js.



Troubleshooting

  1. Failed to Push to Remote: Ensure you pull the latest changes from the remote repository before pushing to avoid conflicts.
  2. Browser Compatibility Issues: Use the latest browser versions supported by Playwright.
  3. Timeout Errors: Increase the timeout in playwright.config.js if you encounter frequent timeout issues.