/** * @param $capabilityName array of Capability ACL resources * @param $accessLevel * * @return $this */ public function setCapability($capabilityName, $accessLevel) { foreach ($capabilityName as $name) { $xpath = $this->test->byXpath("//div[strong/text() = '{$name}']/following-sibling::div//a"); $this->test->moveto($xpath); $xpath->click(); $this->waitForAjax(); $this->accessLevel = $this->test->select($this->test->byXpath("//div[strong/text() = '{$name}']/following-sibling::div//select")); $this->accessLevel->selectOptionByLabel($accessLevel); } return $this; }
/** * Method configure user IMAP sync * @param array $imapSetting * @return $this */ public function setImap($imapSetting) { $this->test->byXpath("//div[@class='control-group imap-config check-connection control-group-checkbox']" . "//input[@data-ftid='oro_user_user_form_imapConfiguration_useImap']")->click(); $this->waitForAjax(); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_imapHost']")->value($imapSetting['host']); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_imapPort']")->value($imapSetting['port']); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_user']")->value($imapSetting['user']); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_password']")->value($imapSetting['password']); $this->encryption = $this->test->select($this->test->byXpath("//*[@data-ftid='oro_user_user_form_imapConfiguration_imapEncryption']")); $this->encryption->selectOptionByLabel($imapSetting['encryption']); $this->test->byXPath("//button[@id='oro_user_user_form_imapConfiguration_check_connection']")->click(); $this->waitForAjax(); $this->waitPageToLoad(); $this->test->byXPath("//div[@class='control-group folder-tree " . "control-group-oro_email_email_folder_tree']//input[@class='check-all']")->click(); return $this; }