public function AjaxAddCartPopupTest::testPopupIsAjaxified in Commerce Ajax Add to Cart 8
Tests that the popup is indeed Ajaxified.
File
- modules/
dc_ajax_add_cart_popup/ tests/ src/ FunctionalJavascript/ AjaxAddCartPopupTest.php, line 48
Class
- AjaxAddCartPopupTest
- Ajax add cart popup tests.
Namespace
Drupal\Tests\dc_ajax_add_cart_popup\FunctionalJavascriptCode
public function testPopupIsAjaxified() {
$this
->drupalGet("product/{$this->variation->getProduct()->id()}");
$ajax_add_cart_button = $this
->getSession()
->getPage()
->findButton('Add to cart');
$ajax_add_cart_button
->click();
// Confirm that the popup has NOT appeared. It should not have appeared yet,
// since we didn't wait for AJAX to finish.
$this
->assertSession()
->pageTextNotContains("The item has been added to your cart.", 'Popup was found before AJAX finished.');
}