You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
Karma is now working with external JSON files.
Commit f2ba761
Data located in the "test" folder of app. I would like to put it outside "app" but that's not so easy.
Another possible improvement is as follows: grunt serveworks if you uncomment $scope.launchOCEditor().
That's normal but if you uncomment this line, then the testing fails because it first calls $scope.launchOCEditor() with a specific JSON.
Overall I have impression we should develop and maintain another HTML/JS file for "showcase" (serve) and "test"
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:
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 loadedIdeally the openCompareServer service should work with "local" PCM files (without a server)
Some additional notes:
The text was updated successfully, but these errors were encountered: