4 use RT::Test tests => 25;
6 use constant LogoFile => $RT::MasonComponentRoot .'/NoAuth/images/bpslogo.png';
7 use constant FaviconFile => $RT::MasonComponentRoot .'/NoAuth/images/favicon.png';
9 my ($baseurl, $m) = RT::Test->started_ok;
10 ok $m->login, 'logged in';
12 my $queue = RT::Queue->new(RT->Nobody);
13 my $qid = $queue->Load('General');
14 ok( $qid, "Loaded General queue" );
16 $m->form_name('CreateTicketInQueue');
17 $m->field('Queue', $qid);
19 is($m->status, 200, "request successful");
20 $m->content_contains("Create a new ticket", 'ticket create page');
22 $m->form_name('TicketCreate');
23 $m->field('Subject', 'Attachments test');
24 $m->field('Attach', LogoFile);
25 $m->field('Content', 'Some content');
27 is($m->status, 200, "request successful");
29 $m->content_contains('Attachments test', 'we have subject on the page');
30 $m->content_contains('Some content', 'and content');
31 $m->content_contains('Download bpslogo.png', 'page has file name');
33 $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
34 $m->form_name('TicketUpdate');
35 $m->field('Attach', LogoFile);
36 $m->click('AddMoreAttach');
37 is($m->status, 200, "request successful");
39 $m->form_name('TicketUpdate');
40 $m->field('Attach', FaviconFile);
41 $m->field('UpdateContent', 'Message');
42 $m->click('SubmitTicket');
43 is($m->status, 200, "request successful");
45 $m->content_contains('Download bpslogo.png', 'page has file name');
46 $m->content_contains('Download favicon.png', 'page has file name');
49 diag "test mobile ui";
50 $m->get_ok( $baseurl . '/m/ticket/create?Queue=' . $qid );
52 $m->form_name('TicketCreate');
53 $m->field('Subject', 'Attachments test');
54 $m->field('Attach', LogoFile);
55 $m->field('Content', 'Some content');
57 is($m->status, 200, "request successful");
59 $m->content_contains('Attachments test', 'we have subject on the page');
60 $m->content_contains('bpslogo.png', 'page has file name');
62 $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
63 $m->form_name('TicketUpdate');
64 $m->field('Attach', LogoFile);
65 $m->click('AddMoreAttach');
66 is($m->status, 200, "request successful");
68 $m->form_name('TicketUpdate');
69 $m->field('Attach', FaviconFile);
70 $m->field('UpdateContent', 'Message');
71 $m->click('SubmitTicket');
72 is($m->status, 200, "request successful");
74 $m->content_contains('bpslogo.png', 'page has file name');
75 $m->content_contains('favicon.png', 'page has file name');