Maybe one out of four times the CouponRedemptionPaneTest test fails. I wonder if it is due to an assert not waiting for AJAX properly?

Example build: https://travis-ci.org/drupalcommerce/commerce/jobs/275090635

    1)
    Drupal\Tests\commerce_promotion\FunctionalJavascript\CouponRedemptionPaneTest::testCheckoutWithMainSubmit
    Behat\Mink\Exception\ResponseTextException: The text "Visa ending in
    1111" was not found anywhere in the text of the current page.

In

    /home/travis/build/drupalcommerce/drupal-8/drupal/vendor/behat/mink/src/WebAssert.php:787
    /home/travis/build/drupalcommerce/drupal-8/drupal/vendor/behat/mink/src/WebAssert.php:262
    /home/travis/build/drupalcommerce/commerce/modules/promotion/tests/src/FunctionalJavascript/CouponRedemptionPaneTest.php:256
CommentFileSizeAuthor
#6 2909308-6.patch914 bytesalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Issue summary: View changes
mglaman’s picture

The test code

  public function testCheckoutWithMainSubmit() {
    $coupons = $this->promotion->getCoupons();
    $coupon = reset($coupons);
    $this->drupalGet(Url::fromRoute('commerce_checkout.form', ['commerce_order' => $this->cart->id()]));

    $this->getSession()->getPage()->fillField('Coupon code', $coupon->getCode());
    $this->submitForm([], 'Continue to review');
    $this->assertSession()->pageTextContains('Visa ending in 1111');

Something is causing it to not continue, which means there is either a PHP error or validation error.

alexpott’s picture

Looking at the HTML generated it seems that the expectation of 1111 is incorrect. It has a visa ending in 9999 - this might be to do with #2930209: Random fail in PaymentMethodStorageTest

alexpott’s picture

This would explain why there has not been a pass since that patch was committed.

alexpott’s picture

Status: Active » Needs review
FileSize
914 bytes

Here's a patch.

alexpott’s picture

Title: CouponRedemptionPaneTest randomly fails. » CouponRedemptionPaneTest fails.
Priority: Major » Critical

This is critical because it is now not random.

  • bojanz committed 6a220e8 on 8.x-2.x authored by alexpott
    Issue #2909308 by alexpott: CouponRedemptionPaneTest fails
    
bojanz’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.