fix invoice deletion vs. cust_pay_batch records, #37837
[freeside.git] / FS-Test / bin / freeside-test-fetch
1 #!/usr/bin/perl
2
3 use strict;
4 use FS::Test;
5 use Getopt::Std;
6
7 my %opt;
8
9 my $username = 'test';
10 my $password = 'test';
11
12 getopts('d:U:', \%opt);
13 die usage() unless $opt{d};
14 my $test = FS::Test->new( dir => $opt{d} );
15 $test->fsurl($opt{U}) if $opt{U};
16
17 my $testfile = $test->share_dir . '/ui_tests';
18 open my $fh, '<', $testfile
19   or die "Couldn't read tests from '$testfile': $!\n";
20 $test->fetch( <$fh> );
21
22 sub usage {
23   "Usage: $0 -d directory [ -U base_URI ]\n\n";
24 }
25
26 =head1 NAME
27
28 freeside-test-fetch - download a list of UI pages for testing
29
30 =head1 USAGE
31
32 freeside-test-fetch -d /tmp/outputdir [ -U http://myserver/freeside ]
33
34 =head1 ARGUMENTS
35
36 -d: the directory to put the files in. Required.
37
38 -U: the URL prefix for the Freeside server. Defaults to
39 "http://localhost/freeside".
40
41 The list of tests is in the 'ui_tests' file included with FS::Test.
42
43 =cut