add selenium tests for altering view and adding a normal user
authorioguix <ioguix>
Fri, 14 Dec 2007 14:44:03 +0000 (14:44 +0000)
committerioguix <ioguix>
Fri, 14 Dec 2007 14:44:03 +0000 (14:44 +0000)
selenium/tests/TestSuite.html
selenium/tests/config.inc.php
selenium/tests/create_view.php
selenium/tests/drop_schema.php
selenium/tests/intro.php
selenium/tests/outro.php

index c346f925152a007c93214a06413abfd6aec61492..6108ae2b8adc839136c23b5651837721d17eae5c 100644 (file)
@@ -3,7 +3,7 @@
        <th>Test suite for PPA</th>
 </tr>
 <tr>
-       <td><a href="intro.php">Create admin role</a></td>
+       <td><a href="intro.php">Create test's roles</a></td>
 </tr>
 <tr>
        <td><a href="create_database.php">Create database</a></td>
 <tr>
        <td><a href="create_schema.php">Create schema</a></td>
 </tr>
-<tr>
-       <td><a href="drop_schema.php">Drop schema</a></td>
-</tr>
 <tr>
        <td><a href="create_domain.php">Create domain</a></td>
 </tr>
 <tr>
-       <td><a href="table.php">Create / Drop tables</a></td>
+       <td><a href="table.php">Create/Drop tables</a></td>
 </tr>
 <tr>
        <td><a href="sequence.php">Create/Alter/Drop sequence</a></td>
@@ -39,7 +36,7 @@
        <td><a href="drop_column.php">Drop column</a></td>
 </tr>
 <tr>
-       <td><a href="create_view.php">Create View</a></td>
+       <td><a href="create_view.php">Create/Alter View</a></td>
 </tr>
 <tr>
        <td><a href="create_index.php">Create index</a></td>
        <td><a href="drop_index.php">Drop index</a></td>
 </tr>
 <tr>
-       <td><a href="drop_schema_bad.php">Drop schema fail</a></td>
+       <td><a href="drop_schema.php">Drop schema</a></td>
 </tr>
+<!--tr>
+       <td><a href="drop_schema_bad.php">Drop schema fail</a></td>
+</tr-->
 <!--tr>
        <td><a href="drop_table.php">Drop table</a></td>
 </tr-->
@@ -60,6 +60,6 @@
        <td><a href="drop_database.php">Drop database</a></td>
 </tr>
 <tr>
-       <td><a href="outro.php">Drop admin role</a></td>
+       <td><a href="outro.php">Drop test's roles</a></td>
 </tr>
 </table>
index 9be2f1fa98682012ef070cca487efe616551d112..523f09b2f375f465e78e98a9d0be83a945d55927 100644 (file)
@@ -1,13 +1,15 @@
 <?php
 require('../../lang/recoded/english.php');
 
-$webUrl = 'http://boox/~ioguix/ppa/ppa.dev';
-$serverName = '8.3'; // one of your $conf['servers'][*]['desc'] in conf/config.inc/php
+$webUrl = 'http://guillaume/~guillaume/projects/ppa/ppa.sel';
+$serverName = 'pg8.1'; // one of your $conf['servers'][*]['desc'] in conf/config.inc/php
 #deprecated $superuser = 'ppatests_super'; // according to your selenium/tests/data/config.sql
 #deprecated $superpass = 'super'; // according to your selenium/tests/data/config.sql
 $superuser = 'postgres'; //only use to create and drop the following admin role
 $superpass = 'pgpass';
 $admin_user = 'admin_user';
 $admin_user_pass = 'super';
+$user = 'ppa_tests_user';
+$user_pass = 'ppa_tests_user_pass';
 $testdb = 'ppatests_db';
 ?>
index b961b9232b09cf2d67b4c9e9a2d8ec3affe5ba7e..586e38176cb48f5485f7d6105f62b27a22f7cbd3 100644 (file)
@@ -7,9 +7,10 @@
 <body>
 <table cellpadding="1" cellspacing="1" border="1">
 <thead>
-<tr><td rowspan="1" colspan="3">Create a view</td></tr>
+<tr><td rowspan="1" colspan="3">Create/Alter a view</td></tr>
 </thead><tbody>
 <?php include('login.php') ?>
+<!-- CREATE -->
 <tr>
        <td>clickAndWait</td>
        <td>link=<?php echo $lang['strdatabases'] ?></td>
        <td>//p[@class='message']</td>
        <td><?php echo $lang['strviewcreated'] ?></td>
 </tr>
