|
| 1 | +#!/usr/bin/perl |
| 2 | +use Test::More tests => 98; |
| 3 | +use Test::WWW::Selenium; |
| 4 | +use Test::WWW::Selenium::HTML; |
| 5 | +use WebGUI::Paths -inc; |
| 6 | +use WebGUI::Config; |
| 7 | +use strict; |
| 8 | + |
| 9 | +WebGUI::Paths->siteConfigs or die "no configuration files found"; |
| 10 | + |
| 11 | +my $config = undef; |
| 12 | +my $webguiSiteUrl = undef; |
| 13 | +my $browser = undef; |
| 14 | +my $seleniumServer = undef; |
| 15 | +my $seleniumServerPort = undef; |
| 16 | +if ( my $config_file = $ENV{WEBGUI_CONFIG} ){ |
| 17 | + my $webguiTestConfigFilename = WebGUI::Paths->configBase . '/' . $config_file; |
| 18 | + $config = WebGUI::Config->new( $webguiTestConfigFilename ) or die "failed to load configuration file: $webguiTestConfigFilename: $!"; |
| 19 | + |
| 20 | + eval{ |
| 21 | + $webguiSiteUrl = $config->{config}->{selenium}->{webgui_url}; |
| 22 | + $browser = $config->{config}->{selenium}->{browser}; # firefox, iexplore, safari |
| 23 | + $seleniumServer = $config->{config}->{selenium}->{server}; |
| 24 | + $seleniumServerPort = $config->{config}->{selenium}->{port}; |
| 25 | + |
| 26 | + } || die "Can't get Selenium configuration values from configuration file: $webguiTestConfigFilename\n"; |
| 27 | + |
| 28 | +}else{ |
| 29 | + die "Please read the instructions, you must specify a PERL5LIB and WEBGUI_CONFIG file value!\n"; |
| 30 | + |
| 31 | +} |
| 32 | + |
| 33 | +# |
| 34 | +my $sel = Test::WWW::Selenium->new( |
| 35 | + host => $seleniumServer, |
| 36 | + port => $seleniumServerPort, |
| 37 | + browser => "*$browser", |
| 38 | + browser_url => $webguiSiteUrl ); |
| 39 | + |
| 40 | +my $selh = Test::WWW::Selenium::HTML->new( $sel ); |
| 41 | + |
| 42 | +$selh->diag_body_text_on_failure(0); |
| 43 | + |
| 44 | +#------------------------- Run All Tests here ----------------------- |
| 45 | + |
| 46 | +ok(1, "Login test"); |
| 47 | +$selh->run(path => "login.html"); |
| 48 | +ok(1, "Turn On Admin test"); |
| 49 | +$selh->run(path => "turnOnAdmin.html"); |
| 50 | +ok(1, "Admin Console tests"); |
| 51 | +$selh->run(path => "turnOnAdmin.html"); |
| 52 | +ok(1, "Version Tags tests"); |
| 53 | +$selh->run(path => "versionTags.html"); |
| 54 | +ok(1, "Clipboard test"); |
| 55 | +$selh->run(path => "clipboard.html"); |
| 56 | +ok(1, "Asset Helpers tests"); |
| 57 | +$selh->run(path => "assetHelpers.html"); |
| 58 | +ok(1, "New Content->Basic tests"); |
| 59 | +$selh->run(path => "newContentBasic.html"); |
| 60 | +ok(1, "New Content->Community tests"); |
| 61 | +$selh->run(path => "newContentCommunity.html"); |
| 62 | +ok(1, "New Content->Intranet tests"); |
| 63 | +$selh->run(path => "newContentIntranet.html"); |
| 64 | +ok(1, "New Content->Prototypes tests"); |
| 65 | +$selh->run(path => "newContentPrototypes.html"); |
| 66 | +ok(1, "New Content->Shop tests"); |
| 67 | +$selh->run(path => "newContentShop.html"); |
| 68 | +ok(1, "New Content->Utilities tests"); |
| 69 | +$selh->run(path => "newContentUtilities.html"); |
0 commit comments