### Compatibility backwards for all the apps

Repo with the functional tests for back compatibility in all the apps of BBVA.

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

* `flowsToTest`: function that returns an array with the configuration of all the flows that you want to check. Example:
    
    ```javascript
    const flowsToTest = () => {
      return [
        {
          name: 'clean',
          exec: clean,
          timeout: 500000
        }, {
          name: 'build',
          exec: build,
          timeout: 500000
        }, {
          name: 'validate',
          exec: validate,
          timeout: 500000
        }
      ];
    };
    ```
    
    In this case we have configured the flows `clean`, `build` and `validate`.

    
* `testApps`: array with the config of the apps to test. Example:
    
    ```javascript
    const testApps = [
      {
        name: 'MyBusiness.es',
        type: 'novulcanize',
        config: 'config-dev',
        platforms: 'webapp'
      },
      {
        name: 'glomo-bridge.gb',
        type: 'novulcanize',
        config: 'global/artichoke',
        platforms: 'webapp'
      }
    ];
    ```

    
* `setPisco`: function that set the `bin/pisco.js`
    
    ```javascript
    const setPisco = () => {
      if (!process.env.piscoExec) {
        process.env.piscoExec = 'node /Users/albertoeyocastro-rial/sngular/wk-cells/cells-workspace/tools/cells-cli/bin/pisco.js';
      }
    };
    ```
    
    We have to remember that wen this module is executed from the [outside][1], the value of this variable will be the piscosour executable of the recipe to be tested.
    
#### Testing the apps

If we like to test the apps configured in the previous section, we launch simply `npm test`
  
   
#### Including new apps to test the compability
   
Include new apps to test is very simple. First of all we have to include in the dev-dependencies this new app. In order to do so we execute:
  
`npm i --save-dev git+${routeToApp}`

Example:

`npm i --save git+ssh://git@globaldevtools.bbva.com:7999/bbvacellsapp/enginevents.git`

In the `testApps` object, we include the configuration of this app:

```javascript
const testApps = [
  {
    name: 'MyBusiness.es',
    type: 'novulcanize',
    config: 'config-dev',
    platforms: 'webapp'
  },
  {
    name: 'glomo-bridge.gb',
    type: 'novulcanize',
    config: 'global/artichoke',
    platforms: 'webapp'
  },
  {
    name: 'enginevents',
    type: 'vulcanize',
    config: 'dev',
    platforms: 'webapp'
  }
];
```

Now we can see the results of this new app too:

![Results with the new app](docs/images/EjecucionConNuevaApp.png)

   
[1]: https://github.com/cellsjs/piscosour/blob/master/docs/developers/guides/16-testing.md#functionalTesting