Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 2.99 KB

README.md

File metadata and controls

65 lines (49 loc) · 2.99 KB

✨ CLI functional tests

This is the test suite for the functional tests for the Liferay Cloud Platform CLI. The functional testing suite is written with TCL and uses the expect toolkit.

Dependencies

  • Expect/Tcl
  • TclCurl package
    1. Install ActiveTcl
    2. Clone tclcurl-fa and follow instructions to make and install
    3. Copy tclcurl.tcl from tclcurl-fa/generic to tclcurl-fa
    4. Place entire tclcurl-fa folder in $auto_path (e.g. /Users/henvic/Library/Tcl/tclcurl-fa). Check $auto_path by typing in the terminal:
      tclsh
      % puts $auto_path
    5. Confirm installation:
      tclsh
      % package require TclCurl
      7.22.0

In addition, if you are running the infrastructure locally, Docker and some assembly is required.

Running tests

Copy the settings-sample.tcl to settings.tcl and configure it accordingly. You will need to set your username and password.

You can run the tests with make functional-tests.

Test results

Reports of all scenarios that were run at the latest test are saved in the tests/results/report.txt file.

Results are also compiled in JUnit XML format in tests/results/TEST-report.xml.

To view test reports on Jenkins CI open the cli-functional-tests Jenkins pipeline.

From there you can select a test run. For JUnit reports, click "Tests" in the top nav bar. For reports.txt, click "Artifacts" in the top nav bar, then select "functional/results/report.txt".

Contributing

The tests are organized into Features and Scenarios. A Feature is a test suite, which corresponds to a file in the functional/tests folder. A Feature may contain one or more Scenarios. Each Scenario is a test case.

Each test file should begin with

Feature: {feature name}

One or more scenarios follow with this structure:

Scenario: {scenario name} {
    setup steps
    test step 1
    test step 2
    ...
} { teardown steps }

Each scenario begins with setup steps. The test steps are a series of send and expect commands. In other words, send something to the command line, then expect something in the terminal output. The last {} block contains the teardown steps. It may be omitted if there is no teardown. Please see any of the test files for examples.

You can also use autoexpect to help you creating tests.

References