correction subscriptions feature et steps

This commit is contained in:
Kroccmou
2025-06-13 23:44:46 +02:00
parent be51f5288f
commit 6218b38817
2 changed files with 151 additions and 26 deletions

View File

@@ -3,10 +3,10 @@
Feature: Manage subscriptions
Background:
Given the system has the following customers:
Given the subscription system has the following customers:
| id | firstName | lastName | phoneNumber | loyaltyPoints |
| 11111111-1111-1111-1111-111111111111 | Alice | Smith | 0600000001 | 100 |
And the system has the following subscriptions:
And the subscription system has the following subscriptions:
| subscriptionId | customerId | durationInMonths | startDate | endDate |
| sub-1 | 11111111-1111-1111-1111-111111111111 | 12 | 2023-01-01 | 2023-12-31 |
@@ -15,7 +15,7 @@ Feature: Manage subscriptions
| customerId | durationInMonths | paymentMethod | requestedStartDate |
| 11111111-1111-1111-1111-111111111111 | 6 | CREDIT_CARD | 2024-01-01 |
Then the subscription is created successfully
And the system now has 2 subscriptions
And the subscription system now has 2 subscriptions
Scenario: Get customer's subscription
When I request the subscription for customer "11111111-1111-1111-1111-111111111111"
@@ -27,27 +27,27 @@ Feature: Manage subscriptions
When I try to request a new subscription with the following information:
| customerId | durationInMonths | paymentMethod | requestedStartDate |
| 11111111-1111-1111-1111-111111111111 | 12 | LOYALTY_POINTS | 2024-01-01 |
Then the request fails
And I receive an error message containing "Not enough loyalty points"
And the system still has 1 subscription
Then the subscription request fails
And I receive a subscription error message containing "Not enough loyalty points"
And the subscription system still has 1 subscription
Scenario: Attempt to request a subscription with invalid details
When I try to request a new subscription with the following information:
| customerId | durationInMonths | paymentMethod | requestedStartDate |
| | | | |
Then the request fails
And I receive an error message containing "Invalid subscription details or payment method"
And the system still has 1 subscription
Then the subscription request fails
And I receive a subscription error message containing "Invalid subscription details or payment method"
And the subscription system still has 1 subscription
Scenario: Attempt to request a subscription for unknown customer
When I try to request a new subscription with the following information:
| customerId | durationInMonths | paymentMethod | requestedStartDate |
| 99999999-9999-9999-9999-999999999999 | 6 | CREDIT_CARD | 2024-01-01 |
Then the request fails
And I receive an error message containing "Customer not found"
And the system still has 1 subscription
Then the subscription request fails
And I receive a subscription error message containing "Customer not found"
And the subscription system still has 1 subscription
Scenario: Attempt to get subscription for unknown customer
When I request the subscription for customer "99999999-9999-9999-9999-999999999999"
Then the request fails
And I receive an error message containing "Subscription not found for the customer"
Then the subscription request fails
And I receive a subscription error message containing "Subscription not found for the customer"