/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); $this->_helper->waitForElement("byLinkText", "test_table"); $this->byLinkText("Browse")->click(); $this->_helper->waitForElement("byId", "table_results"); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); $this->_helper->waitForElement( "byXPath", "//a[contains(., 'test_table')]" ); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); $this->_helper->waitForElement("byLinkText", "Operations")->click(); $this->_helper->waitForElement( "byXPath", "//legend[contains(., 'Database comment:')]" ); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $more = $this->byLinkText("More"); $this->moveto($more); $this->_helper->waitForElement("byLinkText", "Settings")->click(); $this->_helper->waitForElement( "byXPath", "//a[@class='tabactive' and contains(., 'Settings')]" ); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); $this->_helper->waitForElement( "byXPath", "(//a[contains(., 'Structure')])[2]" )->click(); $this->_helper->waitForElement("byId", "tablestructure"); }
/** * Creates a table * * @return void */ public function testCreateTable() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); $this->_helper->waitForElement('byId', 'create_table_form_minimal'); $this->byCssSelector( "form#create_table_form_minimal input[name=table]" )->value("test_table"); $this->byName("num_fields")->value("4"); $this->byCssSelector('input[value=Go]')->click(); $this->_helper->waitForElement('byName', 'do_save_data'); // column details $column_text_details = array( "field_0_1" => "test_id", "field_0_3" => "14", "field_0_10" => "comm1", "field_1_1" => "test_column", "field_1_3" => "10", "field_1_10" => "comm2", ); foreach ($column_text_details as $field => $val) { $this->byId($field)->value($val); } $column_dropdown_details = array( "field_0_6" => "UNSIGNED", "field_0_8" => "PRIMARY", "field_1_2" => "VARCHAR", "field_1_5" => "utf8_general_ci", "field_1_4" => "As defined:" ); foreach ($column_dropdown_details as $selector => $value) { $sel = $this->select($this->byId($selector)); $sel->selectOptionByLabel($value); } $this->byName("field_default_value[1]")->value("def"); $this->byId("field_0_9")->click(); // auto increment $this->byId("field_1_7")->click(); // null // post $this->byName("do_save_data")->click(); $this->_helper->waitForElement("byLinkText", "test_table"); $this->_tableStructureAssertions(); }
/** * Creates and removes a user * * @return void */ public function testCreateRemoveUser() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText("Users")->click(); $link = $this->_helper->waitForElement("byLinkText", "Add user"); $link->click(); $userField = $this->_helper->waitForElement("byName", "username"); $userField->value($this->_txtUsername); $select = $this->select($this->byId("select_pred_hostname")); $select->selectOptionByLabel("Local"); $this->byId("button_generate_password")->click(); $this->assertNotEquals("", $this->byId("text_pma_pw")->value()); $this->assertNotEquals("", $this->byId("text_pma_pw2")->value()); $this->assertNotEquals("", $this->byId("generated_pw")->value()); $this->byId("text_pma_pw")->value($this->_txtPassword); $this->byId("text_pma_pw2")->value($this->_txtPassword); $this->byId("createdb-1")->click(); $this->byId("createdb-2")->click(); $this->byId("addUsersForm_checkall")->click(); $this->byName("adduser_submit")->click(); $success = $this->_helper->waitForElement("byCssSelector", "div.success"); $this->assertContains('You have added a new user', $success->text()); $el = $this->_helper->waitForElement("byId", "usersForm"); $temp = $this->_txtUsername."localhost"; $this->byXPath( "(//input[@name='selected_usr[]'])[@value='".$temp."']" )->click(); $this->byId("checkbox_drop_users_db")->click(); $this->acceptAlert(); $this->byId("buttonGo")->click(); $success = $this->_helper->waitForElement("byCssSelector", "div.success"); $this->assertContains( 'The selected users have been deleted', $success->text() ); }
/** * Creates a database and drops it * * @return void */ public function testCreateDropDatabase() { $this->_dbname = 'pma_testdb' . time(); $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText("Databases")->click(); $element = $this->_helper->waitForElement('byId', 'text_create_db'); $element->value($this->_dbname); $this->byId("buttonGo")->click(); $element = $this->_helper->waitForElement( "byCssSelector", "span.ajax_notification div.success" ); $this->_dropDatabase(); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); $this->_helper->waitForElement( "byXPath", "//a[contains(., 'test_table')]" )->click(); $this->_helper->waitForElement("byId", "table_results"); $more = $this->_helper->waitForElement("byLinkText", "More"); $this->moveto($more); $this->byXPath("//a[contains(., 'Operations')]")->click(); $this->_helper->waitForElement( "byXPath", "//legend[contains(., 'Alter table order by')]" ); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); $this->byLinkText($this->_dbname)->click(); }
$step = 1; ?> <html> <h1>RESTAPI TEST</h1> <h2>Step <?php echo $step++; ?> - Login</h2> <?php //Get the loginname and password! $id = $_SESSION['logindetails']['id']; $api = new Helper($url); $result = $api->login($login, $password); if ($result->status != 'success') { echo $result->data->message; return; } ?> <h2>Step <?php echo $step++; ?> - Count existing lists</h2> <?php $result = $api->listsGet(); if ($result->status != 'success') { echo $result->data->message;
//echo 'Warning! You already answered this poll!'; } } if (isset($_POST['submit-register'])) { $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL); $login = $_POST['login']; $pass1 = $_POST['password']; $pass2 = $_POST['password_repeat']; if ($pass1 == $pass2) { if ($helper->register()) { header('Location: index.php?page=login'); } } } if (isset($_POST['submit-login'])) { $loginner = $helper->login($user->getId(), $_POST['email'], $_POST['password']); if ($loginner != false) { $_SESSION['user'] = $loginner; $_SESSION['login'] = true; } } $smarty->assign("l", $l[LANG]); $smarty->assign("helper", $helper); $smarty->assign("user", isset($_SESSION['user']) ? $_SESSION['user'] : ''); $smarty->assign("website_title", $config['page_title']); $smarty->assign("website_subtitle", $config['page_subtitle']); $smarty->assign("menu", $config['menu']); $smarty->display(TEMP_PATH_HTML . 'header.tpl'); $smarty->display(TEMP_PATH_HTML . 'livepage.tpl'); $smarty->display(TEMP_PATH_HTML . 'footer.tpl'); } else {
<?php /** * Created by PhpStorm. * User: Papangping * Date: 8/7/14 * Time: 3:50 PM */ session_start(); include_once '../Manager.php'; include_once 'Helper.php'; if (!Helper::checkLogin()) { if ($_SERVER['REQUEST_METHOD'] == "GET") { Helper::includeLogin(); } else { Helper::login($_POST['username'], $_POST['password']); Helper::reload(); } } else { $page = isset($_GET['page']) ? $_GET['page'] : 'home'; Helper::displayPage($page); }
/** * setUp function that can use the selenium session (called before each test) * * @return void */ public function setUpPage() { $this->_helper->login(TESTSUITE_USER, TESTSUITE_PASSWORD); }