fix version and year
[civicrm-core.git] / tests / phpunit / WebTest / ACL / AssignUsersToRolesTest.php
old mode 100755 (executable)
new mode 100644 (file)
index f24349b..525d85b
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -135,12 +135,12 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
     $this->openCiviPage('contact/search/advanced', 'reset=1');
     $this->click("location");
     $this->waitForElementPresent("country");
-    $this->select("country", "United States");
+    $this->select("country", "UNITED STATES");
     $this->clickLink("_qf_Advanced_refresh");
     $this->waitForElementPresent("task");
     $this->click('radio_ts', 'ts_all');
     $this->click('task');
-    $this->select('task', 'label=New Smart Group');
+    $this->select('task', 'label=Group - create smart group');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $smartGroupTitle = "SmartGroup" . substr(sha1(rand()), 0, 4);
     $this->type("title", $smartGroupTitle);
@@ -153,7 +153,6 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
     $label = "TestAclRole" . substr(sha1(rand()), 0, 4);
     $this->waitForElementPresent("label");
     $this->type("label", $label);
-    $this->type("value", "Acl value" . $label);
     $this->click("_qf_Options_next-bottom");
     $this->waitForText('crm-notification-container', "The ACL Role '{$label}' has been saved.");
 
@@ -162,24 +161,29 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
     $this->click('newACL');
     $this->waitForElementPresent("acl_role_id");
     $this->select("acl_role_id", "label=" . $label);
+    $this->waitForAjaxContent();
     $this->select("entity_id", "label={$groupTitle}");
     $this->clickLink("_qf_EntityRole_next-botttom", 'newACL', FALSE);
 
     //Create ACL granting 'Edit' access on smart group to the role
+    $this->waitForAjaxContent();
     $this->openCiviPage("acl", "reset=1");
     $this->click('newACL');
     $this->waitForElementPresent("group_id");
     $this->select("group_id", "label={$smartGroupTitle}");
     $this->select("operation", "label=Edit");
+    $this->waitForAjaxContent();
     $this->select("entity_id", "label={$label}");
     $this->type("name", "describe {$label}");
     $this->clickLink("_qf_ACL_next-bottom", 'newACL', FALSE);
 
     //ACL granting edit permission on events.
+    $this->waitForAjaxContent();
     $this->click('newACL');
     $this->waitForElementPresent('name');
     $this->type("name", "Edit All Events $label");
     $this->select("entity_id", "label={$label}");
+    $this->waitForAjaxContent();
     $this->select("operation", "label=Edit");
     $this->click("xpath=//label[contains(text(), 'Events')]");
     $this->select("event_id", "value=0");
@@ -212,11 +216,11 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
     $this->openCiviPage('contact/search/advanced', 'reset=1');
     $this->click("location");
     $this->waitForElementPresent("country");
-    $this->select("country", "United States");
+    $this->select("country", "UNITED STATES");
     $this->clickLink("_qf_Advanced_refresh");
     $this->waitForElementPresent("xpath=//div[@class='crm-search-results']");
     $this->assertElementNotContainsText("xpath=//form[@id='Advanced']/div[3]/div/div", "No matches found for");
-    $this->verifyText("xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[8]", 'United States');
+    $this->verifyText("xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[8]", 'UNITED STATES');
 
     $this->checkEditOnEventProfile();
   }
@@ -376,6 +380,7 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
     $this->type("name", "Edit Events{$label}");
     $this->select("operation", "label=Edit");
     $this->select("entity_id", "label={$label}");
+    $this->waitForElementPresent("xpath=//tr[@class='crm-acl-form-block-object_type']/td[2]/label[contains(text(), 'Events')]");
     $this->click("xpath=//tr[@class='crm-acl-form-block-object_type']/td[2]/label[contains(text(), 'Events')]");
     $this->select("event_id", "label=All Events");
     $this->clickLink("_qf_ACL_next-bottom");