3.4.0 • Published 4 years ago

tc-cli-plus v3.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

TestCraft Test Runner

A TestCraft tc-cli wrapper for aggregating retryable test runs, writing importable data files, and executing TestCraft against localhost.


Overview

Important Things

  1. When running tests within TestCraft manually, if your test craft suite requires an importable data file there is functionality in place to dynamically write a file to disk. However, the command line logic to only write the file is not currently in place.

    A minor workaround is to simply run this with runTheRealTestCraft set to false (as it should be by default), and then use the file that the run produces in the data folder that gets created.

  2. Your platform name configured in TestCraft must be named in the following format

    • <OSName, BrowserName, BrowserVersion> e.g. Ubuntu, Chrome, Latest (with the exact comma space delimitation)
    • Add only one platform in TestCraft to this platform name (even though multiple can be set be through TestCraft only add one in the following format)
  3. Suites configured in TestCraft must only have one spec defined, and these specs must both log in and out after completion.

  4. To determine what your userAuthToken is please complete the following steps:

    • Login to TestCraft
    • Choose your project
    • Click on Suites (hamburger menu)
    • Click any suite (doesn't matter which one)
    • Click CI/CD
    • Reference your userAuthToken
  5. Localhost functionality is currently a work in progress.

back to top

Quick Start Usage

  1. Install by running npm install tc-cli-plus
  2. Usage
    • node ./index.js --userName <yourAppLoginUserName optional> --passWord <yourAppLoginPassWord optional> --userEmailAddress <you@yourdomain.com> --userAuthToken <yourTestCraftAuthToken> --projectName <yourTestCraftProjectName> --configurationJsonFilePath <yourConfigurationFilePath>
    • append -h, or --help to show the help menu.
    • enter empty values "" for username and password if you are not passing credentials in this way.
  3. Use the following default json file structure to define the test run configuration file.
          entireTestRun: {
          maxDurationMinutes:
            "max number of minutes allotted before the entire test run is marked as failed (retrying for any test is disabled after this point) [number]",
          maxConcurrentTestSuites:
            "max number of test suites configured to run at the same time (testcraft execution running statuses may vary) [number]",
          environmentName:
            "name of environment which corresponds with an actual testcraft environment name [string]",
          isScheduledTestRun:
            "determines if the test run was triggered manually or automatically as a scheduled task [boolean]",
          stopWhenAnyTestSuiteFails:
            "disables all retry functionality and gracefully exits the entire test run as quickly as possible [boolean]",
          disableRetryingWithAnyBindingIssue:
            "disables retry functionality for the test suite when any binding or element misidentification occurs [boolean]",
          testSuiteNameRegExp:
            "regular expression pattern to filter which test suites are ran [string]",
          runTheRealTestCraft:
            "by default testcraft execution is simulated by asynchronous fake process output (when set true the real tc-cli is called) [boolean]",
          notifiers: [
            {
              notifierName:
                "Microsoft Teams (microsoft teams is the only notifier implemented for now) [string]",
              enabled:
                "enables or disables sending notifications for this channel [boolean]",
              channels: [
                {
                  channelName: "the name of your microsoft teams channel",
                  reportFailuresOnly:
                    "notifications are only sent when entire test run fails",
                  connector:
                    "microsoft teams channel data connector url https://outlook.office.com/webhook/<...>/IncomingWebhook/<...> (please see readme for more info) [string]"
                }
              ]
            }
          ]
        },
        defaultTestSuiteProperties: {
          maxRetries:
            "overridable default max number of retries a failing test suite will be retried after it fails on the first attempt [number]",
          maxDurationMinutes:
            "overridable default max number of minutes allotted before the test is marked as failed (retrying for this test is disabled after this point) [number]",
          runThisTestSuiteOnly:
            "overridable default option that only runs the test(s) where this equals true [boolean]",
          skipThisTestSuite:
            "overridable default option that skips the test(s) where this equals true [boolean]",
          skipOtherTestSuites:
            "overridable default option that skips the other test(s) where this equals true [boolean]",
          retryingDisabled:
            "overridable default option that disables retrying for the test(s) where this equals true [boolean]",
          browser: {
            browserName: "name of browser",
            browserVersion: "browser semantic version or keyword 'Latest'",
            platformName: "name of operating system"
          }
        },
        data: {
          environment: {
            [`${
              "[key name of environment which corresponds with an actual testcraft environment name]"
                .white
            }`]: {
              hello: {
                world: {
                  key: "some_matching_key_for_a_testcraft_dynamic_variable",
                  val:
                    "value for this key (please see readme documentation for more info)"
                }
              }
            }
          }
        },
        testSuites: [
          {
            testSuiteName:
              "name of test suite which corresponds with an actual testcraft test suite name (defaultTestSuiteProperties may be overridden here for each test suite)"
          }
        ]
back to top

3.4.0

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.2.1

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

2.0.15

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago