petermsouzajr / qa-shadow-report

Streamline your team's testing workflow with qa-shadow-report, an open-source tool that automatically consolidates Cypress & Playwright test data into Google Sheets or CSV for enhanced visibility and team collaboration.
https://www.npmjs.com/package/qa-shadow-report
MIT License
5 stars 5 forks source link

Contribution: Create Sanity Test Suite #94

Open petermsouzajr opened 4 months ago

petermsouzajr commented 4 months ago

Describe the contribution

Use command: "test:sanity": "node --experimental-vm-modules node_modules/.bin/jest --testNamePattern='\[sanity\]'",

Tasks:

  1. Configuration Check:

    • Verify that the project is correctly configured using isProjectConfigured.
    • Ensure the proper resolution of the post-install script path.
  2. Command-Line Interface (CLI):

    • Test that the CLI correctly parses the framework argument (e.g., cypress, playwright).
    • Validate that the CLI recognizes and handles the todays-report and monthly-summary commands.
    • Ensure that the CLI correctly processes optional flags (--csv, --duplicate).
    • Verify that the help message (--help) displays correctly.
  3. Google Sheets Configuration:

    • Verify that the script checks for the presence of Google Sheets configuration (GOOGLE_KEYFILE_PATH, GOOGLE_SHEET_ID).
    • Ensure the appropriate handling when Google Sheets configuration is missing (default to CSV).
  4. Post-Install Script Execution:

    • Test the execution of the post-install script if the project is not configured.
    • Validate the handling of errors during the execution of the post-install script.
  5. Daily Report Generation:

    • Verify that the handleDailyReport function is called with the correct options when the todays-report command is issued.
    • Ensure that errors during daily report generation are handled gracefully.
  6. Monthly Summary Generation:

    • Verify that the handleSummary function is called with the correct options when the monthly-summary command is issued.
    • Ensure that errors during monthly summary generation are handled gracefully.
    • Test that CSV output for monthly summaries is not supported and returns the correct error message.
  7. Main Function Execution:

    • Validate that the main function is called with the correct options when no specific command is issued.
    • Ensure that errors during the main function execution are handled gracefully.

Type of contribution

✨ Feature

Current behavior (if applicable)

No response

Suggested solution and implementation (if applicable)

No response

Additional context

No response

Code of Conduct