public function test_free_trial(Visitor $i) { return; $i->wantTo('Check if free trial is working'); $i->click('Free 14 days trial'); $i->waitForPageLoad(); $i->canSee('Sign in to continue'); $i->click('Register now'); $i->waitForText('Back To Login'); $i->wantTo('Check if registration is working'); $i->fillAtkField('first_name', 'Tester'); $i->fillAtkField('last_name', 'User'); $i->fillAtkField('username', '*****@*****.**'); $i->click('Register'); $i->waitForText('Password must not be empty'); $i->fillAtkField('password', '123'); $i->click('Register'); $i->waitForText('Password did not match'); $i->fillAtkField('retype_password', '*****@*****.**'); $i->click('Register'); $i->waitForText('Password did not match'); $i->fillAtkField('retype_password', '123'); $i->click('Register'); $i->waitForText('Sign in to continue'); $hash = $i->grabFromDatabase('user', 'hash', array('username' => '*****@*****.**')); $i->click('Activate'); $i->waitForText('Activate your Account'); $i->fillAtkField('email', '*****@*****.**'); $i->fillAtkField('activation_code', $hash); $i->click('Verify'); $i->waitForText('Sign in to continue'); $i->login('*****@*****.**', '123'); $i->wait(4); $i->click('Got it!'); $i->fillAtkField('epan_name', '001testepan'); $i->waitForText('Free 14 day Trial'); $i->click(['css' => '.xepan-service-trial button']); $i->wait(200); // remove wait in case of online testing // add test for links click (admin/website/myaccount) }
<?php if (!defined('INITIALIZED')) { exit; } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'logout') { Visitor::logout(); } if (isset($_REQUEST['account_login']) && isset($_REQUEST['password_login'])) { Visitor::setAccount($_REQUEST['account_login']); Visitor::setPassword($_REQUEST['password_login']); //Visitor::login(); // this set account and password from code above as login and password to next login attempt //Visitor::loadAccount(); // this is required to force reload account and get status of user $isTryingToLogin = true; } Visitor::login();