1.1.2 • Published 8 years ago

cells-cli-functional-tests v1.1.2

Weekly downloads
6
License
-
Repository
-
Last release
8 years ago

Functional testing for cells-cli

This module tests cells-cli with happy path of all possible commands of the recipe. These commands are defined on piscosour.json of cells-cli:

  "commands": [
    "environment:setup",
    "app:create",
    "app:clean",
    "app:validate",
    "app:build",
    "app:serve",
    "app:check-mocks",
    "component:create",
    "component:serve",
    "component:validate",
    "component::lint",
    "component::unit-testing",
    "component::structural-testing",
    "cordova-app:restore",
    "cordova-app:save",
    "cordova-plugin:create",
    "iconset:build",
    "workspace:create",
    "workspace:kpis"
  ],

Tests are separated by contexts so we have six files with all test for every cells-cli contexts

  • app-test.js
  • component-test.js
  • cordova-app-test.js
  • environment-test.js
  • iconset-test.js
  • workspace-test.js

App context

In the apps-test.js file we have several variables to configure in order to execute all the tests that we like.

  • flows2Test: function that returns an array with the configuration of all the flows that you want to check. Example:
const flows2Test = () => {
  return [
    {
      name: 'create',
      exec: create,
      timeout: 6000
    }, {
      name: 'clean',
      exec: clean,
      timeout: 6000
    }, {
      name: 'build',
      exec: build,
      timeout: 60000
    }, {
      name: 'validate',
      exec: validate,
      timeout: 120000
    }
  ];
};
In this case we have configured the flows `create`, `clean`, `build` and `validate`.
  • testApps: array with the config of the apps to test. Example:
const testApps = [
  {
    scaffold: 'scaffold',
    name: 'complete-app',
    type: 'novulcanize',
    config: 'local'
  },
  {
    scaffold: 'scaffold_blank',
    name: 'blank-app',
    type: 'novulcanize',
    config: 'env'
  }
];

Component context

In the component-test.js file we have several variables to configure in order to execute all the tests that we like.

  • flows2Test: function that returns an array with the configuration of all the flows that you want to check. Example:
const flows2Test = () => {
  return [
    {
      name: 'create',
      exec: create,
      timeout: 6000
    }, {
      name: 'validate',
      exec: validate,
      timeout: 60000
    }, {
      name: 'lint',
      exec: lint,
      timeout: 60000
    }, {
      name: 'structuralTesting',
      exec: structuralTesting,
      timeout: 60000
    }, {
      name: 'unitTesting',
      exec: unitTesting,
      timeout: 60000
    }
  ];
};
In this case we have configured the flows `create`, `validate`, `lint`, `structuralTesting` and `unitTesting`.
  • testComponents: array with the config of the components to test. Example:
const testComponents = [
  {
    name: 'test-iu-component',
    type: 'ui-component',
    i18n: true,
    useTheme: true,
    themeName: 'cells-theme-base',
    useIcons: true,
    iconsName: 'cells-icons'
  },
  {
    name: 'test-dp-component',
    type: 'dp-component'
  },
  {
    name: 'test-dm-component',
    type: 'dm-component'
  }
];

Cordova-app context

In the cordova-app-test.js we have the two flows included in cells-cli:

  • cordova-app:save
  • cordova-app:restore

We are downloading in a temporal folder the cells-app-demo.apppack

Environment context

Iconset context

Workspace context