%vim:set tw=68:
% $Source: /home/greater/jail/greaterrepository/GREAT-ER/doc/greater-testplan.tex,v $
% $Id: greater-testplan.tex,v 1.56 2005/03/01 18:00:06 frank Exp $
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{parskip}
\usepackage{ifthen}
\usepackage{times}

\usepackage{geometry}
\geometry{left=1.0cm,textwidth=19cm,top=0.5cm,textheight=26.5cm}

\usepackage{amssymb}	% for $\square$

\def\CVS$#1: #2 ${\expandafter\def\csname CVS#1\endcsname{#2}}
\CVS$Revision: 1.56 $

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

%--- Needs to be set:
\newcommand{\greaterversion}{2.0 CVS GREAT-ER Sediment extension}

%\setlength{\itemsep}{40pt}
%\setlength{\parsep}{40pt}

\lhead{GREAT-ER \greaterversion}
\rhead{Test Plan \CVSRevision}

\begin{document}

\begin{tabular*}{0.85\textwidth}{@{\extracolsep{\fill}}*{3}l}
Computer: & Python Version: & Date: \\[1.5ex]
Operating System: & wxPython Version: & Tester: \\[1.5ex]
GREAT-ER API Version: & SciParam Version: & Test duration: \\[1.5ex]
Comments: & & \\[8ex]
\end{tabular*}


This test plan can be used to verify that all basic functions of GREAT-ER are
working as expected. Each test suite can be carried out on its own, so it is
not required to perform all tests at once.

Test failures can be reported to the GREAT-ER bug tracker at

\hspace{2cm} http://great-er.intevation.org/bugtracker.html

stating the version number of this document (\CVSRevision) and the number of
the test that failed.\newline
Please add the bug-ID on this document for cross-reference.

\emph{Please note}:
\begin{itemize}
\item	this test corresponds to GREAT-ER version \greaterversion.
\item	some dialogs may appear in another language. This is OK
		since some standard dialogs use the language of your
		desktop environment.
\end{itemize}


