Skip to content

Externalization of input PCMs for testing  #1

@acherm

Description

@acherm

The goal is to have a testing procedure that loads a PCM and controls that some operations/services are working well.

What is expected is that some PCMs pose some difficulties (e.g., no "product column") and numerous bugs in opencompare are indeed related to JS issues.

I've tried to use Karma and it works pretty well.

I've used openCompareEditorApp (and not openCompareEditor directly) to load a PCM.
We can then write some assertions.

What I don't like at the moment is that the PCM is hardcoded within openCompareEditorApp.
If we want to change it you have to copy and paster 1000 lines.
It's also weird to read.

Ideally the input test PCM should be externalized somewhere (in a local JSON file)

I've made some attempts:

  • specifying a JSON local file (see eg foopcm1.json), and then use $http angular for loading the PCM... it almost works but the asynchronous fetching code raises some issues. Basically the editor is loaded in the first place whereas the data is still not loaded
  • playing a bit with the openCompareServer service. It does work (you have to launch an opencompare Website with Play! first) but the solution is a little bit "fragile" (PCM ids may disappear for some reasons) and hard to deploy (you need an opencompare server).

Ideally the openCompareServer service should work with "local" PCM files (without a server)

Some additional notes:

  • Chrome can be used in addition to PhantomJS
  • Chrome can provide more detailed debugging messages
  • I deactivated Chrome (comment the line in karma.conf.js) because Travis then doesn't work (we need to specify the bin folder of Chrome, it seems a bit complicated at the moment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions