jeudi 8 août 2019

Behat hangs when there are multiple scenarios, but works on a single one

I have Behat test cases written like so:

Feature: Checkout
In order to buy products
As a customer
I need to be able to checkout items in the cart

Background: 
    Given I am on the checkout page
    And I chose payment with cash

@Ready
Scenario: Deliver now
    When I checkout with deliver asap option
    Then ops must be notified via a slack notification immediately
    And A shopper must be auto assigned the order immedaitely
    And A retailer must be notified about the order via a push notification immediately
    And My wallet should be deducted immediately

@NoneReady
Scenario: Deliver later
    When I checkout with deliver after 2 hours option 
    Then ops must be notified via a slack notification immediately
    And A shopper must be auto assigned the order via a push notification in 1:25 hours 
    And A retailer must be notified about the order via a push notification in 1:25 hours
    And My wallet should be deducted immediately

@AddressNotCovered
Scenario: Address Not Covered
    When I checkout with address_id that is not covered
    Then I should get an error

If I run behat on a single tag, it works just fine:

$ behat --tags=Ready
Feature: Checkout
  In order to buy products
  As a customer
  I need to be able to checkout items in the cart

  @Ready
  Scenario: Deliver now                                                                 # tests/features/Checkout/CheckOut.feature:9
    Given I am on the checkout page                                                     # CheckoutFeatureContext::iAmOnTheCheckoutPage()
    And I chose payment with cash                                                       # CheckoutFeatureContext::iChosePaymentWithCash()
    When I checkout with deliver asap option                                            # CheckoutFeatureContext::iCheckoutWithDeliverAsapOption()
    Then ops must be notified via a slack notification immediately                      # CheckoutFeatureContext::opsMustBeNotifiedViaASlackNotificationImmediately()
    And A shopper must be auto assigned the order immedaitely                           # CheckoutFeatureContext::aShopperMustBeAutoAssignedTheOrderViaAPushNotificationImmedaitely()
    And A retailer must be notified about the order via a push notification immediately # CheckoutFeatureContext::aRetailerMustBeNotifiedAboutTheOrderViaAPushNotificationImmediately()
    And My wallet should be deducted immediately                                        # CheckoutFeatureContext::myWalletShouldBeDeductedImmediately()

1 scenario (1 passed)
7 steps (7 passed)
0m3.85s (36.62Mb)

But if I run it on multiple tags, it hangs at the end of the first tag:

behat --tags=Ready,AddressNotCovered
Feature: Checkout
  In order to buy products
  As a customer
  I need to be able to checkout items in the cart

  @Ready
  Scenario: Deliver now                                                                 # tests/features/Checkout/CheckOut.feature:9
    Given I am on the checkout page                                                     # CheckoutFeatureContext::iAmOnTheCheckoutPage()
    And I chose payment with cash                                                       # CheckoutFeatureContext::iChosePaymentWithCash()
    When I checkout with deliver asap option                                            # CheckoutFeatureContext::iCheckoutWithDeliverAsapOption()
    Then ops must be notified via a slack notification immediately                      # CheckoutFeatureContext::opsMustBeNotifiedViaASlackNotificationImmediately()
    And A shopper must be auto assigned the order immedaitely                           # CheckoutFeatureContext::aShopperMustBeAutoAssignedTheOrderViaAPushNotificationImmedaitely()
    And A retailer must be notified about the order via a push notification immediately # CheckoutFeatureContext::aRetailerMustBeNotifiedAboutTheOrderViaAPushNotificationImmediately()
    And My wallet should be deducted immediately

What am I doing wrong?

Environment

Laravel 5.4
Behat 3.1.0
PHP 7.1.23
PHPUnit 5.7.27



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire