Skip to content

[Akshay_NexusCRM]Migrate framework from Saucedemo to Nexus CRM#2

Open
akshaybokade2426 wants to merge 2 commits intomainfrom
Akshay_NexusCRM
Open

[Akshay_NexusCRM]Migrate framework from Saucedemo to Nexus CRM#2
akshaybokade2426 wants to merge 2 commits intomainfrom
Akshay_NexusCRM

Conversation

@akshaybokade2426
Copy link
Copy Markdown
Owner

🚀 Port Framework to NexusCRM Application with Comprehensive Infrastructure Improvements

📋 Overview

This PR migrates the entire Selenium test framework from the Saucedemo sample application to the NexusCRM app. It includes significant refactoring of the page object model, test infrastructure, and browser utilities to improve robustness and maintainability.


🔧 Changes

⚙️ Configuration & Credentials

  • ✅ Updated config.yaml to point all environments to the NexusCRM app (https://thinking-tester-contact-list.herokuapp.com/)
  • ✅ Changed authentication from username/password to email/password credentials
  • ✅ Updated environment.py to include get_email() method replacing get_username()

📄 Page Objects

❌ Removed (Saucedemo-specific):

  • inventory_page.py - Product inventory page
  • cart_page.py - Shopping cart page
  • checkout_step_one_page.py - Checkout user info page
  • checkout_step_two_page.py - Checkout overview page
  • checkout_complete_page.py - Order confirmation page

✨ Added (NexusCRM functionality):

  • add_contact_page.py - Add new contact form with all contact fields
  • contact_details_page.py - View and manage individual contact details
  • contact_list_page.py - Display and navigate contact list
  • edit_contact_page.py - Edit existing contact information
  • sign_up_page.py - User registration page

🔄 Refactored:

  • login_page.py - Updated for email-based authentication
  • base_page.py - Major enhancements (see below)

🎯 BasePage Refactoring

🏷️ Method Renames:

click() → do_click() send_keys() → do_send_keys() get_text() → get_element_text()

🎨 Enhanced is_visible()

  • Now returns boolean with robust exception handling

✨ New Helper Methods:

Method Category Methods
Frame Handling switch_to_frame()
Dropdown Selection select_by_index(), select_by_value(), select_By_VisibleText()
Mouse Interactions hover_to_element(), drag_and_Drop(), contextClick(), doubleClick()
Alert Handling switch_to_alert_accept(), switch_to_alert_dismiss(), switch_to_alert_sendKeys()
Scrolling scroll_To_element()

📦 Improved Imports

  • Added missing dependencies: Select, ActionChains

🧪 Test Infrastructure

📝 base_test.py Enhancements:

  • Multi-browser support: Chrome, Edge, and Firefox with dedicated profiles
  • ✅ Improved driver setup with comprehensive options for popup suppression
  • ✅ Worker-scoped logging to prevent I/O conflicts during parallel execution
  • ✅ Better exception handling in teardown
  • ✅ Proper stream handler cleanup to prevent log duplication

🔗 conftest.py Improvements:

  • ✅ Worker-specific logging (gw0, gw1, etc. for parallel execution)
  • ✅ Proper logger initialization and cleanup
  • ✅ Allure screenshot attachment on test failure with robust error handling
  • ✅ Added dependencies: urllib3 for connection error handling

📂 Test Files

❌ Removed:

  • test_login.py - Old Saucedemo login tests
  • test_logging_only.py - Utility test
  • sample_data_test.py - Sample parametrized test
  • test_date_picker.py - Placeholder

✨ Added:

  • test_log_in.py - Login tests for NexusCRM app (successful and failure scenarios)
  • test_add_contact.py - Add contact functionality tests
  • test_delete_contact.py - Delete contact functionality tests

📊 Test Data & Utilities

  • 📝 Updated test_urls.yaml - New endpoint mappings for NexusCRM application
  • 📊 Updated TestData_NexusCRM.xlsx - For test data management
  • 🚀 Enhanced run_tests.py - Test runner with report cleanup and Allure integration
  • ⚙️ Updated setup_framework.py - Adjusted Excel data handling (commented out)

📦 Dependencies

  • allure-python-commons - For enhanced Allure reporting
  • urllib3 - For robust connection error handling

✅ Testing & Validation

Feature Status
Login functionality with valid/invalid credentials
Contact CRUD operations (Create, Read, Update, Delete)
Multi-browser testing support (Chrome, Edge, Firefox)
Parallel test execution with proper logging isolation
Screenshot on failure with Allure attachments
Comprehensive error handling and logging

🎁 Benefits

📚 Better Maintainability

  • Cleaner page object model with renamed methods following conventions

💪 Improved Robustness

  • Enhanced waits, better exception handling, and alert management

🌐 Multi-Browser Support

  • Easy browser switching for CI/CD pipelines

⚡ Parallel Execution

  • Worker-scoped logging prevents file conflicts

📊 Better Reporting

  • Allure integration with screenshots and execution logs

🔌 Extensibility

  • Helper methods in BasePage reduce code duplication

⚠️ Breaking Changes

Method names in BasePage have changed:

click()              → do_click()
send_keys()          → do_send_keys()
get_text()           → get_element_text()

Delete run_tests.py which implemented a local daily test runner: cleaning up old Allure report folders, creating today's allure-results directory and environment.properties, running pytest to generate results, and serving the Allure report. Likely removed because test execution/reporting has been moved to CI or replaced by another tool.
@akshaybokade2426 akshaybokade2426 added the enhancement New feature or request label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants