Ignore:
Timestamp:
2024-05-13T22:17:12+12:00 (5 weeks ago)
Author:
anupama
Message:
  1. I need to be able to startup GLI and exit it for any given GLI GUI test, e.g. some tutorials should be able to startup GLI fresh or quit GLI and do something and reopen it. However, GLI > File > exit calls System.exit() which has the effect of exiting the outer JUnit tests too. And I first tried in different ways to solve this on the JUnit side with security managers and everything and it wasn't working. The solution was to fix up GLI's GUIManager and Gatherer: GUIManager on TestingPreparation.TEST_MODE being true, will set the GGLI frame to DISPOSE_ON_CLOSE (which is everything but System.exit) and Gatherer.exit() will not call System.exit() if TestingPreparation.TEST_MODE is true. This seems to have at last allowed me to call exitGLI just fine in the testing code. I'm not yet committing the GLI source code changes as both GUIManager and Gatherer have other (Event Dispatch Thread) related changes that I still have to run by Dr Bainbridge or Kathy at least, before I can feel confident I haven't caused problems in GLI. 2. The RunGLITest.java file has the links to the main reading I did in the comments section at the start of the file. So the README now refers to that.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/testing/trunk/README_2024

    r39017 r39018  
    1 ---------------------------
    2 Notes written 2024:
    3 ---------------------------
    4 I'm not sure what I read on junits, assertj swing and (if anything) on selenium to start off the automated gli testing work back in 2018, but here's what I can gather from current code.
     1-------------------------------------------------------------
     2README Notes written 2024
     3(AssertJ Swing GLI GUI testing groundwork laid in 2018-2019)
     4-------------------------------------------------------------
    55
    6 But the following may be useful websites
     6Sections
     7I Code Layout
     8II Background Reading
     9III Compiling and Running
     10
     11
     12-------------------
     13CODE LAYOUT
     14-------------------
     15- ext/testing/src/src/org/greenstone/gsdl3/testing/GSGUIUtil.java (Selenium, browser testing helper functions, needs revisiting in 2024)
     16- ext/testing/src/src/org/greenstone/gsdl3/testing/GSGUITestingUtil.java (AssertJ Swing, GUI testing helper functions)
     17- ext/testing/src/src/gstests/tutorials/RunGLITest.java (tests, rudimentary stage of testing the basic GUI helper functions above)
     18
     19
     20-------------------
     21BACKGROUND READING
     22-------------------
     23See the comments section at the top of ext/testing/src/src/gstests/tutorials/RunGLITest.java
     24It lists the URLs and reading that I went through pertaining to junits, assertj swing and (if anything) on selenium to start off the automated gli testing work back in 2018.
     25
     26I can further gather the following from the current code.
     27
     28The following may be useful websites
    729- interspersed throughout our code that uses assert swing, I find I'd added references to this website: https://joel-costigliola.github.io/assertj/assertj-swing-basics.html
    830
     
    1234- there's also the older wiki page by Sam that has his own work (not yet incorporated): https://wiki.greenstone.org/doku.php?id=internal:gs3_automated_testing
    1335
    14 
     36----------------------
     37COMPILING AND RUNNING
     38----------------------
    15390. Have a fresh GS3, preferrably a code checkout from SVN so that you can tweak the code on any errors.
    1640
Note: See TracChangeset for help on using the changeset viewer.