+<!-- ALTER -->
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strviews'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=student_promo</td>
+       <td></td>
+</tr>
+<!--alter name-->
+<tr>
+       <td>clickAndWait</td>
+       <td>//ul[@class='navlink']/li/a[text()='<?php echo $lang['stralter'] ?>']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>name</td>
+       <td>student_promo_renamed</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>alter</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strviewaltered'] ?></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//div[@class='trail']/descendant::a[@title='<?php echo $lang['strview'] ?>']/span[@class='label']</td>
+       <td>student_promo_renamed</td>
+</tr>
+<!--alter comment-->
+<tr>
+       <td>clickAndWait</td>
+       <td>//ul[@class='navlink']/li/a[text()='<?php echo $lang['stralter'] ?>']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>comment</td>
+       <td>students and their promotion (altered)</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>alter</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strviewaltered'] ?></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='comment']</td>
+       <td>students and their promotion (altered)</td>
+</tr>
+<!--alter schema-->
+<tr>
+       <td>clickAndWait</td>
+       <td>//ul[@class='navlink']/li/a[text()='<?php echo $lang['stralter'] ?>']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>select</td>
+       <td>newschema</td>
+       <td>label=test_schema</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>alter</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strviewaltered'] ?></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//div[@class='trail']/descendant::a[@title='<?php echo $lang['strschema'] ?>']/span[@class='label']</td>
+       <td>test_schema</td>
+</tr>
+<!--alter owner-->
+<tr>
+       <td>clickAndWait</td>
+       <td>//ul[@class='navlink']/li/a[text()='<?php echo $lang['stralter'] ?>']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>select</td>
+       <td>owner</td>
+       <td>label=<?php echo $user ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>alter</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strviewaltered'] ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//div[@class='trail']/descendant::a[@title='<?php echo $lang['strschema'] ?>']/span[@class='label' and text()='test_schema']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strviews'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//tr/td[1]/a[text()='student_promo_renamed']/../../td[2]</td>
+       <td><?php echo $user ?></td>
+</tr>
+<!--alter back to original: name, comment, schema & owner in the same time-->
+<tr>
+       <td>clickAndWait</td>
+       <td>link=student_promo_renamed</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//ul[@class='navlink']/li/a[text()='<?php echo $lang['stralter'] ?>']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>select</td>
+       <td>owner</td>
+       <td>label=<?php echo $admin_user ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>name</td>
+       <td>student_promo</td>
+</tr>
+<tr>
+       <td>select</td>
+       <td>newschema</td>
+       <td>label=public</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>comment</td>
+       <td>students and their promotion</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>alter</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='message']</td>
+       <td><?php echo $lang['strviewaltered'] ?></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//p[@class='comment']</td>
+       <td>students and their promotion</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//div[@class='trail']/descendant::a[@title='<?php echo $lang['strview'] ?>']/span[@class='label']</td>
+       <td>student_promo</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//div[@class='trail']/descendant::a[@title='<?php echo $lang['strschema'] ?>']/span[@class='label' and text()='public']</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strviews'] ?></td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//tr/td[1]/a[text()='student_promo']/../../td[2]</td>
+       <td><?php echo $admin_user ?></td>
+</tr>
+
 <?php include('logout.php'); ?>
 </tbody></table>
 </body>
index dc3207869ba69582a9dd2f11306d57b6123a7358..5bdd826f25bec0d602533cbfa1141c38b77e599f 100644 (file)
@@ -7,7 +7,7 @@
 <body>
 <table cellpadding="1" cellspacing="1" border="1">
 <thead>
-<tr><td rowspan="1" colspan="3">Drop a schema</td></tr>
+<tr><td rowspan="1" colspan="3">Fail to drop a schema, then actualy drop the test_schema</td></tr>
 </thead><tbody>
 <?php include('login.php') ?>
 <tr>
        <td>link=<?php echo $lang['strschemas'] ?></td>
        <td></td>
 </tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//tr/td/a[text()='public']/../../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['strschemadroppedbad'] ?></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>link=<?php echo $lang['strschemas'] ?></td>
+       <td></td>
+</tr>
 <tr>
        <td>clickAndWait</td>
        <td>//tr/td/a[text()='test_schema']/../../td/a[text()='<?php echo $lang['strdrop'] ?>']</td>
index 210f109e71cd691d5e519a1973de23cf12939f3c..5a99b607d890356f2e4ee9f5b862dac249f02e60 100644 (file)
        <td>//div[@class='topbar']/descendant::span[@class='username']</td>
        <td><?php echo $admin_user ?></td>
 </tr>
+<!-- create user role -->
+<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 $user ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formPassword</td>
+       <td><?php echo $user_pass ?></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>formConfirm</td>
+       <td><?php echo $user_pass ?></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['strrolecreated'] ?></td>
+</tr>
 <?php include('logout.php'); ?>
 </tbody></table>
 </body>
index acfaa337456eeaab87f12dde4227dcf90ac6be1c..f26d070e867f1664eba011f79607380469e64baf 100644 (file)
@@ -7,7 +7,7 @@
 <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>
+<tr><td rowspan="1" colspan="3">Admin role try to drop himself, logout, then superuser actually drop him & normal user.</td></tr>
 </thead><tbody>
 <?php include('login.php') ?>
 <tr>
        <td>//p[@class='message']</td>
        <td><?php echo $lang['strroledropped'] ?></td>
 </tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//tr/td/a[text()='<?php echo $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>