2010-05-28 22:33:11 +04:00
|
|
|
|
use strict;
|
|
|
|
|
use warnings;
|
|
|
|
|
use lib qw(lib);
|
|
|
|
|
|
|
|
|
|
use Test::More "no_plan";
|
|
|
|
|
|
|
|
|
|
use QA::Util;
|
|
|
|
|
|
|
|
|
|
my ($sel, $config) = get_selenium();
|
|
|
|
|
|
|
|
|
|
log_in($sel, $config, 'admin');
|
|
|
|
|
set_parameters($sel, { "Bug Fields" => {"useclassification-on" => undef} });
|
2010-05-28 22:34:23 +04:00
|
|
|
|
logout($sel);
|
2010-05-28 22:33:11 +04:00
|
|
|
|
|
|
|
|
|
# Do not use file_bug_in_product() because our goal here is not to file
|
|
|
|
|
# a bug but to check what is present in the UI, and also to make sure
|
|
|
|
|
# that we get exactly the right page with the right information.
|
|
|
|
|
#
|
|
|
|
|
# The admin is not a member of the "QA‑Selenium‑TEST" group, and so
|
|
|
|
|
# cannot see the "QA‑Selenium‑TEST" product.
|
|
|
|
|
|
2010-05-28 22:34:23 +04:00
|
|
|
|
log_in($sel, $config, 'unprivileged');
|
2010-05-28 22:33:11 +04:00
|
|
|
|
$sel->click_ok("link=New");
|
|
|
|
|
$sel->wait_for_page_to_load_ok(WAIT_TIME);
|
|
|
|
|
$sel->title_is("Select Classification");
|
|
|
|
|
my $full_text = trim($sel->get_body_text());
|
2010-05-28 22:34:23 +04:00
|
|
|
|
_ok($full_text =~ /All: Show all products/, "The 'All' link is displayed");
|
2010-05-28 22:33:11 +04:00
|
|
|
|
$sel->click_ok("link=All");
|
|
|
|
|
$sel->wait_for_page_to_load_ok(WAIT_TIME);
|
|
|
|
|
$sel->title_is("Enter Bug");
|
2010-05-28 22:34:23 +04:00
|
|
|
|
_ok(!$sel->is_text_present("QA-Selenium-TEST"), "The QA-Selenium-TEST product is not displayed");
|
2010-05-28 22:33:11 +04:00
|
|
|
|
logout($sel);
|
|
|
|
|
|
|
|
|
|
# Same steps, but for a member of the "QA‑Selenium‑TEST" group.
|
|
|
|
|
# The "QA‑Selenium‑TEST" product must be visible to him.
|
|
|
|
|
|
|
|
|
|
log_in($sel, $config, 'QA_Selenium_TEST');
|
|
|
|
|
$sel->click_ok("link=New");
|
|
|
|
|
$sel->wait_for_page_to_load_ok(WAIT_TIME);
|
|
|
|
|
$sel->title_is("Select Classification");
|
|
|
|
|
$sel->click_ok("link=All");
|
|
|
|
|
$sel->wait_for_page_to_load_ok(WAIT_TIME);
|
|
|
|
|
$sel->title_is("Enter Bug");
|
|
|
|
|
$sel->is_text_present_ok("QA-Selenium-TEST");
|
|
|
|
|
# For some unknown reason, Selenium doesn't like hyphens in links.
|
2010-05-28 22:34:23 +04:00
|
|
|
|
$sel->click_ok("link=regexp:.*QA.Selenium.TEST.*");
|
|
|
|
|
#$sel->click_ok('//a[contains(@href, "QA-Selenium-TEST")]'); # this is incorrect for user QA-Selenium-TEST, this will click on "My Requests" link
|
2010-05-28 22:33:11 +04:00
|
|
|
|
$sel->wait_for_page_to_load_ok(WAIT_TIME);
|
|
|
|
|
$sel->title_is("Enter Bug: QA-Selenium-TEST");
|
|
|
|
|
logout($sel);
|