/** * @param $userName * @param $password * * @return Login */ public function login($userName = null, $password = null, $args = []) { /** @var Login $login */ $login = new Login($this, $args); $login->setUsername($userName ? $userName : PHPUNIT_TESTSUITE_EXTENSION_SELENIUM_LOGIN)->setPassword($password ? $password : PHPUNIT_TESTSUITE_EXTENSION_SELENIUM_PASS)->submit(); return $login; }
/** * @param $username * @depends testCreateUser * @depends testEditRole */ public function testViewAccountsContacts($username) { $login = new Login($this); $login->setUsername($username)->setPassword('123123q')->submit(); /** @var Accounts $login */ $login->openAccounts('OroCRM\\Bundle\\AccountBundle')->assertTitle('Accounts - Customers')->assertElementNotPresent("//div[@class='container-fluid']//a[@title='Create Account']"); /** @var Contacts $login */ $login->openContacts('OroCRM\\Bundle\\ContactBundle')->assertTitle('Contacts - Customers')->assertElementNotPresent("//div[@class='container-fluid']//a[@title='Create Contact']"); /** @var ContactGroups $login */ $login->openContactGroups('OroCRM\\Bundle\\ContactBundle')->assertTitle('Contact Groups - System')->assertElementNotPresent("//div[@class='container-fluid']//a[@title='Create Contact Group']"); /** @var AclCheck $login */ $login->openAclCheck('Oro\\Bundle\\SecurityBundle')->assertAcl('account/create')->assertAcl('contact/create')->assertAcl('contact/group/create')->assertAcl('contact/group/create'); }
/** * @Given /^Login as an existing "([^"]*)" user and "([^"]*)" password$/ */ public function loginAsAnExistingUserAndPassword($user, $password) { $login = new Login($this); $login->setUsername($user)->setPassword($password)->submit()->assertTitle('Dashboard'); }