diff options
author | Jehan-Guillaume (ioguix) de Rorthais | 2012-09-23 18:41:58 +0000 |
---|---|---|
committer | Jehan-Guillaume (ioguix) de Rorthais | 2012-09-23 18:41:58 +0000 |
commit | 17981197b36999eaf93fb67c4eb5fc600fb41448 (patch) | |
tree | bb5ae3b200d1a89cbb80003a422214109276e910 | |
parent | adab83dee7845279fe55fd17601e60622f37f693 (diff) |
Fix miscs tests in the admin functionnals tests
-rw-r--r-- | tests/selenium/src/12-admin.php | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/tests/selenium/src/12-admin.php b/tests/selenium/src/12-admin.php index df03a85f..b65974c2 100644 --- a/tests/selenium/src/12-admin.php +++ b/tests/selenium/src/12-admin.php @@ -35,20 +35,20 @@ } else $t->assertText('//h3[1]', $lang['strprocesses']); - $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[1]", $lang['strusername']); - $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[2]", $lang['strprocess']); - $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[3]", $lang['strsql']); - $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[4]", $lang['strstarttime']); - $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[5]", $lang['stractions']); - /* this check is a bit fragile, since it relies on new line wrapping */ - $t->assertText("//tr[contains(@class,'data')]/td[text()='{$admin_user}']/../td[1]", $admin_user); - if ($t->data->major_version > 8.1) - $t->assertText('//tr[contains(@class,\'data\')]/td[3]/pre[@class=\'data\']', 'SELECT datname, usename, *FROM pg_catalog.pg_stat_activity*WHERE datname=\'ppatests_db\'*ORDER BY usename, procpid'); - else - $t->assertText('//tr[contains(@class,\'data\')]/td[3]', '<IDLE>'); - $t->assertText("//tr[contains(@class,'data')]/td[text()='{$admin_user}']/../td[5]", $lang['strcancel']); - if ($t->data->hasQueryKill()) - $t->assertText("//tr[contains(@class,'data')]/td[text()='{$admin_user}']/../td[6]", $lang['strkill']); + + if ($t->data->major_version > 8.1) { + $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[1]", $lang['strusername']); + $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[2]", $lang['strprocess']); + $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[3]", $lang['strsql']); + $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[4]", $lang['strstarttime']); + $t->assertText("//tr/th[text()='{$lang['strusername']}' and @class='data']/../th[5]", $lang['stractions']); + $t->assertText("//tr[contains(@class,'data')]/td[text()='{$admin_user}']/../td[1]", $admin_user); + /* this check is a bit fragile, since it relies on new line wrapping */ + $t->assertText('//tr[contains(@class,\'data\')]/td[3]/pre[@class=\'data\']', 'SELECT datname, usename, *FROM pg_catalog.pg_stat_activity*WHERE datname=\'ppatests_db\'*ORDER BY usename,*pid'); + $t->assertText("//tr[contains(@class,'data')]/td[text()='{$admin_user}']/../td[5]", $lang['strcancel']); + if ($t->data->hasQueryKill()) + $t->assertText("//tr[contains(@class,'data')]/td[text()='{$admin_user}']/../td[6]", $lang['strkill']); + } /** 3 **/ $t->addComment('3. Check Locks'); @@ -94,6 +94,13 @@ $t->assertText("//p", sprintf($lang['strconfvacuumdatabase'], $testdb)); $t->check("//input[@name='vacuum_full']"); $t->check("//input[@name='vacuum_analyze']"); + /* PostgreSQL > 7.4 and < 8.2 doesn't support "vacuum full freeze" + * Split the test for these releases */ + if ($t->data->major_version < 8.2) { + $t->clickAndWait("//input[@value='{$lang['strvacuum']}']"); + $t->assertText('//p[@class=\'message\']', $lang['strvacuumgood']); + $t->clickAndWait("//input[@value='{$lang['strvacuum']}']"); + } $t->check("//input[@name='vacuum_freeze']"); $t->clickAndWait("//input[@value='{$lang['strvacuum']}']"); $t->assertText('//p[@class=\'message\']', $lang['strvacuumgood']); @@ -138,6 +145,13 @@ $t->assertText("//p", sprintf($lang['strconfvacuumtable'], 'student')); $t->check("//input[@name='vacuum_full']"); $t->check("//input[@name='vacuum_analyze']"); + /* PostgreSQL > 7.4 and < 8.2 doesn't support "vacuum full freeze" + * Split the test for these releases */ + if ($t->data->major_version < 8.2) { + $t->clickAndWait("//input[@value='{$lang['strvacuum']}']"); + $t->assertText('//p[@class=\'message\']', $lang['strvacuumgood']); + $t->clickAndWait("//input[@value='{$lang['strvacuum']}']"); + } $t->check("//input[@name='vacuum_freeze']"); $t->clickAndWait("//input[@value='{$lang['strvacuum']}']"); $t->assertText('//p[@class=\'message\']', $lang['strvacuumgood']); |