> ## Documentation Index
> Fetch the complete documentation index at: https://cona.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify E2E Testing

> End-to-end test scenarios for the Shopify-DATEV export platform

# Shopify E2E Testing

This document outlines the automated end-to-end test scenarios for the Shopify-DATEV export platform, focusing on order processing, payment handling, and DATEV export validation.

> **Note:** All tests follow the standardized test ID system. For details on the naming conventions, see the [E2E Testing Conventions](README).

## Automation Approach

All tests described in this document are implemented as automated tests using Playwright. The documentation serves as a reference for:

* What functionality is being tested by our automation suite
* The business scenarios that each test validates
* Expected outcomes that the automated assertions verify

Each test case is implemented in the `tests/e2e/shopify` directory with filenames matching the test IDs.

## Test Orders (Shopify E2E Store)

The following baseline test orders exist in the Shopify E2E store for validation:

| Order Number | VAT | Product        | Payment Provider | Payment Method | Fulfillment | Country | Date       |
| ------------ | --- | -------------- | ---------------- | -------------- | ----------- | ------- | ---------- |
| #1001        | 19% | Simple product | Shopify Payments | Mastercard     | Fulfilled   | Germany | 10.08.2025 |
| #1002        | 19% | Simple product | PayPal           | PayPal         | Fulfilled   | Germany | 10.08.2025 |

### Test Customers (Shopify E2E Store)

The following customers exist in the Shopify E2E store to validate B2C vs B2B handling based on VAT ID presence:

| Customer          | Type | VAT ID in Shopify |
| ----------------- | ---- | ----------------- |
| Shayna Runolfsson | B2C  | No                |
| Mirja Lammert     | B2B  | Yes               |

B2B/B2C classification is determined by whether the Shopify customer has a VAT ID (B2B) or not (B2C).

## Core Test Scenarios

### Basic Order with VAT Processing

<Note>SH-CORE-001</Note>

**Scenario**: Single product order with 19% VAT using Shopify Payments

**What the automation verifies**:

1. Order and Shopify Payments capture in CONA system
2. Journal entry creation with Fallback Accounts in CONA system
3. DATEV export generation contains:
   * Revenue entry with correct 19% VAT
   * Payment record (marked as not yet reconciled)
   * Proper tax account assignment

**Expected Result**: DATEV export shows revenue with correct VAT and unreconciled payment

### Payment Reconciliation Flow

<Note>SH-CORE-002</Note>

**Scenario**: Reconciling payments for completed orders

**What the automation verifies**:

1. Creation of multiple orders with Shopify Payments
2. Reconciliation process in CONA
3. Updated DATEV export generation
4. Payment reconciliation status in DATEV export

**Expected Result**: Updated DATEV export shows reconciled payments (same Belegfeld 1 ID) with proper accounting entries

### Multi-Tax Rate Order Processing

<Note>SH-CORE-003</Note>

**Scenario**: Order with mixed tax rates (19% and 7% VAT products)

**What the automation verifies**:

1. Product creation with different VAT rates
2. Purchase with mixed VAT products
3. DATEV export tax splitting accuracy

**Expected Result**: DATEV export correctly splits revenue by tax rate

### Refund Processing

<Note>SH-CORE-004</Note>

**Scenario**: Full and partial refunds

**What the automation verifies**:

1. Order creation and completion
2. Full refund processing
3. Partial refund processing
4. DATEV export refund entries and VAT handling

**Expected Result**: DATEV export shows refund entries with proper VAT reversal

### Multi-Currency Handling

<Note>SH-CORE-005</Note>

**Scenario**: Orders in different currencies

**What the automation verifies**:

1. Multi-currency shop configuration
2. Purchases in different currencies
3. DATEV export currency conversion

**Expected Result**: DATEV export shows correctly converted amounts in base currency

### Discount Handling

<Note>SH-CORE-006</Note>

**Scenario**: Orders with various discount types

**What the automation verifies**:

1. Order creation with percentage discounts
2. Order creation with fixed amount discounts
3. Order creation with free shipping discounts
4. DATEV export discount accounting treatment

**Expected Result**: DATEV export correctly handles different discount types according to accounting rules

### Gift Card Processing

<Note>SH-CORE-007</Note>

**Scenario**: Gift card purchase and redemption flow

**What the automation verifies**:

1. Gift card purchase and activation
2. Gift card redemption in orders
3. Partial gift card usage
4. DATEV export gift card accounting treatment

**Expected Result**: DATEV export properly accounts for gift card transactions

## Integration Test Scenarios

### DATEV Export Format Validation

<Note>SH-INT-002</Note>

**Scenario**: Validating export format compliance

**What the automation verifies**:

1. Exports with various data combinations
2. Export structure validation against DATEV specifications

**Expected Result**: All exports are DATEV-compliant

## Error Handling Test Scenarios

### Incomplete Data Handling

<Note>SH-ERR-001</Note>

**Scenario**: Orders with missing information

**What the automation verifies**:

1. Orders with incomplete tax information
2. DATEV export generation with incomplete data
3. Error handling and logging mechanisms

**Expected Result**: System handles incomplete data gracefully with proper error logging

### Synchronization Failure Recovery

<Note>SH-ERR-002</Note>

**Scenario**: Recovery from API failures

**What the automation verifies**:

1. Simulated Shopify API failures
2. Recovery mechanism triggering and execution
3. Data consistency after recovery

**Expected Result**: System recovers from API failures maintaining data integrity

## Performance Test Scenarios

### Bulk Order Processing

<Note>SH-PERF-001</Note>

**Scenario**: Processing high volume of orders

**What the automation verifies**:

1. Large batch order generation and processing
2. System performance under load
3. DATEV export generation timing

**Expected Result**: System handles bulk processing within acceptable time frames

### Large DATEV Export Generation

<Note>SH-PERF-002</Note>

**Scenario**: Generating export with extensive data

**What the automation verifies**:

1. Large dataset preparation
2. Export generation performance
3. Resource utilization during generation

**Expected Result**: Large exports generate within acceptable timeframes

## End-to-End User Journey Tests

### Complete Accounting Cycle

<Note>SH-E2E-001</Note>

**Scenario**: Full monthly accounting cycle

**What the automation verifies**:

1. Shop setup with products and tax rates
2. Monthly transaction generation
3. Payment and reconciliation processing
4. Month-end export generation
5. Export completeness validation

**Expected Result**: Month-end export is complete and ready for accounting purposes
