OverviewUsage.rst.txt 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ============================
  2. What is ``baangt``
  3. ============================
  4. Testing software has always been a challenging field, and it's not getting easier or simpler, as overall complexity in corporate
  5. and other applications skyrockets. Release cycles in larger corporations are often long because of inefficient regression
  6. tests. Also costs of software updates, upgrades and forward development are heavily impacted by too little test coverage.
  7. **To stop praying when you release to production, you need to start serious testing!**
  8. With ``baangt`` you have one *open source* solution for all your test stages and needs. Be it Frontend with Webbrowser, API,
  9. graphQL, SOAP, oData or chromium related App-Tests. You'll use one toolset, one database per stage and one reporting to
  10. see at any given moment, how your stages and applications are doing and if it's safe to release the current state of one
  11. stage to the next.
  12. ``baangt`` is optimized to be super easy to start, and flexible when your demand grows.
  13. The fastest, simplest way to record test cases
  14. ----------------------------------------------
  15. If your requirements are pretty basic, you'd start using ``baangt`` with a simple Excel-Sheet as source of Testcase definition and
  16. Testdata definition. This is super fast, very easy even for end-users but has limited flexibility, even though it comes packed
  17. with all features of the higher end solutions like reporting, fault tolerance, screenshots in case of errors and much more.
  18. More powerful and still simple ways:
  19. ------------------------------------
  20. As your requirements grow you want to have Testcase and testrun definition separately (e.g. you want to execute the same
  21. test cases on different stages of your system landscape (Pre-Quality, Final-Quality, Dev) and not for every heartbeat test
  22. you would want to run through your 1000s of records of test data. Maybe you will have a SQL-Query in your Excel based data, which changes
  23. data records dynamically or per stage or per version, that you want to test for.
  24. Things are not so simple in this stage, but still simple enough for technically versed business department to run high
  25. quality tests on all stages by themselves.
  26. Even after the point, where you need technicians to integrate baangt with your CD/CI-Pipeline`s build-management tools,
  27. the maintenance of data and test sequence can be done without ANY other tools (except Excel or OpenOffice) easily by the
  28. people who know best what to test: Your business department.
  29. Hey, why not do everything in Excel?
  30. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  31. There is one serious drawback from this flexibility: it's **change**. Of course you started with 1 sheet, but later had some additional
  32. requirements and simply added a second sheet to cover those without changing the definitions of the first excel sheet.
  33. You're still happy as you need both behaviours tested (imagine one test set for regional customers and another test set
  34. for customers from other countries). Great. Everything works.
  35. After having some serious problems in production and fixing
  36. those defects, you decide to write a testcase to mimic a certain user behavior (e.g. navigating back and forth multiple
  37. times, deleting and re-adding objects from a shopping cart, etc.). The basic test sequence would still be the same as in
  38. the other two cases, but for a specific card you'll need changes. Simple. You copy one of the original sheets and adjust
  39. accordingly. You immediately sleep better because now also those cases are part of your growing regression test set. Wonderful.
  40. You continue like this for 2 months, end up with 2 or 3 datafiles and 20 test case definitions. That's not uncommon. What is also
  41. not uncommon is "**Change**". For more direct communication with the endusers the AUT (Application under test) get's enriched
  42. with a Sentry-Popup. Wonderful idea. But wait... It's not so great after all, because now you have to update 20 test case
  43. definitions with a way to deal with the new popup. Imagine corporate environments where we have many thousands or many tens of
  44. thousands tests.
  45. Subclassing for multiply used functionality
  46. -------------------------------------------
  47. The existing classes ``baangt.TestCase.TestCaseMaster`` and ``baangt.TestStep.TestStepMaster`` can easily be subclassed
  48. and enriched with static functionality - even when you use the Excel version of ``baangt.py``. Yes, you'll need to know
  49. some basics of powerful Python Language and most probably an IDE.
  50. An example could look as simple like this:
  51. ::
  52. from baangt.TestStep import TestStepMaster
  53. class myTestStep(TestStepMaster):
  54. def execute():
  55. self.driver.goToURL("http://www.google.com")
  56. self.driver.findByAndSetText(xpath='//input[@type="text"]', value='baangt')
  57. self.driver.findByAndClick(xpath='(//input[contains(@type,'submit')])[3]')
  58. That's it. All the rest is taken care of by ``baangt``. You'll also receive a nice export file showing timing information
  59. for your TestCase.
  60. You can subclass any other functionality, that doesn't fully fit your needs (IBAN-Generation, Browser-Handling, Timing)
  61. and also create your own Assertion-classes (for instance if you need to receive data from a Host-System or
  62. RFC/SOAP-Connection or any other source that is not natively supported by ``baangt.py``). Of course you'd only
  63. re-implement methods that you need to enrich, and consume everything else from the framework.
  64. Please consider creating pull-requests if you think some of your custom implemented functionality could be useful for
  65. others.
  66. ``BaangtDB`` for flexible, powerful enterprise grade test automation
  67. --------------------------------------------------------------------
  68. Enter the next stage: ``baangtDB``. ``baangtDB`` does much more than just replace Excel as input and sequence source. BaangtDB
  69. provides modularization of your test cases. In the above example you'd maintain the Sentry-Popup exactly ONCE for all your
  70. test cases, where it applies.
  71. If you're in a really large corporate environment, you'll start facing problems with the XLS-Based solution, as corporate
  72. governance, compliance, regulations and so on will sooner or later make it difficult to use the software in this way.
  73. Even if you use ``git`` you experience problems with different versions of the Excel-Sheets - depending on your setup of course.
  74. But still no need invest into expensive, licensed, closed source, proprietary solutions and depend on their good will.
  75. Run ``baangtDB`` (for testdata and testcase sequences) in a docker container, on premises or in the cloud and have the full
  76. flexibility plus comfort for free.
  77. To sum it up
  78. ------------
  79. There are multiple ways to use the open source testing framework ``baangt``. Each with it's up- and downsides.
  80. .. list-table:: Possibilities to use ``baangt``
  81. :widths: 100
  82. * - **XLSX-Simple format**
  83. * - to get you started the single Excel-Sheet holds test sequence and data. Fully functional, full reporting on test execution.
  84. * - **XLSX-full format**
  85. * - XLSX format: more comples test run, test sequence, test case, test steps as part of testcase definition file. Separate data file.
  86. * - **baangtDB**
  87. * - Complexity of XLSX-Format, but simpler maintenance in corporate environments. More and better ways to structure and reuse testcase sequences.
  88. * - **Cloud**
  89. * - Same as database
  90. * - **Hosted**
  91. * - Same as database