lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6040] Document each automated GUI test (VZ)


From: Greg Chicares
Subject: [lmi-commits] [6040] Document each automated GUI test (VZ)
Date: Tue, 02 Dec 2014 12:00:15 +0000

Revision: 6040
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6040
Author:   chicares
Date:     2014-12-02 12:00:14 +0000 (Tue, 02 Dec 2014)
Log Message:
-----------
Document each automated GUI test (VZ)

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/wx_test_about_version.cpp
    lmi/trunk/wx_test_benchmark_census.cpp
    lmi/trunk/wx_test_calculation_summary.cpp
    lmi/trunk/wx_test_config_settings.cpp
    lmi/trunk/wx_test_create_open.cpp
    lmi/trunk/wx_test_default_input.cpp
    lmi/trunk/wx_test_default_update.cpp
    lmi/trunk/wx_test_expiry_dates.cpp
    lmi/trunk/wx_test_extract.cpp
    lmi/trunk/wx_test_input_sequences.cpp
    lmi/trunk/wx_test_input_validation.cpp
    lmi/trunk/wx_test_paste_census.cpp
    lmi/trunk/wx_test_pdf_create.cpp
    lmi/trunk/wx_test_validate_output.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/ChangeLog 2014-12-02 12:00:14 UTC (rev 6040)
@@ -34672,3 +34672,21 @@
 Conform to 20141106T1655Z accelerator change. See:
   http://lists.nongnu.org/archive/html/lmi/2014-11/msg00058.html
 
+20141202T1200Z <address@hidden> [516]
+
+  wx_test_about_version.cpp
+  wx_test_benchmark_census.cpp
+  wx_test_calculation_summary.cpp
+  wx_test_config_settings.cpp
+  wx_test_create_open.cpp
+  wx_test_default_input.cpp
+  wx_test_default_update.cpp
+  wx_test_expiry_dates.cpp
+  wx_test_extract.cpp
+  wx_test_input_sequences.cpp
+  wx_test_input_validation.cpp
+  wx_test_paste_census.cpp
+  wx_test_pdf_create.cpp
+  wx_test_validate_output.cpp
+Document each automated GUI test (VZ).
+

Modified: lmi/trunk/wx_test_about_version.cpp
===================================================================
--- lmi/trunk/wx_test_about_version.cpp 2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_about_version.cpp 2014-12-02 12:00:14 UTC (rev 6040)
@@ -34,6 +34,14 @@
 #include <wx/testing.h>
 #include <wx/uiaction.h>
 
+/*
+    Test about dialog title.
+
+    4. Confirm version number exists, which can change monthly.
+        'Help | About' contains a date in the dialog's title bar,
+         which is always identical to this date in 'version.hpp':
+         #define LMI_VERSION "20131023T1837Z"
+ */
 LMI_WX_TEST_CASE(about_dialog_version)
 {
     struct expect_about_dialog : public wxExpectModalBase<wxDialog>

Modified: lmi/trunk/wx_test_benchmark_census.cpp
===================================================================
--- lmi/trunk/wx_test_benchmark_census.cpp      2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_benchmark_census.cpp      2014-12-02 12:00:14 UTC (rev 
6040)
@@ -136,6 +136,21 @@
 
 } // Unnamed namespace.
 
+/*
+    Add GUI test collecting the census operations timings.
+
+    This implements the item
+
+        5. Collect time statistics from the status bar.
+
+    from the testing specification. Differences compared to the specification:
+
+     - Commands are only performed emulating keyboard entry, not mouse.
+     - Commands are only done once, not twice, to reduce the test running time.
+
+    The names of the censuses to be tested are taken from the configuration 
file
+    which is required by this test.
+ */
 LMI_WX_TEST_CASE(benchmark_census)
 {
     wxConfigBase const& c = config();

Modified: lmi/trunk/wx_test_calculation_summary.cpp
===================================================================
--- lmi/trunk/wx_test_calculation_summary.cpp   2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_calculation_summary.cpp   2014-12-02 12:00:14 UTC (rev 
6040)
@@ -243,6 +243,64 @@
 
 } // Unnamed namespace.
 
