From 41e555baebda99ea63e3cfeb127fc662286aac44 Mon Sep 17 00:00:00 2001 From: mgbdev Date: Wed, 20 Nov 2013 17:52:37 +0530 Subject: [PATCH] CRM-13759 add webtest for multiple phone edit --- .../WebTest/Contact/EditContactTest.php | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 tests/phpunit/WebTest/Contact/EditContactTest.php diff --git a/tests/phpunit/WebTest/Contact/EditContactTest.php b/tests/phpunit/WebTest/Contact/EditContactTest.php new file mode 100644 index 0000000000..b9976a8144 --- /dev/null +++ b/tests/phpunit/WebTest/Contact/EditContactTest.php @@ -0,0 +1,98 @@ +webtestLogin(); + + // create contact + $this->openCiviPage("contact/add", "reset=1&ct=Individual"); + $this->type("first_name",'ftest'); + $this->type("last_name",'ltest'); + + //fill in phone 1 + $this->type("phone_1_phone", "111113333"); + $this->type("phone_1_phone_ext", "101"); + + //fill in phone 2 + $this->click("//a[@id='addPhone']"); + $this->type("phone_2_phone", "23213333"); + $this->type("phone_2_phone_ext", "165"); + $this->select('phone_2_location_type_id', 'value=2'); + + //fill in phone 3 + $this->click("//a[@id='addPhone']"); + $this->type("phone_3_phone", "2321877699"); + $this->type("phone_3_phone_ext", "195"); + $this->select('phone_3_location_type_id', 'value=2'); + + //fill in phone 4 + $this->click("//a[@id='addPhone']"); + $this->type("phone_4_phone", "2321398766"); + $this->type("phone_4_phone_ext", "198"); + $this->select('phone_4_location_type_id', 'value=2'); + + // Submit form + $this->click("_qf_Contact_upload_view-bottom"); + $this->waitForElementPresent('css=.crm-inline-edit-container.crm-edit-ready'); + + //Edit COntact + $cid = $this->urlArg('cid'); + $this->openCiviPage("contact/add", "reset=1&action=update&cid={$cid}"); + + //Edit in phone 2 + $this->type("phone_2_phone", "2321800000"); + $this->type("phone_2_phone_ext", "111"); + $this->select('phone_2_location_type_id', 'value=3'); + + //Edit in phone 3 + $this->type("phone_3_phone", "777777699"); + $this->type("phone_3_phone_ext", "195"); + $this->select('phone_3_location_type_id', 'value=1'); + + //Edit in phone 4 + $this->type("phone_4_phone", "2342322222"); + $this->type("phone_4_phone_ext", "198"); + $this->select('phone_4_location_type_id', 'value=3'); + + // Submit form + $this->click("_qf_Contact_upload_view-bottom"); + $this->waitForElementPresent('css=.crm-inline-edit-container.crm-edit-ready'); + + //assert + $this->assertTextPresent("111113333 ext. 101"); + $this->assertTextPresent("2321800000 ext. 111"); + $this->assertTextPresent("777777699 ext. 195"); + $this->assertTextPresent("2342322222 ext. 198"); + + } +} -- 2.25.1