diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
commit | 6587f6ba7d047ddc1686c080090afe7d53365bd4 (patch) | |
tree | ec77342668e8865aca669c9b4736e84e3077b523 /rt/t/web/search_tabs.t | |
parent | 47153aae5c2fc00316654e7277fccd45f72ff611 (diff) |
first pass RT4 merge, RT#13852
Diffstat (limited to 'rt/t/web/search_tabs.t')
-rw-r--r-- | rt/t/web/search_tabs.t | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/rt/t/web/search_tabs.t b/rt/t/web/search_tabs.t new file mode 100644 index 000000000..b3ed2cbdf --- /dev/null +++ b/rt/t/web/search_tabs.t @@ -0,0 +1,86 @@ +#!/usr/bin/perl +use warnings; +use strict; + +use RT::Test tests => 21; +my ($baseurl, $agent) = RT::Test->started_ok; + +my $ticket = RT::Ticket->new(RT->SystemUser); +for ( 1 .. 3 ) { + $ticket->Create( + Subject => 'Ticket ' . $_, + Queue => 'General', + Owner => 'root', + Requestor => 'clownman@localhost', + ); +} + +ok $agent->login('root', 'password'), 'logged in as root'; + +# [issues.bestpractical.com #16841] { +$agent->get_ok('/Search/Build.html'); + +$agent->form_name('BuildQuery'); +$agent->field('idOp', '='); +$agent->field('ValueOfid', '1'); +$agent->submit('AddClause'); + +$agent->form_name('BuildQuery'); +$agent->field('idOp', '='); +$agent->field('ValueOfid', '2'); +$agent->field('AndOr', 'OR'); +$agent->submit('AddClause'); + +$agent->follow_link_ok({id => 'page-results'}); +$agent->title_is('Found 2 tickets'); +# } + +# [issues.bestpractical.com #17237] { +$agent->follow_link_ok({text => 'New Search'}); +$agent->title_is('Query Builder'); + +$agent->form_name('BuildQuery'); +$agent->field('idOp', '='); +$agent->field('ValueOfid', '1'); +$agent->submit('AddClause'); + +$agent->form_name('BuildQuery'); +$agent->field('idOp', '='); +$agent->field('ValueOfid', '2'); +$agent->field('AndOr', 'OR'); +$agent->click_button(name => 'DoSearch'); + +$agent->title_is('Found 2 tickets'); + +$agent->follow_link_ok({id => 'page-results'}); +$agent->title_is('Found 2 tickets'); +# } + +$agent->follow_link_ok({text => 'Chart'}); +$agent->text_contains('id = 1 OR id = 2'); +$agent->form_name('SaveSearch'); +$agent->field('SavedSearchDescription' => 'this is my saved chart'); +$agent->click_button(name => 'SavedSearchSave'); + +# Confirm that we saved the chart and that it's the "current chart" +$agent->text_contains('Chart this is my saved chart saved.'); +$agent->form_name('SaveSearch'); +is($agent->value('SavedSearchDescription'), 'this is my saved chart'); + +$agent->follow_link_ok({text => 'Edit Search'}); +$agent->form_name('BuildQuery'); +$agent->field('idOp', '='); +$agent->field('ValueOfid', '3'); +$agent->field('AndOr', 'OR'); +$agent->click_button(name => 'DoSearch'); + +$agent->title_is('Found 3 tickets'); + +$agent->follow_link_ok({text => 'Chart'}); +$agent->text_contains('id = 1 OR id = 2 OR id = 3'); + +# The interesting bit: confirm that the chart we saved is still the +# "current chart" after roundtripping through search builder +$agent->form_name('SaveSearch'); +is($agent->value('SavedSearchDescription'), 'this is my saved chart'); + |