+/*
+    Start of the calculation summary unit test.
+
+    This partially implements the first half of the item 8 of the
+    testing specification:
+
+        8. Validate Calculation summary and a few of its features.
+
+          A. File | Preferences | check 'Use built-in calculation summary'
+             File | New | Illustration | Ok
+             Expected results:
+               These columns display in the calculation summary view:
+                 Policy Year
+                 Net Outlay
+                 Curr Account Value
+                 Curr Net Cash Surr Value
+                 Curr EOY Death Benefit
+               Inspect 'configurable_settings.xml' for:
+                 <calculation_summary_columns></calculation_summary_columns>
+
+          B. File | Preferences | uncheck 'Use built-in calculation summary'
+             select twelve different columns | inspect display for those 
columns
+             Expected results:
+               These columns display in the calculation summary view:
+                 Policy Year
+                 Attained Age
+                 Net Outlay
+                 Curr Net Cash Surr Value
+                 Curr Account Value
+                 Guar Net Cash Surr Value
+                 Guar Account Value
+                 Curr EOY Death Benefit
+                 Guar EOY Death Benefit
+                 Withdrawal
+                 Annual Loan
+                 Curr Loan Int Accrued
+               Inspect 'configurable_settings.xml' for:
+                 <calculation_summary_columns>AttainedAge PolicyYear Outlay \
+                  CSVNet_Current AcctVal_Current CSVNet_Guaranteed \
+                  AcctVal_Guaranteed EOYDeathBft_Current 
EOYDeathBft_Guaranteed \
+                  NetWD NewCashLoan LoanIntAccrued_Current 
</calculation_summary_columns>
+
+          C. File | New | Illustration
+             Illustration | Copy calculation summary
+             paste the output for inspection, then
+             Illustration | Copy full illustration data
+             paste the output for inspection
+
+          D. File | New | Census
+             Census | Run case
+             Illustration | Copy calculation summary
+             paste the output for inspection, then
+             Illustration | Copy full illustration data
+             paste the output for inspection
+
+    The output is pasted into 4 files called {New,Calc}Ill{Summary,Full}.txt in
+    the current working directory.
+ */
 LMI_WX_TEST_CASE(calculation_summary)
 {
     configurable_settings const& settings = configurable_settings::instance();

Modified: lmi/trunk/wx_test_config_settings.cpp
===================================================================
--- lmi/trunk/wx_test_config_settings.cpp       2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_config_settings.cpp       2014-12-02 12:00:14 UTC (rev 
6040)
@@ -32,6 +32,38 @@
 
 #include <boost/filesystem/operations.hpp>
 
+/*
+    Test configurable_settings.xml file.
+
+    Implement the following verifications from the official specification:
+
+    1. Inspect 'configurable_settings.xml' for the following:
+
+     A. The file exists in '/etc/opt/lmi'
+
+     B. These lines always exist like this:
+         <libraries_to_preload/>
+         <xsl_fo_command>CMD /c /fop-0.20.5/fop</xsl_fo_command>
+
+     C. We package several distributions each month that have their
+        own "skin" and "default" files. Each time this test is run,
+        only one pair of the following lines exists at a time:
+
+          <skin_filename>skin_coli_boli.xrc</skin_filename>
+          
<default_input_filename>c:/fop-0.20.5/coli_boli_default.ill</default_input_filename>
+
+          <skin_filename>skin_group_carveout.xrc</skin_filename>
+          
<default_input_filename>c:/fop-0.20.5/group_carveout_default.ill</default_input_filename>
+
+          <skin_filename>skin_group_carveout2.xrc</skin_filename>
+          
<default_input_filename>c:/fop-0.20.5/group_carveout_default.ill</default_input_filename>
+
+          <skin_filename>reg_d.xrc</skin_filename>
+          
<default_input_filename>c:/fop-0.20.5/private_placement_default.ill</default_input_filename>
+
+    The only change is that the xsl_fo_command is checked to contain the 
volume,
+    i.e. is c:/fop-0.20.5/fop, and not just the path.
+ */
 LMI_WX_TEST_CASE(configurable_settings)
 {
     LMI_ASSERT(fs::exists("/etc/opt/lmi/configurable_settings.xml"));

Modified: lmi/trunk/wx_test_create_open.cpp
===================================================================
--- lmi/trunk/wx_test_create_open.cpp   2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_create_open.cpp   2014-12-02 12:00:14 UTC (rev 6040)
@@ -104,6 +104,18 @@
     wxYield();
 }
 
+/*
+    These tests implement the following item of the testing specification:
+
+    9. Confirm all file types can be created and opened.
+
+      A. File | New |
+          [Census, Illustration, Database, Policy, Rounding, Strata, MEC 
testing]
+         push 'OK' button for only 'Illustration' and 'MEC testing'
+         File | Save
+
+      B. File | Open | each new saved file from the last test
+ */
 LMI_WX_TEST_CASE(create_open_census)
 {
     do_test_create_open(*this, 'c', "testfile.cns",  false);

Modified: lmi/trunk/wx_test_default_input.cpp
===================================================================
--- lmi/trunk/wx_test_default_input.cpp 2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_default_input.cpp 2014-12-02 12:00:14 UTC (rev 6040)
@@ -36,6 +36,17 @@
 
 #include <sstream>
 
+/*
+    Test default input.
+
+    2. Inspect '*default.ill' for the following variable data:
+
+     A. This date differs each month
+        <EffectiveDate>2456598</EffectiveDate>
+
+     B. Rates can change each month and differ among each distribution
+        <GeneralAccountRate>0.042 [0, 1); 0.037 [1, 
maturity)</GeneralAccountRate>
+ */
 LMI_WX_TEST_CASE(default_input)
 {
     calendar_date const today;

Modified: lmi/trunk/wx_test_default_update.cpp
===================================================================
--- lmi/trunk/wx_test_default_update.cpp        2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_default_update.cpp        2014-12-02 12:00:14 UTC (rev 
6040)
@@ -37,6 +37,24 @@
 
 #include <boost/filesystem/operations.hpp>
 
+/*
+    Test that the default file can be opened and modified.
+
+    This implements the following item of the testing specification:
+
+        11. Ensure default file can be opened and modified.
+          A. File | Default | change a parameter | OK
+             File | Save
+             Expected results:
+               Status bar reads "Saved 'c:/fop-0.20.5/default.ill'."
+               'default.ill' exists in 'c:/fop-0.20.5/'
+
+    except that the currently configured default input filename is used 
instead of
+    the hard coded "default.ill".
+
+    The parameter currently being changed is the "MEC avoidance" choice, this 
is
+    arbitrary and could be replaced with changing another parameter in the 
future.
+ */
 LMI_WX_TEST_CASE(default_update)
 {
     wxUIActionSimulator ui;

Modified: lmi/trunk/wx_test_expiry_dates.cpp
===================================================================
--- lmi/trunk/wx_test_expiry_dates.cpp  2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_expiry_dates.cpp  2014-12-02 12:00:14 UTC (rev 6040)
@@ -35,6 +35,18 @@
 #include <boost/filesystem/fstream.hpp>
 #include <boost/filesystem/operations.hpp>
 
+/*
+    Test expiry dates validity.
+
+    3. Inspect dates in 'expiry'. The values change every month and
+       the first value can differ among each distribution.
+
+      A. Distributions beginning before the first of the month:
+          2456596 2456628
+
+      B. Distributions beginning on the first of the month:
+          2456598 2456628
+ */
 LMI_WX_TEST_CASE(expiry_dates)
 {
     fs::path expiry_path(global_settings::instance().data_directory() / 
"expiry");

Modified: lmi/trunk/wx_test_extract.cpp
===================================================================
--- lmi/trunk/wx_test_extract.cpp       2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_extract.cpp       2014-12-02 12:00:14 UTC (rev 6040)
@@ -37,6 +37,29 @@
 
 #include <stdexcept>
 
+/*
+    Test extract file formats.
+
+    This implements the following item of the testing specification:
+
+        16. Open and run a variety of extract file formats; Close
+             files and the program.
+
+          A. File | Open | 'ExtractV6.ill' | press 'OK' twice [to
+              dismiss input validation message boxes] | press 'OK' to
+              run illustration
+             File | Close | No [do not save changes]
+
+          B. File | Open | 'ExtractV5.cns' | press 'OK' thrice [to
+              dismiss input validation message boxes]
+             Census | Run case
+             File | Close
+             File | Exit
+
+    The only difference with the specification is that "File | Exit" is not 
tested
+    as the program currently needs to remain running in order to display the 
test
+    results to the user.
+ */
 LMI_WX_TEST_CASE(extract)
 {
     wxUIActionSimulator ui;

Modified: lmi/trunk/wx_test_input_sequences.cpp
===================================================================
--- lmi/trunk/wx_test_input_sequences.cpp       2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_input_sequences.cpp       2014-12-02 12:00:14 UTC (rev 
6040)
@@ -34,6 +34,18 @@
 #include <wx/testing.h>
 #include <wx/uiaction.h>
 
+/*
+    Test that the input sequences census can be run.
+
+    This implements the following item of the testing specification:
+
+        10. Confirm Help file input sequences remain valid.
+
+          A. File | Open | 'InputSequences.cns'
+             Census | Run case
+             Expected result:
+               Case runs without any warnings or errors.
+ */
 LMI_WX_TEST_CASE(input_sequences)
 {
     // Construct the path of the file to open, it's supposed to be in the same

Modified: lmi/trunk/wx_test_input_validation.cpp
===================================================================
--- lmi/trunk/wx_test_input_validation.cpp      2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_input_validation.cpp      2014-12-02 12:00:14 UTC (rev 
6040)
@@ -36,6 +36,28 @@
 
 #include <stdexcept>
 
+/*
+    Test for the expected validation errors.
+
+    This commit implements the following item of the testing specification:
+
+        15. Validate input ranges and anticipate error for
+            'CurrentCoiMultiplier' input.
+
+          A. File | Open | 'CoiMultiplier.cns'
+             Census | run case
+             Expected result:
+              Error message for last life with a zero multiplier:
+
+              Input validation problems for '':
+              COI multiplier entered is '0', but it must
+               contain at least one number other than zero.
+
+    However it doesn't check for the message box being displayed, because of
+    significant difficulty of doing it due to the fact that this message box is
+    shown from the global OnExceptionInMainLoop() function, but just checks for
+    the expected exception being thrown.
+ */
 LMI_WX_TEST_CASE(input_validation)
 {
     wxUIActionSimulator ui;

Modified: lmi/trunk/wx_test_paste_census.cpp
===================================================================
--- lmi/trunk/wx_test_paste_census.cpp  2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_paste_census.cpp  2014-12-02 12:00:14 UTC (rev 6040)
@@ -135,6 +135,56 @@
 
 } // Unnamed namespace.
 
+/*
+    Test for pasting data into a census.
+
+    This implements the following item of the testing specification:
+
+        7. Verify help file sample works, using the paste census feature.
+           Confirm 'Edit case' and 'Save as' work.
+
+          A. Press 'F1' for help file. Select 'Pasting a census from a
+             spreadsheet'. Copy this sample from the help file webpage:
+
+        Gender  UnderwritingClass       IssueAge        Payment 
DeathBenefitOption
+        Female  Preferred       30      sevenpay,7;0    b,7;a
+        Male    Preferred       35      sevenpay,7;0    b,7;a
+        Female  Standard        40      sevenpay,7;0    b,7;a
+        Male    Standard        45      sevenpay,7;0    b,7;a
+        Female  Preferred       50      sevenpay,7;0    b,7;a
+        Male    Preferred       55      sevenpay,7;0    b,7;a
+        Female  Standard        60      sevenpay,7;0    b,7;a
+
+             Then do:
+             File | New | Census
+             Census | Paste census data
+             Expected result:
+               Seven new cells are populated with the individual data
+
+          B. Census | Edit case defaults | Change 'UnderwritingClass'
+             to 'Preferred' | OK
+             This message box appears:
+
+               ---------------------------
+               Confirm changes
+               ---------------------------
+               Apply all changes to every cell?
+               ---------------------------
+               Yes   No
+               ---------------------------
+             Select 'Yes'. The 'UnderwritingClass' column should disappear
+             from the census editor.
+
+          C. File | 'Save as'
+             Name the file 'PasteCensus.cns' and press 'Save' button.
+             The working directory will be the default location.
+             Expected result:
+               A file named 'PasteCensus.cns' exists in default directory.
+
+    All checks are implemented exactly as specified, but the data to be pasted
+    into the census is extracted from pasting_to_a_census.html file itself 
instead
+    of being copied from an on-screen window showing it.
+ */
 LMI_WX_TEST_CASE(paste_census)
 {
     // Put the data to paste on clipboard.

Modified: lmi/trunk/wx_test_pdf_create.cpp
===================================================================
--- lmi/trunk/wx_test_pdf_create.cpp    2014-11-23 20:24:44 UTC (rev 6039)
+++ lmi/trunk/wx_test_pdf_create.cpp    2014-12-02 12:00:14 UTC (rev 6040)
@@ -69,6 +69,26 @@
 
 } // Unnamed namespace.
 
+/*
+    Test for correct creation of PDF from an illustration.
+
+    This implements the first half of the item (6) of the testing 
specification:
+
+        6. Produce PDF's for two input file types.
+
+          A. File | New | Illustration | OK
+             File | Print
+             Expected result:
+               One 'unnamed*.pdf' exists in 'fop-0.20.5/'
+
+    The differences compared to the specification:
+
+    - "File | Print preview" is used instead of "File | Print" to avoid 
actually
+      producing output on paper unnecessarily.
+
+    - Check for the file existence in the print directory configured in
+      configurable_settings.xml and do not hardcode "fop-0.20.5/".
+ */
 LMI_WX_TEST_CASE(pdf_illustration)
 {
     // Create a new illustration.
@@ -93,6 +113,19 @@
     // can't be removed before it is closed.
 }
 
+/*
+    Test for correct creation of PDF from a census.
+
+    This implements the second half of the item (6) of the testing 
specification:
+
+        6. Produce PDF's for two input file types.
+
+          B. File | New | Census
+             Census | Add cell (2x)
+             Census | Print case to disk
+             Expected result:
+               Three pdf's plus the composite with "unnamed" prefix.
+ */
 LMI_WX_TEST_CASE(pdf_census)
 {
     // Create a new census.

Modified: lmi/trunk/wx_test_validate_output.cpp
===================================================================
--- lmi/trunk/wx_test_validate_output.cpp       2014-11-23 20:24:44 UTC (rev 
6039)
+++ lmi/trunk/wx_test_validate_output.cpp       2014-12-02 12:00:14 UTC (rev 
6040)
@@ -81,6 +81,35 @@
 
 } // Unnamed namespace.
 
+/*
+    Add test to validate existence of the expected output files.
+
+    This implements the following item of the testing specification:
+
+        14. Validate existence and naming conventions of output for
+            named and unnamed files.
+
+          A. File | New | Illustration | enter 'idiosyncrasyZ' in
+             'Comments' | OK
+             Expected results:
+               file 'unnamed.monthly_trace.tsv' exists
+
+          B. File | Open | 'MonthlyTrace.ill' | press 'OK' to
+              [dismiss message box] | press 'OK' to run illustration
+             Expected results:
+               file 'MonthlyTrace.monthly_trace.tsv' exists
+
+          C. File | New | MEC testing | OK
+             Expected results:
+               file 'unnamed.mec.tsv' exists
+
+          D. File | Open | 'MecTesting.mec' | OK
+             Expected results:
+               file 'MecTesting.mec.tsv' exists
+
+    The currently configured spreadsheet file extension is used instead of the
+    hard-coded "tsv", otherwise the tests are implemented exactly as specified.
+ */
 LMI_WX_TEST_CASE(validate_output_illustration)
 {
     std::string const&




reply via email to

[Prev in Thread] Current Thread [Next in Thread]