allow importing custom fields for product option values
[bse.git] / t / t00smoke.t
1 #!perl -w
2 use strict;
3 use Test::More tests => 63;
4 use BSE::Test qw(make_ua fetch_ok base_url base_securl config);
5
6 ++$|;
7 my $baseurl = base_url;
8 ok($baseurl =~ /^http:/, "basic check of base url");
9 my $securl = base_securl;
10 my $ua = make_ua;
11 fetch_ok($ua, "admin menu - check the site exists at all", "$baseurl/admin/", "Admin");
12 fetch_ok($ua, "generate all", "$baseurl/cgi-bin/admin/generate.pl",
13         "html", "Title: BSE - Administration Centre");
14 fetch_ok($ua, "generate all verbose", 
15          "$baseurl/cgi-bin/admin/generate.pl?progress=1",
16          "Regenerating.*Return to admin menu");
17 fetch_ok($ua, "index", "$baseurl/", "Home");
18 fetch_ok($ua, "shop", "$baseurl/shop/", "The Shop");
19 fetch_ok($ua, "shop cart", "$baseurl/cgi-bin/shop.pl",
20          "Shopping Cart Items");
21 fetch_ok($ua, "shop cart checkout no items", "$baseurl/cgi-bin/shop.pl",
22          "Shopping Cart Items");
23 fetch_ok($ua, "build search index", "$baseurl/cgi-bin/admin/makeIndex.pl",
24          "html", "Title: BSE - Administration Centre");
25 fetch_ok($ua, "advanced search form", "$baseurl/cgi-bin/search.pl",
26          "All\\s+lower\\s+case");
27 fetch_ok($ua, "failed search", "$baseurl/cgi-bin/search.pl?q=blargle",
28          "No\\s+documents\\s+were\\s+found");
29 fetch_ok($ua, "good search", "$baseurl/cgi-bin/search.pl?q=shop",
30          qr!You\s+can\s+buy!s);
31 if (config->entry('site users', 'nopassword')) {
32   fetch_ok($ua, "not user logon page", "$baseurl/cgi-bin/user.pl",
33            qr!Not\s+Authenticated!s);
34 }
35 else {
36   fetch_ok($ua, "user logon page", "$baseurl/cgi-bin/user.pl",
37            qr!User\s+Logon!s);
38 }
39 fetch_ok($ua, "shop admin page", "$baseurl/cgi-bin/admin/shopadmin.pl",
40          qr!Shop\s+Administration!s);
41 fetch_ok($ua, "add article form", "$baseurl/cgi-bin/admin/add.pl",
42          qr!New\s+Page\sLev3!s);
43 fetch_ok($ua, "add catalog form", "$baseurl/cgi-bin/admin/add.pl?type=Catalog",
44          qr!Add\s+Catalog!s);
45 fetch_ok($ua, "add product form", "$baseurl/cgi-bin/admin/add.pl?type=Product",
46          qr!Add\s+product!s);
47 fetch_ok($ua, "edit article form", "$baseurl/cgi-bin/admin/add.pl?id=1",
48          qr!Edit\s+Page\s+Lev1!s);
49 fetch_ok($ua, "edit catalog form", "$baseurl/cgi-bin/admin/add.pl?id=4",
50          qr!Catalog\sDetails!s);
51 fetch_ok($ua, "user list", "$baseurl/cgi-bin/admin/adminusers.pl",
52          qr!Admin\sUsers!s);
53 fetch_ok($ua, "group list", "$baseurl/cgi-bin/admin/adminusers.pl?a_groups=1",
54          qr!Admin\sGroups!s);
55 fetch_ok($ua, "subscriptions", "$baseurl/cgi-bin/admin/subs.pl",
56          qr/Newsletter\s+List/);
57 fetch_ok($ua, "reports", "$baseurl/cgi-bin/admin/report.pl",
58          qr/Reports/);
59 # does a refresh unless the user is logged on
60 fetch_ok($ua, "changepw", "$baseurl/cgi-bin/admin/changepw.pl",
61          qr!Change Password|Security not enabled!i);
62 fetch_ok($ua, "printable", "$baseurl/cgi-bin/printable.pl?id=5",
63          qr!sidebar\s+subsection!i);
64 fetch_ok($ua, "printable error", "$baseurl/cgi-bin/printable.pl?id=5&template=foo",
65          qr!Invalid\s+template\s+name!i);
66 fetch_ok($ua, "siteusers", "$securl/cgi-bin/admin/siteusers.pl",
67          qr!Admin Site Members!i);
68
69 fetch_ok($ua, "reorder", "$securl/cgi-bin/admin/reorder.pl?parentid=-1",
70         "html", "Title: BSE - Administration Centre");
71
72 fetch_ok($ua, 'fmail', "$baseurl/cgi-bin/fmail.pl",
73          qr!name="form"!);
74 fetch_ok($ua, 'page.pl?page=1', "$baseurl/cgi-bin/page.pl?page=1",
75          qr!welcome\s+to\s!i);
76 fetch_ok($ua, 'nadmin.pl/modules', "$baseurl/cgi-bin/admin/nadmin.pl/modules".
77         qr/BSE\s+Modules/);