Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Results of the testing investigation issued by 

Jira Legacy
serverSystem Jira
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyFOLIO-1397
:

...

The great examples of BigTests usage are two repos:

  • stripes-components (used to write unit tests for UI components) - to run test use yarn test command
  • ui-myprofile (used to write unit tests for UI components) - to run test use yarn test command
  • ui-eholdings (used to write e2e tests) - to run test use yarn test command

...

To run tests use yarn test command in the terminal in the project root folder. This command refers to the npm script in the package.json.

"test": "stripes test karma"

This command would produce the following output in the terminal:

...

To run tests with coverage change the command to look like below:

"test": "stripes test karma --coverage"

This would produce the additional output to the previous command in the terminal:

...

One of the main concepts of the BigTest is interactors. They are like wrappers of the components which allows to get information about component UI state (attribute, text, class). There are many helper methods to get information from the component which is stored in @bigtest/interactor package. For example in the code snippet below the attribute, is, hasClass are used to get information about UI state of the component. Particular interactor could contain as mach as needed of such helper fields. List of all interactors could found here. The source code is well documented with examples.


Code Block
languagejs
themeEclipse
titlesample-interactor
linenumberstrue
import {
 interactor,
 is,
 attribute,
 hasClass
} from '@bigtest/interactor';

import css from '../Button.css';

export default interactor(class ButtonInteractor {
 static defaultScope = `.${css.button}`;
 id = attribute('id');
 href = attribute('href');
 isAnchor = is('a');
 isButton = is('button');
 rendersDefault = hasClass(css.default);
 rendersPrimary = hasClass(css.primary);
 rendersBottomMargin0 = hasClass(css.marginBottom0)
});

...