Results 1 to 2 of 2

Thread: Command-line arguments for test cases?

  1. #1

    Default Answered: Command-line arguments for test cases?

    Hello,
    I was wondering if it is possible to run test cases with command-line arguments respective to JAVA applications and their String[ ] args parameter (https://docs.oracle.com/javase/tutor...dLineArgs.html)?

    The goal would be to store multiple test configurations in a database, reference the db_id via a command-line argument and then fetch neccessary data within the test.
    This would allow running the same test with different test values, that can be set in the DB, over and over again.

  2. I don't believe this is possible, as the command line arguments defined as part of the "stc run" command don't make their way down to the nested process that runs the tests. So if you were to reference the args in your test suite via "process.argv", your custom arguments wouldn't be included.

    Your best option is to probably write your desired config settings to a JSON file prior to the test run, and have your test suite read that JSON config file, either using a Node package for reading JSON files, or using "fs" to read the contents of the JSON file and convert to an object.

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    394
    Answers
    74

    Default

    I don't believe this is possible, as the command line arguments defined as part of the "stc run" command don't make their way down to the nested process that runs the tests. So if you were to reference the args in your test suite via "process.argv", your custom arguments wouldn't be included.

    Your best option is to probably write your desired config settings to a JSON file prior to the test run, and have your test suite read that JSON config file, either using a Node package for reading JSON files, or using "fs" to read the contents of the JSON file and convert to an object.
    Daniel Gallo
    Sales Engineer
    Sencha

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •