cells-cli-functional-tests
Functional tests for cells-cli
Last updated 3 years ago by cells-developers .
Repository · Original npm · Tarball · package.json
$ cnpm install cells-cli-functional-tests -g
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.2-beta.0                                ...           beta (3 years ago)
  • 1.1.2                                ...           latest (3 years ago)

2 Versions

  • 1.1.2                                ...           3 years ago
  • 1.1.2-beta.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 1
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |