diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index bce24b063..d55a7bd65 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,7 @@ - Improved VAT number management for admins ( Martin Kamerbeek / Oqapi ) - rfe #9981: RedirectAfterLogin Setting - Added user create, update, and delete web services ( HD Publishing ) + - Added Survey web test suite for validating expression/branching logic 7.7.6 - Added mobile style template. If enabled in settings, will serve alternate style templates diff --git a/docs/upgrades/packages-7.7.6/root_import_survey_default-test-results.wgpkg b/docs/upgrades/packages-7.7.7/root_import_survey_default-test-results.wgpkg similarity index 100% rename from docs/upgrades/packages-7.7.6/root_import_survey_default-test-results.wgpkg rename to docs/upgrades/packages-7.7.7/root_import_survey_default-test-results.wgpkg diff --git a/docs/upgrades/upgrade_7.7.5-7.7.6.pl b/docs/upgrades/upgrade_7.7.5-7.7.6.pl index ccdd13bb0..4018f4e6e 100644 --- a/docs/upgrades/upgrade_7.7.5-7.7.6.pl +++ b/docs/upgrades/upgrade_7.7.5-7.7.6.pl @@ -42,7 +42,6 @@ sendWebguiStats($session); addDataFormColumns($session); addListingsCacheTimeoutToMatrix( $session ); addSurveyFeedbackTemplateColumn( $session ); -addSurveyTestResultsTemplateColumn( $session ); installCopySender($session); installNotificationsSettings($session); installSMSUserProfileFields($session); @@ -108,6 +107,16 @@ sub addMobileStyleTemplate { 'Profile/MIDP', 'Smartphone', 'Symbian ?OS', + +#---------------------------------------------------------------------------- +sub addSurveyTestResultsTemplateColumn { + my $session = shift; + print "\tAdding columns for Survey Test Results Template..." unless $quiet; + $session->db->write("alter table Survey add column `testResultsTemplateId` char(22)"); + + print "Done\n" unless $quiet; + +} 'J2ME/MIDP', 'PalmSource', 'PalmOS', @@ -228,16 +237,6 @@ sub addSurveyFeedbackTemplateColumn { } -#---------------------------------------------------------------------------- -sub addSurveyTestResultsTemplateColumn { - my $session = shift; - print "\tAdding columns for Survey Test Results Template..." unless $quiet; - $session->db->write("alter table Survey add column `testResultsTemplateId` char(22)"); - - print "Done\n" unless $quiet; - -} - #---------------------------------------------------------------------------- # Your sub here sub installCopySender { diff --git a/docs/upgrades/upgrade_7.7.6-7.7.7.pl b/docs/upgrades/upgrade_7.7.6-7.7.7.pl index c5f75c807..f6f71ad4e 100644 --- a/docs/upgrades/upgrade_7.7.6-7.7.7.pl +++ b/docs/upgrades/upgrade_7.7.6-7.7.7.pl @@ -33,6 +33,7 @@ addOgoneToConfig( $session ); addUseEmailAsUsernameToSettings( $session ); alterVATNumberTable( $session ); addRedirectAfterLoginUrlToSettings( $session ); +addSurveyTestResultsTemplateColumn( $session ); finish($session); # this line required @@ -78,6 +79,16 @@ sub alterVATNumberTable { print "Done\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub addSurveyTestResultsTemplateColumn { + my $session = shift; + print "\tAdding columns for Survey Test Results Template..." unless $quiet; + $session->db->write("alter table Survey add column `testResultsTemplateId` char(22)"); + + print "Done\n" unless $quiet; + +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index ae3c70566..6a974af77 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -2452,7 +2452,7 @@ sub www_editTestSuite { my $testsFound = 0; my $tests = ''; - my $getATest = WebGUI::Asset::Wobject::Survey::Test->getAllIterator($session); + my $getATest = WebGUI::Asset::Wobject::Survey::Test->getAllIterator($session, { sequenceKeyValue => $self->getId } ); my $icon = $session->icon; while (my $test = $getATest->()) { $testsFound++; diff --git a/lib/WebGUI/Asset/Wobject/Survey/Test.pm b/lib/WebGUI/Asset/Wobject/Survey/Test.pm index 6aa0020bb..bced28767 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/Test.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/Test.pm @@ -50,7 +50,7 @@ Identifies the Survey instance. A name for the test -=head4 spec +=head4 test The test spec @@ -74,7 +74,7 @@ sub crud_definition { hoverHelp => $i18n->get( 'test name help', 'Asset_Survey' ), defaultValue => '', }; - $properties->{spec} = { + $properties->{test} = { fieldType => 'codearea', label => $i18n->get( 'test spec', 'Asset_Survey' ), hoverHelp => $i18n->get( 'test spec help', 'Asset_Survey' ), @@ -104,7 +104,7 @@ sub run { return { tap => 'Bail Out! enableSurveyExpressionEngine config option disabled' }; } - my $spec = $self->get('spec') + my $spec = $self->get('test') or return { tap => "Bail Out! Test spec undefined" }; eval { diff --git a/t/Asset/Wobject/Survey/Test.t b/t/Asset/Wobject/Survey/Test.t index 06c8c1787..7d04e992e 100644 --- a/t/Asset/Wobject/Survey/Test.t +++ b/t/Asset/Wobject/Survey/Test.t @@ -151,7 +151,7 @@ sub try_it { my ($test, $spec, $opts) = @_; chomp($spec); - $test->update( { spec => $spec } ); + $test->update( { test => $spec } ); my $result = $t1->run(); ok( $result, 'Tests ran ok' );
' . $i18n->get('test name') . '