\newcommand{\test}[2][0]{

	#2 \dotfill
	$\ifthenelse{\equal{#1}{1}}{\blacksquare}{\square}_{yes}\hspace{5pt}
	\ifthenelse{\equal{#1}{2}}{\blacksquare}{\square}_{no}$
}


\renewcommand{\labelenumi}{\thesection.\theenumi}
\newcommand{\testsection}[2]{
	\section*{\addtocounter{section}{1} Test suite \thesection: #1}
	Prerequisites: #2
	}

\newcommand{\guiitem}[1]{
	{\sl\sffamily #1}
}

\section*{Overview}

Test section completed sucessfully?

\test[0]{\large Startup/Authentication}
\test[0]{\large Session Management}
\test[0]{\large Substance Management}
\test[0]{\large Environment Management}
\test[0]{\large Parameter Dialogs}
\test[0]{\large Catchment/Discharge Management}
\test[0]{\large Simulation}
\test[0]{\large Analysis}
\test[0]{\large Help}
\test[0]{\large Sediment Extension}

\clearpage

%------------------------------------------------------
\testsection{Startup/Authentication}
{
    Start GREAT-ER anew.
}

\begin{enumerate}

\item Check the application window.
\test[0]{The window titlebar displays 'GREAT-ER'?}
\test[0]{Only File and Simulation and Help are enabled in the menu bar?}
\test[0]{All buttons in the toolbar are disabled?}
\test[0]{The statusbar covers three fields, coordinates (when mouse is moved
over map area), 'not connected' and 'no session'?}

\item Enter menu Simulation.
\test[0]{Only Select Simulation Server is enabled?}

\item Enter menu File.
\test[0]{Only Authenticate and Exit are enabled?}

\item Select Authenticate.
\test[0]{Does the Authenticate dialog appear?}

\item Cycle through the dialog components with the \verb"<Tab>"-Key.
\test[0]{Are the components cycled in reasonable order?}

\item Press Cancel.
\test[0]{Does the dialog end properly?}

\item Select File/Authenticate. Enter correct database, correct username and
wrong password, press OK.
\test[0]{Does an error dialog say 'Authentication failed'?}

\item Press OK. Enter wrong database, correct username and correct password,
press OK.
\test[0]{Does an error dialog say 'Authentication failed'?}

\item Press OK. Enter correct database, correct username and correct password,
press OK.
\test[0]{Does the dialog end properly?}

\item Check the status bar.
\test[0]{Does the second field now display the user and group name?}

\item Enter menu File.
\test[0]{Only Disconnect, New Session, Open Session, Delete Session
and Exit are enabled?}

\item Select Disconnect.
\test[0]{Does the second status bar field change to 'not connected'?}

%\item Press No.
%\test[0]{Does the dialog end properly?}
%
%\item Enter menu File.
%\test[0]{Only Disconnect, New Session, Open Session, Delete Session and Exit
%are enabled?}

%\item Select Disconnect. Press Yes.
%\test[0]{Does the dialog appear and end properly?}

\item Enter menu File.
\test[0]{Only Authenticate and Exit are enabled?}

\item Exit GREAT-ER.
\test[0]{Does the application end properly?}

\end{enumerate}


%------------------------------------------------------
\testsection{Session Management}{
	Start GREAT-ER anew and connect to the database via Menu
	File/Authenticate.}

\begin{enumerate}

\item Select File/New Session.
\test[0]{Does the 'New Session' dialog appear?}

\item Cycle through the dialog components with the \verb"<Tab>"-Key.
\test[0]{Are the components cycled in reasonable order?}

\item Press Cancel.
\test[0]{Does the dialog end properly?}

\item Select File/New Session, then press OK.
\test[0]{Does a dialog appear which tells you to use a session name?}

\item Press OK. Enter a space as session name, and press OK.
\test[0]{Does a dialog appear which tells you to use a session name?}

\item Press OK. Enter a name and a comment, and press OK.
\test[0]{The window title displays 'GREAT-ER', the entered title and 
	'no substance' and 'no catchment'?}
\test[0]{Menu bar: The 'Analysis' menu is disabled, 
	all other menus are active?}
\test[0]{Tool bar: All tools are disabled?}
\test[0]{Status bar: The third field displays 'modified'?}

\item Enter the File Menu.
\test[0]{Are Edit Session, Save Session, Save Session As and Close Session
enabled now?}

\item Select File/Edit Session.
\test[0]{Does the 'Edit Session' dialog appear?}

\item Press Cancel.
\test[0]{Does the dialog end properly?}

\item Select File/Edit Session. Select catchment Don and press OK.
\test[0]{Does the main window show the catchment with its river network,
discharge sites and catchment boundary?}

\item Select File/Edit Session. Select catchment \verb.<.None\verb.>.
and press OK.
\test[0]{All buttons in the toolbar are disabled?}
\test[0]{Is the main window empty?}

\item Select File/Edit Session. Select catchment Went and press OK.
\test[0]{Tool bar: Are the navigation tools activated?}
\test[0]{Does the main window show the catchment with its river network,
discharge sites and catchment boundary?}

\item Select File/Save Session.
\test[0]{Status bar: Has the third field changed to 'unmodified'?}
\test[0]{Is the menu item File/Save Session disabled?}

\item Select File/Edit Session. Select substance Boron and press OK.
\test[0]{Is the menu item File/Save Session enabled?}
\test[0]{The window title displays 'GREAT-ER', the entered title and
	'Boron' and 'Went'?}

\item Select File/Save Session As. Change name and comment and press Cancel.
\test[0]{Window title, status bar: Do the session informations still display
	the old, modified settings?}

\item Select File/Save Session As. Change name and comment and press OK.
\test[0]{Do the session informations display the new, unmodified settings?}
\test[0]{Does the File/Edit Session dialog display the new comment?}

\item Enter menu File.
\test[0]{Is the menu item Save Session disabled?}

\item Select File/Edit Session. Select catchment Don and press OK. Then select
File/Close Session.
\test[0]{Does a dialog appear and offer to save the last modifications?}

\item Press Cancel.
\test[0]{Does the catchment view remain in the main window?}

\item Select File/Close Session and press No.
\test[0]{Is the main window empty and the items Edit, Save, Save As and Close
of menu File disabled?}

\item Select File/Open Session.
\test[0]{Does the Open Session dialog appear properly and contain at least
the two sessions saved previously?}

\item Press Cancel.
\test[0]{Is the main window still empty and the items Edit, Save, Save As
and Close of menu File disabled?}

\item Select File/Open Session, select one of the previously saved
sessions and press OK.
\test[0]{Does the main window show the catchment?}

\item Enter menu File.
\test[0]{Is menu item Save Session disabled?}

\item Select File/Delete Session.
\test[0]{Does the Delete Session dialog appear properly and show the two
sessions created previously?}

\item Press Cancel.
\test[0]{Does the dialog end properly?}

\item Select File/Delete Session, select the session that is not currently
opened and press OK.
\test[0]{Does a confirmation dialog appear?}

\item Press No, select File/Delete Session.
\test[0]{Is the session that is not currently open in the selection list?}

\item Select the session that is not currently opened, press OK, confirm with
Yes and select File/Delete Session.
\test[0]{Has the session that is not currently open been gone from the
selection list?}

\item Select the session that is currently opened and press OK.
\test[0]{Does a confirmation dialog appear stating that the selected
session is the current session?}

\item Press No.
\test[0]{Is the current session still active without any changes?}

\item Enter File/Delete Session and select the current session. Press Yes.
\test[0]{Is the mainwindow now empty and the items Edit, Save, Save As
and Close of menu File disabled?}

\item Select File/New Session, enter a session name, press OK. Now select
File/Exit.
\test[0]{Does a warning dialog appear?}

\item Press No.
\test[0]{Does GREAT-ER end properly without further request?}

\end{enumerate}

%------------------------------------------------------
%note that Environment Management is almost analog
\testsection{Substance Management}{
	Start GREAT-ER anew and connect to the database via Menu
	File/Authenticate. Then select File/New Session, enter
	only a name and press OK.
	}

\begin{enumerate}

\item Select Menu Substance.
\test[0]{Are 'Edit' and 'Save As' the only disabled items?}

\item Select Substance/Open.
\test[0]{Does the Open Substance dialog appear?}

\item Press Cancel.
\test[0]{Does the dialog end properly and 'Edit/Save As' are still the only
disabled items in the Substance menu?}

\item Select Substance/Open, select Boron and press OK.
\test[0]{Does the dialog end properly and all Substance menu items are enabled?}

\item Select Substance/Edit.
\test[0]{Does the dialog 'Substance Data' appear properly and allow
to enter various parameters in 16 sections?}

\item Change a parameter and press OK.
\test[0]{Does the dialog end properly?}

\item Select Substance/Edit.
\test[0]{Is the changed parameter shown as changed?}

\item Press Cancel, select Substance/Open.
\test[0]{Does a warning dialog appear stating that you will loose the current
substance by loading another substance.}

\item Press OK. select Substance \verb.<.None\verb.>. and press OK.
\test[0]{Are 'Edit' and 'Save As' disabled in the Substance menu?}

\item Select Substance/Open, select LAS and press OK. Then select
Substance/Save As.
\test[0]{Are view and edit privileges only set for the owner?}

\item Change the Name and press Cancel.
\test[0]{Does the window title bar still show the old name?}

\item Again enter Substance/Save As, change the name and add view
privilege for the group and press OK. Then enter Substance/Save As again.
\test[0]{Does the dialog show the new name, but the old privileges?}
% this is specific for substance:
\test[0]{Does the window title bar now show the new name?}

\item Press Cancel. Select Substance/Open and confirm the request.
	Then scroll to the newly created substance.
\test[0]{Are the privileges for the new substance the same you specified?}

\item Press Cancel. Select Substance/Delete and select the newly created
	substance and press OK.
\test[0]{Does a request pop up?}
\test[0]{If you answer with Yes, does the dialog silently close?}
\test[0]{Is the substance gone if you reenter the Delete Substance dialog?}

\end{enumerate}


%------------------------------------------------------
%note that Substance Management is almost analog
\testsection{Environment Management}{
	Start GREAT-ER anew and connect to the database via Menu
	File/Authenticate. Then select File/New Session, enter
	only a name and press OK.
	}

\begin{enumerate}

\item Select Environment/Open.
\test[0]{Does the Open Environment dialog appear?}

\item Select None and press OK.
\test[0]{Does the dialog end properly and 'Edit' and 'Save As' are the
	only disabled items in the Environment menu?}

\item Select Environment/Open, select Nongeo and press OK.
\test[0]{Does the dialog end properly and are Environment/Edit and
	Environment/Save As now enabled?}

\item Select Environment/Edit.
\test[0]{Does the dialog 'Environment Parameters' appear properly and allow
to enter various parameters in seven sections?}

\item Change a parameter and press OK.
\test[0]{Does the dialog end properly?}

\item Select Environment/Edit.
\test[0]{Is the changed parameter shown as changed?}

\item Press Cancel, select Environment/Open.
\test[0]{Does a warning dialog appear stating that you will loose the current
environment by loading another environment.}

\item Press OK. Select environment \verb.<.None\verb.>. and press OK.
\test[0]{Are 'Edit' and 'Save As' disabled in the Environment menu?}

\item Select Environment/Open, select Nongeo and press OK. Then select
Environment/Save As.
\test[0]{Are view and edit privileges only set for the owner?}

\item Change the Name and press Cancel. Enter Environment/Save As again.
\test[0]{Does the dialog still show the old name?}

\item Change the name and add view privilege for the group and press OK.
	Then enter Environment/Save As again.
\test[0]{Does the dialog show the new name, but the old privileges?}

\item Select Environment/Open and confirm  the request. Then scroll to
the newly created environment.
\test[0]{Are the privileges for the new environment the same you specified?}

\item Select Environment/Delete and select the newly created environment and
press OK.
\test[0]{Does a request pop up?}
\test[0]{If you answer with Yes, does the dialog silently close?}
\test[0]{Is the environment gone if you reenter the Delete Environment dialog?}

\end{enumerate}


%------------------------------------------------------
\testsection{Parameter Dialogs}{
    Start GREAT-ER, create a new session
with substance 'Boron'.}

\begin{enumerate}

\item Select Substance/Edit.
\test[0]{Does the 'Substance Data' dialog appear filled with Boron data?}

\item Keyboard Navigation
\test[0]{Does {\tt Tab} cycle through the entries?}
\test[0]{{\tt Shift-Tab} cycles backwards?}
\test[0]{For a given entry, does {\tt Alt-D} switch to the 'Details Box'?}
\test[0]{In the details box, does {\tt Alt-D} switch to the corresponding
	entry?}
\test[0]{After the last 'Details Box' entry the focus returns to the first
	parameter entry?}
\test[0]{{\tt Ctrl-Tab} moves to the next notebook tab?}
\test[0]{{\tt Shift-Ctrl-Tab} moves to the previous notebook tab?}

\item Move back to the 'Identification' notebook tab and focus on the
	'Name' entry. Press \verb"<Backspace>" key, then \verb"<Tab>" key.
\test[0]{Is the name field set to 'unknown'?}
\test[0]{Does the input field become red?}
\test[0]{Is 'CAS' selected and shown in the details box?}

\item Press Cancel.
\test[0]{Does the dialog end?}

\item Select Substance/Edit.
\test[0]{Is the name field set to 'Boron'?}

\item Enter 'not Boron'. Select notebook tab 'Phys. Chem. Properties'.
\test[0]{Does the details box show details for 'Molar Mass'?}

\item Click on the 'Water solubility' input field.
\test[0]{Does the details box show usual and valid ranges for
	'Water solubility'?}

\item Enter '1e7', then click on the 'pKa' input field.
\test[0]{Does the input field for 'Water solubility' contain '10000000.0'?}
\test[0]{Does the input field for 'Water solubility' become yellow?}

\item Enter '30', then press \verb"<Tab>" key.
\test[0]{Does the input field for 'pKa' contain '30.0'?}
\test[0]{Does the input field for 'pKa' become red?}

\item Press OK.
\test[0]{Does the 'Unusual value' dialog appear for 'Water solubility'?}

\item Press Yes.
\test[0]{Does the 'Invalid value' dialog appear for 'pKa'?}

\item Press OK.
\test[0]{Is 'pKa' selected?}

\item Select 'neutral' from 'Dissociation'.
\test[0]{Does the details box show details for 'Dissociation'?}

\item Select notebook tab 'Partitioning'.
\test[0]{Does the 'Invalid value' dialog appear for 'pKa'?}

\item Press OK.
\test[0]{Is 'pKa' selected?}

\item Press \verb"<Backspace>" key, select notebook tab 'WWTP Removal' and 
	click on the 'Removal (AS)' input field.
\test[0]{Is the 'Edit Distribution' button enabled?}

\item Click on 'Edit Distribution'.
\test[0]{Does a dialog for choosing distribution type and the distibution
		 parameter (here uniform, min, max)?}

\item Select distribution type 'normal', then press Cancel.
\test[0]{Is min, max replaced by mean, standard deviation?}
\test[0]{Does the dialog end and is distribution type still 'none'?}

\item Click on 'Edit Distribution', and select distribution type 'uniform'.
\test[0]{Does the input field for max. value become red?}

\item Enter '2' for max. value, then press OK.
\test[0]{Does the 'Invalid value' dialog appear for 'max. value'?}

\item Press OK, enter '1' for max. value, then press OK.
\test[0]{Does the input field for 'Removal (AS)' contain '0.0;1.0'?}

\item Enter '0.5;0.1/normal', press \verb"<Tab>".
\test[0]{Does the input field for 'Removal (AS)' contain '0.5;0.1'?}

\item Press \verb"<Shift>-<Tab>".
\test[0]{Is distribution type now 'normal'?}

\item Select notebook tab 'Biodegradation'.
\test[0]{Is there a frame 'Monod parameters' grouping four entries?}

\item Press OK.
\test[0]{Does the dialog end?}

\item Select Substance/Edit.
\test[0]{Is the name field set to 'not Boron'?}

\item Select notebook tab 'Phys. Chem. Properties'.
\test[0]{Is the input field for 'Water solubility' yellow?}

\end{enumerate}

%------------------------------------------------------
\testsection{Catchment/Discharge Management}{
Start GREAT-ER and create or open
a session with a substance.}

\begin{enumerate}

\item Select Catchment/Select.
\test[0]{Does the 'Select Catchment' dialog appear?}

\item Select a catchment and press OK.
\test[0]{Is the selected catchment displayed in the main window?}

\item Select Table/Show.
\test[0]{Does the list contain an entry 'Site-specific Emission Data'?}
\test[0]{Does the list not contain the entry 'Site-specific Discharge Data'?}

\item Select Catchment/Edit Emission Data.
\test[0]{Is the 'Edit Emission Data' tool selected in the toolbar?}

\item Click on a discharge marker.
\test[0]{Does the 'Edit Emission Data' dialog appear?}

\item Enter '10' for 'Site specific consumption' and press OK.
\test[0]{Does the 'Edit Emission Data' dialog disappear?}

\item Click on the same discharge marker again.
\test[0]{Is 'Site specific consumption' equal to '10.0'?}

\item Press \verb"<Escape>".
\test[0]{Does the 'Edit Emission Data' dialog disappear?}

\item Click on the 'Edit Discharge Data' tool in the toolbar.
\test[0]{Is the 'Edit Discharge Data' tool selected in the toolbar?}

\item Click on a discharge marker.
\test[0]{Does the 'Edit Discharge Data' dialog appear?}

\item Enter a WWTP removal of '0.3' and press OK.
\test[0]{Does the 'Edit Discharge Data' dialog disappear?}

\item Click on the same discharge marker again.
\test[0]{Is 'WWTP removal' equal to '0.3'?}

\item If a session has substance/catchment specific settings these have to be
	deleted if substance or catchment are changed. Check the following four
	cases, especially look after edited values which have to be set back
	to the defaults after changing substance/catchment:
\test[0]{Edit of emission data and change of substance without problems?}
\test[0]{Edit of emission data and change of catchment without problems?}
\test[0]{Edit of discharge data and change of substance without problems?}
\test[0]{Edit of discharge data and change of catchment without problems?}

\end{enumerate}


%------------------------------------------------------
\testsection{Simulation}{
	Start GREAT-ER anew and connect to the database via Menu
	File/Authenticate. Then select File/New Session, enter
	name, select no substance and catchment Went and press OK.
	Then select Substance/New and enter a name and change 'Consumption'
	under 'Emission Data' to 0.01 and press OK.
	}

\begin{enumerate}

\item Select Simulation/Edit Model Parameters.
\test[0]{Does the 'Model Parameters' dialog appear?}

\item Select notebook tab 'River'.
\test[0]{Is the 'River' tab shown?}

\item Change one of the choices from 'yes' to 'no'.
\test[0]{Does the details box show details for this parameter?}

\item Press 'Apply Default'.
\test[0]{Does the choice change to 'yes'?}

\item Press OK.
\test[0]{Does the dialog end?}

\item Select Simulation/Missing Parameters.
\test[0]{Does a dialog appear informing you that a number of
substance parameters are missing?}

\item Select Substance/Open and load substance Boron. Then select
Simulation/Missing Parameters.
\test[0]{Does the dialog now say that you can start the simulation?}

\item Select Substance/Edit and go to section WWTP Removal.
\test[0]{Is there a required indicator for primary, AS and TF removal?}
\test[0]{Are all other entries of this section shown without this indicator?}

\item Select Simulation/Edit Model Parameters, go to section Sewer and switch
to mode 2 and press OK. Then enter Substance/Edit and go to section WWTP Removal.
\test[0]{Is there now an additional required indicator for sewer removal?}

\item Select Simulation/Start.
\test[0]{Does a progress dialog appear?}

\item Press Cancel.
\test[0]{Does a info dialog close and is no results layer added to the map?}

\item Select Simulation/Start and wait for the simulation to end.
\test[0]{Are the Analysis menu and the two analysis tool buttons now active?}
\test[0]{Is there a new layer 'CSim Mean' with color coded river network?}

\item Select Table/Show.
\test[0]{Does the list contain exactly one entry 'Stretch Results'?}
\test[0]{Does the list contain exactly one entry 'Discharge Results'?}

% TODO: Simulation Server selection (we need a running server somewhere
% or an explanation how to start one separately).
% Or: Make GREAT-ER show the port and host of the own server. Then start
% a second GREAT-ER and use the first GREAT-ERs server.
% all this maybe should form a chapter of its own though.

\end{enumerate}

%------------------------------------------------------
\testsection{Analysis}{
	Start GREAT-ER anew and connect to the
	database via Menu File/Authenticate. Then select File/New Session, enter
	name, select LAS, catchment Itter and press OK. Then
	Select Simulation/Start and wait for the simulation to finish.
	}

\begin{enumerate}

\item[] {\bf Add Background Layer:} %----------

\item Select Analysis/Add Background Layer.
\test[0]{Does a dialog appear that allows to select one or more
		 entries from a list?}

\item Press Cancel.
\test[0]{Does a dialog close properly and is no layer added to the map?}

\item Select Analysis/Add Background Layer, select a single entry and press OK.
\test[0]{Does a dialog close properly a layer is added to the map?}

\item Select the new layer in the Legend and select Menu Map/Remove Layer.
\test[0]{Does the layer remove properly from the map?}

\item[] {\bf Calculate River Csim X:} %----------

\item Select Analysis/Calculate River Csim X.
\test[0]{Does a dialog appear that allows to enter a single percentile value?}

\item Enter '0', '100', some non-digits and a non-integer and each time press
	  OK.
\test[0]{Does a dialog appear explaining that you have to enter a integer
		 value between 0 and 100?}

\item Press Cancel.
\test[0]{Does a dialog close properly and is no layer added to the map?}

\item Select Analysis/Calculate River Csim X and press OK.
\test[0]{Does a dialog close properly and is there a new layer on the map
         that is named 'CSim 90' displaying a color-coded river network?}

\item Select Analysis/Calculate River Csim X, enter '1' and press OK.
\test[0]{Does a dialog close properly and is there a new layer on the map
         that is named 'CSim 1' displaying a color-coded river network?}
\test[0]{Are the value ranges lower than those for the CSim 90?}

\item[] {\bf Csim Classes River:} %----------

\item Select Analysis/Csim Classes River.
\test[0]{Does a dialog appear that allows to select a Csim percentile as well
		 as a classification?}

\item Press Cancel.
\test[0]{Does a dialog close properly and is no layer added to the map?}

\item Select Analysis/Csim Classes River and press OK.
\test[0]{Does a dialog close properly and is a new layer added to the map
         which is named 'CSim Mean Classes'?}

\item Select Analysis/Csim Classes River and select Csim 80 percentile and
	  press OK.
\test[0]{Does a dialog close properly and is the layer
         'CSim Mean Classes' replaced by a layer 'CSim 80 Classes'?}

\item Select Analysis/Csim Classes River and increase the number of classes
      to 7 and press OK.
\test[0]{Does a dialog appear explaining that you have to enter a value
         for class 5 and that the value must be between 91 and 100?}

\item Enter '2' for class 5 and press OK.
\test[0]{Does a dialog appear explaining that the value for class 4 is
	     incorrect?}

\item Enter '92' for class 5 and press OK.
\test[0]{Does a dialog appear explaining that you have to enter a value
         for class 6 and that the value must be between 93 and 99?}

\item Enter '50' for class 3, '60' for class 4, '70' for class 5, '80'
      for class 6 and press OK.
\test[0]{Does a dialog close properly and is the layer
         'CSim 80 Classes' replaced by a layer 'CSim 80 Classes'
		 that has now 7 classes (plus the 0-class)?}

\item[] {\bf Combine Csim/Flow:} %----------

\item Select Analysis/Combine Csim/Flow.
\test[0]{Does an additional layer appear that is named 'CombinCsimFlow'?}

\item[] {\bf PEC Initial:} %----------

\item Select Analysis/PEC initial.
\test[0]{Does a dialog appear that presents the resulting value
of PEC intial?}
\test[0]{Is the value greater than 0?}

\item[] {\bf PEC Catchment:} %----------

\item Select Analysis/PEC catchment.
\test[0]{Does a dialog appear that presents the resulting values
for PEC catchment?}
\test[0]{Are all values greater than 0?}
\test[0]{Are the stretches of layer 'CSim Mean' selected as said in the
         dialog?}

\item[] {\bf Discharge Influent Csim:} %----------

\item Select Analysis/Discharge Influent Csim.
\test[0]{Does an additional layer appear that is named 'CsimInfl Mean'?}

\item[] {\bf Discharge Effluent Csim:} %----------

\item Select Analysis/Discharge Effluent Csim.
\test[0]{Does an additional layer appear that is named 'CsimEffl Mean'?}
\test[0]{Are the values for this layer significantly lower than those of the
         layer 'CsimInfl Mean'?}

\item[] {\bf Risk Analysis:} %----------

\item Select Analysis/Risk Analysis.
\test[0]{Does a dialog appear explaining that a valid PNEC is missing?}

\item Press OK. Then select Substance/Edit and go to the parameter group
      'Risk Assessment'. Enter a value of '0.05' and press OK.
	  Select Analysis/Risk Analysis.
\test[0]{Does a new layer appear with the name 'Risk: PEC/PNEC' and with three
         classes 0-0.9, 0.9-1, $>$1 ?}

\item[] {\bf Show Picture:} %----------

\item Select Analysis/Show Picture.
\test[0]{Is the corresponding toolbar icon now sunken?}

\item Click on one of the picture sites on the map.
\test[0]{Does a dialog appear with a picture?}

\item Press 'Save As'.
\test[0]{Does a file-dialog appear?}

\item Save the file to some directory. Open this file now with any tool
      that can display pictures.
\test[0]{Does your tool show the same picture as shown in the GREAT-ER dialog?}

\item Close your picture-view. Press OK in the Picture-Dialog of GREAT-ER.
\test[0]{Does the dialog end properly?}

\item Select 'Picture Site' layer in the legend and select Layer/Hide.
\test[0]{Does the toolbar icon for the Pictures-tool deactivate?}

\item[] {\bf Mass Flux:} %----------

\item Select Analysis/Mass Flux and select a loaded river stretch on the map.
\test[0]{Is the corresponding toolbar icon now sunken?}
\test[0]{Does a dialog appear that presents the chemical mass flux
         for the selected stretch?}

\item Select 'CSim Mean' layer in the legend and select Layer/Hide.
\test[0]{Does the toolbar icon for the Mass Flux-tool deactivate?}

\item Select 'CSim Mean' layer in the legend and select Layer/Show.

\item[] {\bf Concentration Profile:} %----------

\item Select Analysis/Concentration Profile and select a river stretch
on the map.
\test[0]{Is the corresponding toolbar icon now sunken?}
\test[0]{Does a dialog appear that contains a profile graph?}

\item Press OK.
\test[0]{Does the dialog end properly?}

\item Select Table/Show.
\test[0]{Does the dialog contain an entry 'Concentration Profile (start
         stretch NNNN'?}

\item Select this entry and press OK.
\test[0]{Does a table dialog appear with the stretches, length and all
         results data?}


% TODO: Simulation Server selection (we need a running server somewhere
% or an explanation how to start one separately).
% Or: Make GREAT-ER show the port and host of the own server. Then start
% a second GREAT-ER and use the first GREAT-ERs server.
% all this maybe should form a chapter of its own though.

\end{enumerate}

%------------------------------------------------------
\testsection{Help}{
	Start GREAT-ER anew.
	}

\begin{enumerate}

\item Select Help/About.
\test[0]{Does a dialog appear that has on the left hand the contents of the
         splash-screen and on the right detailed information on module
		 versions and License?}

\item Select Help/Greater User Manual.
\test[0]{Does your pdf-viewer application appear?}
\test[0]{Does the pdf-viewer load and display the GREAT-ER User's Manual?}

\item Select Help/Thuban User Manual.
\test[0]{Does your pdf-viewer application appear?}
\test[0]{Does the pdf-viewer load and display the Thuban User's Manual?}

\end{enumerate}

%------------------------------------------------------
\testsection{Sediment Extension}{
	Start GREAT-ER anew and connect to the
	database via Menu {\sl File/Authenticate}.\\ 
	Select {\sl File/New Session}, enter
	name, select {\sl LAS}, catchment {\sl Itter} and press {\sl OK}.\\ 
	Select {\sl Substance/Edit},
	on the notebook tab {\sl Partitioning} enter a {\sl Kd River};
	on the notebook tab {\sl River Removal}
	enter values for the {\sl k (deg)}, {\sl k (sed)}  and {\sl k (vol)}.\\
	Select {\sl Environment/Edit}, on the notebook tab {\sl River} 
	select the {\sl SS (river)} entry and press the 
	{\sl Edit Distribution} button. In the dialog press {\sl OK} and 
	finally leave the Edit Parameters dialog with {\sl OK}. 
	}
\begin{enumerate}

\item[] {\bf Extension Setup:} %----------

\item Select {\sl Simulation/Edit Model Parameters}, on the notebook 
	tab {\sl Sediment} select {\sl Mode: Unique SS concentration}.\\
	Press {\sl OK} to leave the dialog.
	\test[0]{Does a window pop up with a warning (Sediment 
	module will not be used)?}

\item {Select {\sl Simulation/Start} and wait for the simulation to finish.}\\
	Select the {\sl Analysis} menu

	\test[0]{Is the menu item {\sl Sediment
	Extension Results} grayed out/disabled?}

\item Select {\sl Simulation/Edit Model Parameters}, on the notebook 
	tab {\sl River} select {\sl Mode: Mode 2: basic 3 processes removal}.\\
	Press {\sl OK} to leave the dialog.

	\test[0]{Is the dialog is closed without a
	warning?}

\item[] {\bf Sediment Extension Layer Derivation:} %----------

\item {Select {\sl Simulation/Start} and wait for the simulation to finish.}\\
	Select the {\sl Analysis} menu.

	\test[0]{Is the menu item {\sl Sediment
	Extension Results} enabled?}

\item Select the {\sl Sediment Extension Results} menu item. Select 
	{\sl Csim Sediment} and press OK. 
	
	\test[0]{Does a new layer (Csim Sediment)
	appear in the legend?}

\item Select {\sl Analysis/Sediment Extension Results}, select 
	{\sl Csim Sediment} in the appearing dialog and press OK. 
	
	\test[0]{The legend shouldn't change, is this correct?} 

\item Make the CSim Sediment layer the active one, select 
	{\sl Map/Remove Layer}. 
	
	\test[0]{The CSim Sediment layer is removed from the legend?}

\item Select the {\sl Sediment Extension Results} menu item. Select 
	{\sl Csim Sediment} and press {\sl OK}. 

	\test[0]{Does a layer (Csim Sediment)
	appear in the legend again?}

\item Select the {\sl Sediment Extension Results} menu item. Select all
	three entries from the list and press OK. 

	\test[0]{Do two new layers 
	(Csim sorbed and Csim dissolved) appear in the legend?}

\item {Select {\sl Simulation/Start} and wait for the simulation to finish.}
	 
\test[0]{The three layers created earlier are removed from the legend, only the 
	default Csim Mean result layer remains?}

\item[] {\bf Sediment Extension Analysis:} %----------

\item Select the {\sl Csim Mean} layer in the layer. 
	Select the {\sl Analysis} menu.

\test[0]{Select the {\sl Analysis} menu. Are all menu items enabled?}

\item Select the {\sl River network} layer in the layer. 
	Select the {\sl Analysis} menu.

\test[0]{Are the menu items {\sl Add Background Layer},
	{Sediment Extension Results} and the two items
	{\sl Discharge Influent Csim}/{\sl Discharge Effluent Csim}
	and the {\sl Show pictures} enabled?}

\test[0]{Are all other items in the menu {\bf disabled}?}

\item Select the {\sl Sediment Extension Results} menu item. Select 
	{\sl Csim Sediment} and press OK. Select the layer {\sl Csim Sediment}
	in the legend and open the {\sl Analysis} menu.

\test[0]{Are the menu items {\sl Add Background Layer} and 
	{\sl Sediment Extension Results} enabled?}

\test[0]{Are the items {\sl Calculate River Csim X}, 
	{\sl Csim Classes River} and {\sl Combine Flow/Csim} enabled?}

\test[0]{Are the menu items {\sl PEC Catchment} and 
	{\sl PEC initial} {\bf disabled}?}

\test[0]{Are the menu items {\sl Risk Analysis} and 
	{\sl Mass Flux} {\bf disabled}?}

\test[0]{Is the menu item {\sl Concentration Profile} enabled?}

\item Select the {\sl Sediment Extension Results} menu item. Select 
	{\sl Csim dissolved} and press OK. Select the layer 
	{\sl Csim dissolved} in the legend and open the {\sl Analysis} menu.

\test[0]{Is the menu item {\sl Mass Flux} enabled?}

\item[] {\bf Sediment Extension: File-based suspended sediments:} %----------

GREAT-ER offers on option to upload a CSV-Table (BasinID, StretchID, SS Mean,
SS StdDev, DiffuseInput Mean, DiffuseInput StdDev) covering a record for 
each stretch in a catchment to the river
network. You need three files for the following test series: Two files 
matching the catchment you are testing with in the format mentioned above 
and a third file with some records missing. All files should conatin
significantly different values for SS Mean and SS StdDev, which doesn't have to
have a real meaning. 

\item Prepare a session as described under the Sediment Extensions Test Suite
prerequisites. Open the dialog 
\guiitem{Model} / \guiitem{Edit Model Parameters}, card
\guiitem{River / Sediment}.

\test[0]{Is the item \guiitem{TERRACE data file loaded} not editable but
displaying {\sl no}?}

\item Open the \guiitem{Catchment} menu.

\test[0]{Is the menu item \guiitem{Load TERRACE Data} enabled?}

\test[0]{Is the menu item \guiitem{Remove TERRACE Data} disabled?}

\item Select the \guiitem{Load TERRACE Data}. A file selection dialog is raised,
select one of the prepared files matching the river network.

\test[0]{Is the status bar displaying the session status with {\sl modified}?}

\test[0]{Use the {\sl Identify Tool} to query some river network attributes.
Does the set of attributes cover the fields BasinID, StretchID, SS Mean,
SS StdDev with expected values?}

\test[0]{Save the session (Name: "TERRACE File Test 1"). 
	Does the status bar change to {\sl unmodified}?}

\item Open the dialog \guiitem{Model} / \guiitem{Edit Model Parameters}, card
\guiitem{River / Sediment}.

\test[0]{Is the item \guiitem{TERRACE Data File loaded} not editable but
displaying {\sl yes}?}

\item Select the menu item \guiitem{Catchment} / \guiitem{Load TERRACE Data}.

\test[0]{Is an {\sl OK/Cancel} dialog raised with a warning that the current 
	session contains already a session file?}

\test[0]{Select \guiitem{Cancel}. Is the dialog closed and no further dialog
	is raised?}

\test[0]{Is the status bar displaying the session status with {\sl unmodified}?}

\test[0]{Check the river network with the {\sl Identify Tool}. Does it cover
	still the former attributes?}

\item Select the menu item \guiitem{Catchment} / \guiitem{Load TERRACE Data}. Confirm
	the warning with \guiitem{OK}. Enter a non-existing file name in the 
	file selection dialog.

\test[0]{Is an Error raised asking to select an exisiting file?}

\test[0]{Select \guiitem{OK}, is the file selection dialog displayed again?}

\test[0]{Select \guiitem{Cancel}, is the file selection dialog closed?}

\test[0]{Is the status bar displaying the session status with {\sl unmodified}?}

\item Select the menu item \guiitem{Catchment} / \guiitem{Load TERRACE Data}. Confirm
	the warning with \guiitem{OK}. Select the file with the broken suspended 
	sediment data via the file selection dialog.

\test[0]{Is an Error raised informing you that loading is aborted?}

\test[0]{Is the status bar displaying the session status with {\sl unmodified}?}

\test[0]{Check the river network with the {\sl Identify Tool}. Does it cover
	still the former attributes?}

\item Select the menu item \guiitem{Catchment} / \guiitem{Load TERRACE Data}. Confirm
	the warning with \guiitem{OK}. Select the file with the second set of 		matching suspended sediment data via the file selection dialog.

\test[0]{Is the status bar displaying the session status with {\sl modified}?}

\test[0]{Check the river network with the {\sl Identify Tool}. Does it cover
	the new set of suspended sediment attributes?}

\test[0]{The former set of suspended sediment attributes is not displayed}

\item Save the session as a new session (\guiitem{Session} / 
	\guiitem{Save Session As}, Name: "TERRACE File Test 2".

\item Reload the session "TERRACE File Test 1" via \guiitem{Session} / 
	\guiitem{Open Session}.

\test[0]{Check the river network with the {\sl Identify Tool}. Does it cover
	the former set of suspended sediment attributes?}

\item Load the session "TERRACE File Test 2" via \guiitem{Session} / 
	\guiitem{Open Session}.

\test[0]{Check the river network with the {\sl Identify Tool}. Does it cover
	the expected set of suspended sediment attributes?}

\item Select a new catchment for the current session: 
	\guiitem{Catchment} / \guiitem{Select Catchment}.
	
\test[0]{Is the new catchment loaded?}

\test[0]{Open the dialog \guiitem{Model} / \guiitem{Edit Model Parameters}, card
\guiitem{Sediment}. Is the item \guiitem{TERRACE Data File loaded} displaying {\sl no}?}

\item Reload the session "TERRACE File Test 1" via \guiitem{Session} / 
	\guiitem{Open Session}.

\item Select a new catchment for the current session: 
	\guiitem{Session} / \guiitem{Edit Session}.
	
\test[0]{Is the new catchment loaded?}

\test[0]{Open the dialog \guiitem{Model} / \guiitem{Edit Model Parameters}, card
\guiitem{River / Sediment}. Is the item \guiitem{TERRACE Data File loaded} displaying {\sl no}?}

\end{enumerate}

\end{document}

