diff options
Diffstat (limited to 'qa/t/test_keywords.t')
-rw-r--r-- | qa/t/test_keywords.t | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/qa/t/test_keywords.t b/qa/t/test_keywords.t index 0edffcc2f..da199b9c5 100644 --- a/qa/t/test_keywords.t +++ b/qa/t/test_keywords.t @@ -29,18 +29,18 @@ $sel->title_is("Select keyword"); # If keywords already exist, delete them to not disturb the test. -my $page = $sel->get_body_text(); +my $page = $sel->get_body_text(); my @keywords = $page =~ m/(key-selenium-\w+)/gi; foreach my $keyword (@keywords) { - my $url = $sel->get_attribute("link=$keyword\@href"); - $url =~ s/action=edit/action=del/; - $sel->click_ok("//a[\@href='$url']"); - $sel->wait_for_page_to_load(WAIT_TIME); - $sel->title_is("Delete Keyword"); - $sel->click_ok("delete"); - $sel->wait_for_page_to_load(WAIT_TIME); - $sel->title_is("Keyword Deleted"); + my $url = $sel->get_attribute("link=$keyword\@href"); + $url =~ s/action=edit/action=del/; + $sel->click_ok("//a[\@href='$url']"); + $sel->wait_for_page_to_load(WAIT_TIME); + $sel->title_is("Delete Keyword"); + $sel->click_ok("delete"); + $sel->wait_for_page_to_load(WAIT_TIME); + $sel->title_is("Keyword Deleted"); } # Now let's create our first keyword. @@ -52,7 +52,7 @@ $sel->title_is("Select keyword"); $sel->click_ok("link=Add a new keyword"); $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Add keyword"); -$sel->type_ok("name", "key-selenium-kone"); +$sel->type_ok("name", "key-selenium-kone"); $sel->type_ok("description", "Hopefully an ice cream"); $sel->click_ok("create"); $sel->wait_for_page_to_load(WAIT_TIME); @@ -63,19 +63,20 @@ $sel->title_is("New Keyword Created"); $sel->click_ok("link=Add a new keyword"); $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Add keyword"); -$sel->type_ok("name", "key-selenium-kone"); +$sel->type_ok("name", "key-selenium-kone"); $sel->type_ok("description", "FIX ME!"); $sel->click_ok("create"); $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Keyword Already Exists"); my $error_msg = trim($sel->get_text("error_msg")); -ok($error_msg eq 'A keyword with the name key-selenium-kone already exists.', 'Already created keyword'); +ok($error_msg eq 'A keyword with the name key-selenium-kone already exists.', + 'Already created keyword'); $sel->go_back_ok(); $sel->wait_for_page_to_load(WAIT_TIME); # Create a second keyword. -$sel->type_ok("name", "key-selenium-ktwo"); +$sel->type_ok("name", "key-selenium-ktwo"); $sel->type_ok("description", "FIX ME!"); $sel->click_ok("create"); $sel->wait_for_page_to_load(WAIT_TIME); @@ -86,13 +87,14 @@ $sel->title_is("New Keyword Created"); $sel->click_ok("link=key-selenium-ktwo"); $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Edit keyword"); -$sel->type_ok("name", "key-selenium-kone"); +$sel->type_ok("name", "key-selenium-kone"); $sel->type_ok("description", "the second keyword"); $sel->click_ok("update"); $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Keyword Already Exists"); $error_msg = trim($sel->get_text("error_msg")); -ok($error_msg eq 'A keyword with the name key-selenium-kone already exists.', 'Already created keyword'); +ok($error_msg eq 'A keyword with the name key-selenium-kone already exists.', + 'Already created keyword'); $sel->go_back_ok(); $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Edit keyword"); @@ -104,6 +106,7 @@ $sel->title_is("Keyword Updated"); # Add keywords to bugs go_to_bug($sel, $test_bug_1); + # If another script is playing with keywords too, don't mess with it. my $kw1 = $sel->get_text("keywords"); $sel->type_ok("keywords", "$kw1, key-selenium-kone"); @@ -133,6 +136,7 @@ $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Search for bugs"); $sel->remove_all_selections("product"); $sel->remove_all_selections("bug_status"); + # Try with a different case than the one in the DB. $sel->type_ok("keywords", "key-selenium-ktWO"); $sel->click_ok("Search"); @@ -145,6 +149,7 @@ $sel->wait_for_page_to_load(WAIT_TIME); $sel->title_is("Search for bugs"); $sel->remove_all_selections("product"); $sel->remove_all_selections("bug_status"); + # Bugzilla doesn't allow substrings for keywords. $sel->type_ok("keywords", "selen"); $sel->click_ok("Search"); |