From cb3e6841db2228e5a85148f38e87d7a769b5aa17 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 16 Feb 2016 14:50:33 -0500 Subject: [PATCH] More extensive cart email test. --- .../src/VuFindTest/Mink/CartTest.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/CartTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/CartTest.php index e1eea8262a4..4a762c3cb90 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/CartTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/CartTest.php @@ -133,7 +133,10 @@ class CartTest extends \VuFindTest\Unit\MinkTestCase // Activate the cart: $this->changeConfigs( ['config' => - ['Site' => ['showBookBag' => true, 'theme' => 'bootprint3']] + [ + 'Site' => ['showBookBag' => true, 'theme' => 'bootprint3'], + 'Mail' => ['testOnly' => 1], + ], ] ); @@ -297,9 +300,17 @@ class CartTest extends \VuFindTest\Unit\MinkTestCase $this->fillInAccountForm($page); $this->findCss($page, '.modal-body .btn.btn-primary')->click(); - // Test that we now have an email form. - $toField = $this->findCss($page, '#email_to'); - $this->assertNotNull($toField); + $this->findCss($page, '.modal #email_from')->setValue('asdf@asdf.com'); + $this->findCss($page, '.modal #email_message')->setValue('message'); + $this->findCss($page, '.modal #email_to') + ->setValue('demian.katz@villanova.edu'); + $this->findCss($page, '.modal-body .btn.btn-primary')->click(); + $this->snooze(); + // Check for confirmation message + $this->assertEquals( + 'Your item(s) were emailed', + $this->findCss($page, '.modal .alert-info')->getText() + ); } /** -- GitLab