add view creation to selenium test. First step to the alterView tests.
authorioguix <ioguix>
Wed, 12 Dec 2007 17:13:30 +0000 (17:13 +0000)
committerioguix <ioguix>
Wed, 12 Dec 2007 17:13:30 +0000 (17:13 +0000)
selenium/tests/TestSuite.html
selenium/tests/create_view.php [new file with mode: 0644]
selenium/tests/intro.php [new file with mode: 0644]
selenium/tests/outro.php [new file with mode: 0644]

index 31109c71c8be38d80ffbf2574b5537b91f859bc5..c346f925152a007c93214a06413abfd6aec61492 100644 (file)
@@ -3,7 +3,7 @@
        <th>Test suite for PPA</th>
 </tr>
 <tr>
-       <td><a href="create_role.php">Create admin role</a></td>
+       <td><a href="intro.php">Create admin role</a></td>
 </tr>
 <tr>
        <td><a href="create_database.php">Create database</a></td>
@@ -38,6 +38,9 @@
 <tr>
        <td><a href="drop_column.php">Drop column</a></td>
 </tr>
+<tr>
+       <td><a href="create_view.php">Create View</a></td>
+</tr>
 <tr>
        <td><a href="create_index.php">Create index</a></td>
 </tr>
@@ -57,6 +60,6 @@
        <td><a href="drop_database.php">Drop database</a></td>
 </tr>
 <tr>
-       <td><a href="drop_role.php">Drop admin role</a></td>
+       <td><a href="outro.php">Drop admin role</a></td>
 </tr>
 </table>
diff --git a/selenium/tests/create_view.php b/selenium/tests/create_view.php
new file mode 100644 (file)
index 0000000..b961b92
--- /dev/null
@@ -0,0 +1,73 @@
+<?php require('./config.inc.php') ?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Create a view</td></tr>
+</thead><tbody>
+<?php include('login.php') ?>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strdatabases'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $testdb ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strschemas'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=public</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strviews'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strcreateview'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formView</td>
+       <td>student_promo</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formDefinition</td>
+       <td>SELECT student.id, name, birthday, resume, spe, year
+       FROM student
+       JOIN promo ON (student.id_promo=promo.id)</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formComment</td>
+       <td>students and their promotion</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//input[@value='Create']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strviewcreated'] ?></td>
+</tr>
+<?php include('logout.php'); ?>
+</tbody></table>
+</body>
+</html>
diff --git a/selenium/tests/intro.php b/selenium/tests/intro.php
new file mode 100644 (file)
index 0000000..210f109
--- /dev/null
@@ -0,0 +1,151 @@
+<?php require('./config.inc.php') ?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Try to create a role with wrong pass, create it, unlog and try login with it.</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td><?php echo $webUrl ?>/servers.php</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $serverName ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>//input[@name='loginUsername']</td>
+       <td><?php echo $superuser ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>//input[@id='loginPassword']</td>
+       <td><?php echo $superpass ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>loginSubmit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strroles'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strcreaterole'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formRolename</td>
+       <td><?php echo $admin_user ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formPassword</td>
+       <td><?php echo $admin_user_pass ?>bad</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formConfirm</td>
+       <td><?php echo $admin_user_pass ?></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>formSuper</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>formCreateDB</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>formCreateRole</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>formInherits</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>formCanLogin</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>create</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strpasswordconfirm'] ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formPassword</td>
+       <td><?php echo $admin_user_pass ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formConfirm</td>
+       <td><?php echo $admin_user_pass ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>create</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strrolecreated'] ?></td>
+</tr>
+<?php include('logout.php'); ?>
+<tr>
+       <td>open</td>
+       <td><?php echo $webUrl ?>/servers.php</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $serverName ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>//input[@name='loginUsername']</td>
+       <td><?php echo $admin_user ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>//input[@id='loginPassword']</td>
+       <td><?php echo $admin_user_pass ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>loginSubmit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//div[@class='topbar']/descendant::span[@class='username']</td>
+       <td><?php echo $admin_user ?></td>
+</tr>
+<?php include('logout.php'); ?>
+</tbody></table>
+</body>
+</html>
diff --git a/selenium/tests/outro.php b/selenium/tests/outro.php
new file mode 100644 (file)
index 0000000..acfaa33
--- /dev/null
@@ -0,0 +1,92 @@
+<?php require('./config.inc.php') ?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Admin role try to drop himself, logout, then superuser actually drop him.</td></tr>
+</thead><tbody>
+<?php include('login.php') ?>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strroles'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $admin_user ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//div[@class='trail']/descendant::a[@title='<?php echo $lang['strrole'] ?>']/span[@class='label']</td>
+       <td><?php echo $admin_user ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strdrop'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>drop</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strroledroppedbad'] ?></td>
+</tr>
+<?php include('logout.php'); ?>
+<tr>
+       <td>open</td>
+       <td><?php echo $webUrl ?>/servers.php</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $serverName ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>//input[@name='loginUsername']</td>
+       <td><?php echo $superuser ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>//input[@id='loginPassword']</td>
+       <td><?php echo $superpass ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>loginSubmit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strroles'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//tr/td/a[text()='<?php echo $admin_user ?>']/../../td/a[text()='<?php echo $lang['strdrop'] ?>']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>drop</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strroledropped'] ?></td>
+</tr>
+<?php include('logout.php'); ?>
+</tbody></table>
+</body>
+</html>