CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-allure-python-commons

Contains the API for end users as well as helper functions and classes to build Allure adapters for Python test frameworks

Overall
score

94%

Overview
Eval results
Files

task.mdevals/scenario-5/

E-commerce Order Processing Test Suite

Build a test suite for an e-commerce order processing system that provides detailed, hierarchical test reporting with granular step tracking.

Requirements

Create a test suite that validates the complete order processing workflow with detailed step-by-step reporting. The tests should break down complex user flows into traceable steps that clearly show what actions were performed during test execution.

Test Scenarios

Implement the following test scenarios with detailed step tracking:

  1. Successful Order Flow: Test the complete flow of a user placing an order successfully

    • User authentication
    • Adding items to cart
    • Applying a discount code
    • Processing payment
    • Confirming order
  2. Failed Payment Handling: Test the system's handling of payment failures

    • User authentication
    • Adding items to cart
    • Attempting payment with insufficient funds
    • Verifying cart preservation after failure
  3. Multi-Item Cart Operations: Test adding multiple items with different operations

    • Adding three different items sequentially
    • Updating quantity of one item
    • Removing one item
    • Calculating final total

Implementation Guidelines

  • Each major action within a test should be tracked as a discrete step
  • Steps should support nesting for sub-operations (e.g., adding items within a cart operation)
  • Step titles should include relevant parameters (e.g., product names, quantities, amounts)
  • Helper functions for reusable operations (login, add_to_cart, process_payment) should be instrumented for step reporting
  • The test file should demonstrate both decorator-based and context-manager-based approaches for defining steps

Test Data

Use the following simplified data structures:

# Product catalog
PRODUCTS = {
    "laptop": {"name": "Laptop", "price": 1200},
    "mouse": {"name": "Mouse", "price": 25},
    "keyboard": {"name": "Keyboard", "price": 75}
}

# Test users
TEST_USER = {"username": "testuser", "email": "test@example.com"}

# Discount codes
DISCOUNT_CODES = {
    "SAVE10": 0.10,  # 10% off
    "SAVE20": 0.20   # 20% off
}

Expected Behavior

For each test scenario, implement assertions to verify:

  • Authentication succeeds/fails appropriately
  • Cart operations modify cart state correctly
  • Payment processing returns expected results
  • Order totals are calculated correctly
  • System state is appropriate after each operation

Test Cases

  • The successful order flow test completes with all steps passing and final order total is correct @test
  • The failed payment test handles payment failure gracefully and preserves cart state @test
  • The multi-item cart test correctly tracks all cart operations and calculates the right total @test

Implementation

@generates

Dependencies { .dependencies }

allure-python-commons { .dependency }

Provides test reporting and step tracking capabilities.

Install with Tessl CLI

npx tessl i tessl/pypi-allure-python-commons

tile.json