Browser side Pluglet API tests
  1. Tests location.
  2. Tests struct.
  3. Pre-build requirements.
  4. Make instructions.
  5. Run API tests.
  6. Log files.
  7. Testcase description.
  1. Tests location:
    • This document concerned tests in directory src/org/mozilla/pluglet/test/basic/api
      at the your Pluglet tests location.
  2. Tests struct:
    Test may contains the next files:
    • Test java file - test execution and result verification code
    • Arguments iterator java - code for read lst file and transfer arguments to TestContext
    And test dir with:
    • TestProperties file - testcase properties, contains test, iterator and initial html file names
    • TestParameters file - user/location specific parameters for test arguments
    • ParamCombinations file - combinations of values for each argument.(for generate default lst file)
    • TestArguments(.lst) file - list of all combinations of arguments (generated from ParamCombinations file)
    • Misc HTML files - at least one html file with EMBED(or OBJECT) tag for instantiate pluglet and
      other html files needed for testcase.
    - Each test contains Test and Iterator java files, TestProperties file and at least one HTML file
    - TestParameters file exist only for tests with user/location specific parameters
    - ParamCombinations exist only for tests on methods with arguments
    - TestArguments(.lst) file created during make combinations from ParamCombinations file and
       only for tests on methods with arguments.
    index
  3. Pre-build requirements:
    • Build Mozilla and java plugins
    • Edit TEST_TOP_DIR/config/CommonProperties to change user/location specific parameters, e.g PLUGLET,HTML_ROOT etc ..
    • In each test dir edit TestParameters, if it exist(and you want to run this testcase)
    • Set environment variable HTML_ROOT_DIR to directory on your local filesystem, where test HTMLs will be created
    • Verify that MOZILLA_FIVE_HOME/dist/classes exist in your CLASSPATH
    • Place TEST_TOP_DIR/build/classes in your CLASSPATH
    • Performs make in top level directory basic and verify that TestLoaderPluglet.jar successfully created
      and placed to TEST_TOP_DIR/build/classes/org/mozilla/pluglet/test/basic
      PLUGLET property in CommonProperties should point to it.
    index
  4. Make instructions:
    Top level makefile in the api directory has next targets:
    • combinations - used for create BWTest.lst.ORIG for all api tests and generate default lst files for each test (if necessary) or just add test id to BWTest.lst.ORIG
    • tests - make all in test dirs:
      - copy HTML files to HTML_ROOT_DIR/api/test_case_name directory
      - replace user/location specific parameters(from CommonProperties) in TestProperties file
      - copy TestProperties file to BUILD/test/test_id directory
      - replace user-defined parameters in the default lst file and copy it to BUILD/test/test_id directory (if necessary)
    • test_pluglet - create jar with test classes
    • classes - compile all java files in the api directory
    • clobber - remove builded files:
      - remove HTML files from HTML_ROOT_DIR
      - remove TestProperties and .lst files from BUILD/test/test_id directory
    By default classes, tests and test_pluglet targets executed.
    NOTE:
    You need to do combinations only one time, and only if you change ParamCombinations file for some tests or add new test cases
    Build sequence(Win):
    • Performs all pre-build instructions.
    • In the api directory type nmake -f makefile.win
    index
  5. Run API tests.
    • Performs all pre-build and build instructions
    • For run all API tests copy TEST_TOP_DIR/build/test/basic/api/BWTest.lst.ORIG to the current directory and just type perl autorun.pl
    • For run selected API tests copy some test IDs from BWTest.lst.ORIG to your custom file(for example custom.lst) and type perl autorun.pl -f custom.lst
    index
  6. Log files:
    • After tests execution all logs located in the TEST_TOP_DIR/log directory
    • BWTestRun.log contains comments and results from test and test loader
    • BWTestRun.txt contains status for each test, e.g. PASSED or FAILED
    • File test_name.log contains Mozilla's output
index