{"id":25253239,"url":"https://github.com/akashgkrishna/bookcart","last_synced_at":"2026-04-27T22:31:29.603Z","repository":{"id":274282124,"uuid":"922451782","full_name":"akashgkrishna/BookCart","owner":"akashgkrishna","description":"A Selenium-based test automation framework for the BookCart web application","archived":false,"fork":false,"pushed_at":"2025-03-01T08:12:54.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T22:29:35.975Z","etag":null,"topics":["allure-report","java","selenium","testng-framework"],"latest_commit_sha":null,"homepage":"https://bookcart.azurewebsites.net/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akashgkrishna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-26T08:44:17.000Z","updated_at":"2025-03-01T08:12:57.000Z","dependencies_parsed_at":"2025-02-19T18:42:16.214Z","dependency_job_id":null,"html_url":"https://github.com/akashgkrishna/BookCart","commit_stats":null,"previous_names":["akashgkrishna/bookcart","akashgkrishna/studious-barnacle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashgkrishna%2FBookCart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashgkrishna%2FBookCart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashgkrishna%2FBookCart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashgkrishna%2FBookCart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akashgkrishna","download_url":"https://codeload.github.com/akashgkrishna/BookCart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411240,"owners_count":20934650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure-report","java","selenium","testng-framework"],"created_at":"2025-02-12T04:58:46.385Z","updated_at":"2026-04-27T22:31:29.576Z","avatar_url":"https://github.com/akashgkrishna.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# BookCart Test Automation Framework\n\n[![Java](https://img.shields.io/badge/Java-22-blue)](https://www.java.com/)  [![Selenium](https://img.shields.io/badge/Selenium-4.27.0-green)](https://www.selenium.dev/)  [![TestNG](https://img.shields.io/badge/TestNG-7.10.2-red)](https://testng.org/)  [![Logback](https://img.shields.io/badge/Logback-1.5.16-lightgrey)](https://logback.qos.ch/)  [![Allure](https://img.shields.io/badge/Allure-2.29.1-blueviolet)](https://docs.qameta.io/allure/) [![Lombok](https://img.shields.io/badge/Lombok-1.18.36-pink)](https://projectlombok.org/)\n\nA Selenium-based, cross-browser test automation framework for the BookCart web application, supporting multiple environments, data-driven testing, reporting with Allure and custom logging.\n\n## Table of Contents\n\n-   [Features](#features)\n-   [Prerequisites](#prerequisites)\n-   [Installation](#installation)\n-   [Configuration](#configuration)\n-   [Execution](#execution)\n-   [Logging](#logging)\n-   [Project Structure](#project-structure)\n-   [Best Practices](#best-practices)\n-   [Future Roadmap](#future-roadmap)\n-   [License](#license)\n\n\n## Features\n-   **Environment Config**: Easily switch between QA, Staging, and Production via `config.properties` and system properties.\n-   **Driver Management**: Centralized driver handling.\n-   **Page Object Model (POM)**: Structured POM with separate packages for base pages, common components, and specialized pages.\n-   **Test Flow Abstraction**: Business logic encapsulated in flow classes (e.g., `LoginFlow`, `UserRegistrationFlow`).\n-   **Data-Driven Testing**: Centralized data generation with TestNG data providers for unique test runs.\n-   **Allure Reporting**: Auto-attached step annotations, failure screenshots, test descriptions, severity levels, and TMS links.\n-   **Custom Logging**: SLF4J/Logback with custom logger for clear, secure logs.\n-   **Lombok Integration**: Clean models with `@Builder`.\n-   **AspectJ Weaving**: Runtime instrumentation for enhanced reporting.\n-   **Smart Waits**: Mix of explicit waits and utility methods.\n-   **Headless Execution**: Configurable via `config.properties`.\n\n## Prerequisites\n\n-   **Java 22 JDK**\n-   **Maven 3.6+**\n-   **Chrome Browser (latest)**\n-   **IDE** (IntelliJ/Eclipse/VSCode)\n\n## Installation\n\n1. Clone the repository:  \n   `git clone git@github.com:akashgkrishna/BookCart.git `\n2. Build the project:  \n   `mvn clean install`\n\n## Configuration\n\n### Environment Setup: (`config.properties`)\n- Edit `src/main/resources/config.properties` to modify environment URLs\n- Supported environments: QA, Prod, Staging\n- Default environment: QA\n```properties\n# Environment URLs\nqa.url=https://bookcart.azurewebsites.net/\nstaging.url=https://staging-bookcart.azurewebsites.net/\nprod.url=https://prod-bookcart.azurewebsites.net/\n\n# Credentials\nqa.username=qa_user\nqa.password=qa_password\nstaging.username=staging_user\nstaging.password=staging_password\nprod.username=prod_user\nprod.password=prod_password\n\n```\n\n### Log Configuration: (`logback.xml`)\n\n```xml\n\u003c!-- Configure logging patterns and output locations --\u003e\n\u003croot level=\"trace\"\u003e\n    \u003cappender-ref ref=\"CONSOLE\"/\u003e\n    \u003cappender-ref ref=\"FILE\"/\u003e\n\u003c/root\u003e\n\n```\n### Browser setup:\n- Currently, supports (Chrome, Firefox, Safari and Edge)\n- Chrome is the default browser .\n- If you want other drivers just add the appropriate WebDriver instance in DriverManager class\n\n\n```properties\n# Browser configuration  \nbrowser=chrome  \nheadless=true\n```\n### Safari Browser setup:\nSafari's settings need to be adjusted to allow automation.\nFollow these steps:\n\n1.  **Enable the Develop Menu:**  \n    Open Safari and go to **Safari \u003e Preferences \u003e Advanced**. Then, check the box that says **\"Show Develop menu in menu bar\"**.\n\n2.  **Allow Remote Automation:**  \n    Once the Develop menu is visible, click on **Develop** in the menu bar and select **\"Allow Remote Automation\"**. This setting permits WebDriver to control Safari.\n\n3.  **Restart Safari:**  \n    After enabling the setting, close Safari and re-launch it to ensure the changes take effect.\n\n\nThese adjustments should allow SafariDriver to create a new session successfully.\n\n### Lombok setup\nVerify Lombok is enabled in your IDE. Without Lombok processing, none of the builder methods or getters (provided by `@Getter` and `@Builder`) are generated.\n\n**1. Add Lombok Dependency:**  \nEnsure that your `pom.xml` contains the Lombok dependency. For example:\n```xml\n\u003cdependency\u003e \n\t\u003cgroupId\u003eorg.projectlombok\u003c/groupId\u003e\n\t\u003cartifactId\u003elombok\u003c/artifactId\u003e \n\t\u003cversion\u003e1.18.24\u003c/version\u003e \n\t\u003cscope\u003eprovided\u003c/scope\u003e \n\u003c/dependency\u003e\n```\n**2. Enable Annotation Processing:**\n\n-   If you’re using an IDE like IntelliJ IDEA or Eclipse, make sure that annotation processing is enabled.\n    -   For Maven, the compiler plugin should pick up Lombok annotations if the dependency is correctly added.\n\n**3. Clean and Rebuild:**  \nAfter adjusting your configuration, perform a clean build (e.g., `mvn clean compile`) to verify that Lombok generates the expected methods.\n\n\n### Allure Configuration (`allure.properties`)\n```properties\nallure.results.directory=target/allure-results\n```\n\n### Error Messages (`error-messages.properties`)\n\n```properties\ninvalid.username=User Name is not available\ninvalid.password=Password requirements not met\n```\n\n### TestNG Suite (`testng.xml`)\n```xml\n\u003clisteners\u003e\n    \u003clistener class-name=\"io.qameta.allure.testng.AllureTestNg\"/\u003e\n\u003c/listeners\u003e\n```\n\n\n\n## Execution\n\n### Default (QA Environment):\n\n```bash\nmvn test\n```\n\n### Specific Environment:\n\n```bash\nmvn test -Denv=prod\n```\n\n### Supported Environments:\n\n-   `-Denv=qa` (default)\n-   `-Denv=staging`\n-   `-Denv=prod`\n### Generate Allure Report\n\n```bash\nmvn allure:serve\n```\n\n## Logging\n\n### Usage in Tests:\n\n```java\npublic class BasicTest extends BaseTest {\n    @Test\n    public void exampleTest() {\n        logger.info(\"Using credentials: {}\", username);\n        logger.error(\"Validation failed!\");\n    }\n}\n```\n\n### Log Outputs:\n\n```\n14:23:45 INFO  [TestNG] o.b.BasicTest - Using credentials: test01\n14:23:46 ERROR [TestNG] o.b.BasicTest - Validation failed!\n```\n\n## Project Structure\n\n```\n├── LICENSE                           // License information (e.g., MIT License)\n├── README.md                         // Project documentation and usage instructions\n├── pom.xml                           // Maven configuration with dependencies and build plugins\n└── src\n    ├── main\n    │   ├── java/org/bookcart/         // Main application code\n    │   │   ├── base/                  // Base test classes (e.g., BaseTest.java for setup/teardown)\n    │   │   ├── data/                  // Test data factories (e.g., UserDataFactory.java)\n    │   │   ├── driver/                // WebDriver management (e.g., DriverManager.java)\n    │   │   ├── flows/                 // Business logic flows (e.g., LoginFlow.java, UserRegistrationFlow.java)\n    │   │   ├── model/                 // Data models (e.g., User.java)\n    │   │   ├── pages/                 // Page Object Model classes (e.g., LoginPage.java, RegisterPage.java)\n    │   │   └── util/                  // Utility classes for various common functionalities:\n    │   │       ├── ConfigManager.java         // Loads and manages configuration properties\n    │   │       ├── CredentialsManager.java    // Retrieves user credentials based on the environment\n    │   │       ├── MessageUtils.java          // Handles common messages (e.g., error/info messages)\n    │   │       ├── ScreenshotUtils.java       // Captures screenshots for reporting, especially on failures\n    │   │       ├── WaitUtils.java             // Provides explicit wait methods for synchronizing tests\n    │   │       └── logging/                   // Custom logging utilities:\n    │   │           ├── CustomLogger.java      // Wrapper for logging functionality (using SLF4J/Logback)\n    │   │           └── LogManager.java        // Factory for instantiating and managing loggers\n    │   └── resources/                 // Application configuration files\n    │       ├── config.properties      // Environment URLs, credentials, and other settings\n    │       └── logback.xml            // Logging configuration (patterns, output locations)\n    └── test\n        ├── java/org/bookcart/         // Test code\n        │   ├── login/                 // Login-related test classes:\n        │   ├── providers/             // Data providers for tests:\n        │   │   └── UserDataProviders.java   // Supplies dynamic test data for user-related tests\n        │   └── userregistration/      // User registration test\n        └── resources/                 // Test configuration files\n            ├── allure.properties      // Configuration for Allure reporting\n            ├── error-messages.properties  // Common error messages used in tests\n            └── testng.xml           // TestNG suite configuration for test execution\n\n\n\n```\n\n## Best Practices\n\n### Logger Usage\n\n```java\n// Good\nlogger.info(\"Loading page: {}\", url);\n\n// Avoid\nSystem.out.println(\"Loading page: \" + url);\n\n```\n\n### Environment Isolation\n\n```bash\n# Never commit production credentials\n# Keep sensitive data in environment variables\n\n```\n\n### Allure Reporting\n**Add the necessary Annotations in test**\nExample:\n```java\n@Test(dataProviderClass = UserDataProviders.class,  \n        dataProvider = \"invalidRegistrationData\")  \n@Description(\"Verify that registration fails when user enters existing username\")  \n@TmsLink(\"CEL-TC-46\")  \n@Severity(SeverityLevel.CRITICAL)\n```\n**Add proper Step when needed**\nExample:\n```java\n@Step(\"Entering Credentials\")  \npublic void enterCredentials(String username, String password) {  \n    sendKeys(username, usernameTextField);  \n    sendKeys(password, passwordTextField);  \n}\n```\n\n### Lombok Models\n\n```java\n@Getter\n@Builder\npublic class User {\n    private final String username;\n    private final String password;\n}\n```\n### Data-Driven Testing\n\n```java\n@DataProvider\npublic Object[][] invalidLogins() {\n    return new Object[][]{\n            {\"invalidUser\", \"wrongPass\"},\n            {\"lockedUser\", \"secret123\"}\n    };\n}\n```\n\n## Future Roadmap\n\n-   Add BrowserStack Integration\n-   Create CI/CD Pipeline\n-  Grouping Tests\n-  Parallel Testing -TestNG parallel test runs\n- Docker Support - Containerized test execution\n\n## Report Issues\n\n-   [GitHub Issues](https://github.com/akashgkrishna/BookCart/issues)\n\n## License\n\nThis project is licensed under the [MIT License](https://github.com/akashgkrishna/BookCart/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashgkrishna%2Fbookcart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakashgkrishna%2Fbookcart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashgkrishna%2Fbookcart/lists"}