Rename some selenium builder test files and add a schema test builder
authorGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 29 Oct 2008 04:41:56 +0000 (00:41 -0400)
committerGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 29 Oct 2008 04:41:56 +0000 (00:41 -0400)
tests/selenium/src/04-database.php [moved from tests/selenium/src/02-database.php with 100% similarity]
tests/selenium/src/06-schema.php [new file with mode: 0644]
tests/selenium/src/99-cleantests.php [moved from tests/selenium/src/03-cleantests.php with 100% similarity]

diff --git a/tests/selenium/src/06-schema.php b/tests/selenium/src/06-schema.php
new file mode 100644 (file)
index 0000000..ea60418
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+       global $testsuite_file, $test_static_dir;
+
+       /*
+        * 1/ create test schema
+        * 2/ alter its name, owner and comment
+        * NB: droping the schema is in the cleantests.php tests
+        */
+       $t = new TestBuilder("{$test_static_dir}/{$server['desc']}/schema.html", $server['desc'],
+               'Schema tests',
+               'Create and Alter schema.'
+       );
+
+       $t->login($admin_user, $admin_user_pass);
+
+/** 1 **/
+       $t->clickAndWait("link={$lang['strdatabases']}");
+       $t->clickAndWait("link={$testdb}");
+       $t->clickAndWait("link={$lang['strschemas']}");
+       $t->clickAndWait("link={$lang['strcreateschema']}");
+       if ($data->hasAlterSchema()) {
+               $t->type('formName', 'test_schema_toalter');
+               if ($data->hasAlterSchemaOwner())
+                       $t->select('formAuth', $super_user[$server['desc']]);
+               else $t->select('formAuth', $admin_user);
+               $t->type('formComment', 'test schema comment to alter');
+       }
+       else {
+               $t->type('formName', 'test_schema');
+               $t->type('formComment', 'test schema comment');
+       }
+       $t->clickAndWait('create');
+       $t->assertText('//p[@class=\'message\']', $lang['strschemacreated']);
+
+/** 2 **/
+       if ($data->hasAlterSchema()) {
+               $t->clickAndWait("link={$lang['strschemas']}");
+               $t->clickAndWait("//tr/td/a[text()='test_schema_toalter']/../../td/a[text()='{$lang['stralter']}']");
+               $t->type('name', 'test_schema');
+               if ($data->hasAlterSchemaOwner())
+                       $t->select('owner', $admin_user);
+               $t->type('comment', 'test schema');
+               $t->clickAndWait('alter');
+               $t->assertText('//p[@class=\'message\']', $lang['strschemaaltered']);
+       }
+       
+       $t->logout();
+       $t->writeTests($testsuite_file);
+       unset($t);
+?>