.. Copyright (C) 2015, 2018, ALbert Mietus, SoftwareBeterMaken.nl; Part of Pathways project Some calculators, with ATSes ***************************** .. .. image:: WebApp_Calc.png .. :align: right .. :width: 30% .. .. image:: rekenServer.png .. :width: 66% .. .. image:: serverDemo.png .. :width: 66% .. rubric:: There a **two** calculator examples 1. A *WebApp*: A html-page, to run in your browser 2. A *xmlrcp* server: a deamon to offload your client .. rubric:: Both have (almost) the same, **limited** functionality * Add, subtract, multiply, divide; mainly (positive) integers only * Both requerer to ‘login’ first! Although these ‘products’ are almost trivial, and have a useless ‘login’ feature; they are great examples to show the Pathways concept. XXXXXX ======= :sectionauthor: Erik Jan, Albert Mietus Installation ************ #. install firefox #. install python (latest version) #. install PIP (usually installed with Python, but not always) #. add python to your path (http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7) #. add PIP to path (same as previous step, but now the folder C:/Python3x/Scripts #. Install selenium (open command window and tupe: 'pip install selenium' #. Unpack the Pathways-.zip file webapp1 ======= Edit the ini file :file:`.../calculators/webapp/tst/ATS/config.cfg` server1 ======= Edit the ini file :file:`.../calculators/server/tst/ATS/config.cfg` .. literalinclude:: RekenServer_config.cfg :language: cfg First Run ********* webapp2 ======= #. open command window #. navigate to yourpathwaypath/examples/calculators/webapp/tst #. type :command:`python ATS/telop.py --vector ../../tst/tst-data/telop.csv` The test should run and a firefox window opens where you see the calculator. In the end you should see '==ALL test are run OK' in de commandline server2 ======= Here the a deamon/service kind of product is tested; which is support to run *forever*. So to test it, we have to start it manually: a. Open a (new) command window :line-remark:`any shell on unix, ‘cmd’ on windows` #. Navigate to :file:`.../calculators/server/src/` #. Start the server: :command:`python ./rekenServer.py` Now, we can execute the tests, as normally. This is done is a separate window/shell/cmd-box * Open a (new) command window :line-remark:`any shell on unix, ‘cmd’ on windows` * Navigate to :file:`.../calculators/server/tst/` Several test are available: * :command:`python ATS/logInUit.py --vector ../../tst/tst-data/sessie.csv` * :command:`python ATS/logInUit.py --vector ../../tst/tst-data/login.csv` * :command:`python ATS/optellen.py --vector ../../tst/tst-data/telop.csv` All these test should pass and should report **--ALL test are run OK** .. tip:: When using a proper shell, the ‘python’ part is not needed. Using :command:`ATS/.py` has the same effect, with less typing. .. note:: For those that didn’t add python to the :envvar:`PATH`; the full path to the python has to be specified. It has to be **python-3!** (3.4 or later) .. hint:: It is possible to check whether the server runs, is reachable, by running command:`python connect_test.py`. When it give errors, the ATSes will fail to.