# Copyright (c) 2009 bivio Software Inc. All Rights Reserved. # $Id: crm-mail-cancel.btest,v 1.3 2009/12/26 23:02:54 nagler Exp $ test_setup('PetShop', 'groupware'); home_page(); login_as('crm_tech1'); foreach my $item ( [crm_forum => tickets => qr{^\d+$}], [crm_forum => mail => qr{^\[[^\d]+ #\d+\]}, qr{^Reply$}], [crm_tuple_forum => tickets => qr{^\d+$}], [crm_tuple_forum => mail => qr{^\[[^\d]+ #\d+\]}, qr{^Reply$}], ) { my($forum, $tool, $re, @extra_links) = @$item; my($new) = 'new_' . ($tool eq 'tickets' ? 'ticket' : 'topic'); follow_link(qr{^$forum$}); follow_link($tool); my($link) = grep($_ =~ $re, @{get_html_parser()->get('Links')->get_keys}); follow_link($link ? (qr{^\Q$link\E$}, @extra_links) : $new); submit_form('cancel'); }