aboutsummaryrefslogtreecommitdiffstats
path: root/docs/config/processors/protractor-generate.js
diff options
context:
space:
mode:
authorJulie2014-02-19 21:01:54 -0800
committerJulie2014-02-21 16:57:04 -0800
commit39c82f3fb7a8459304d5e07dc87bd0623ad1efd0 (patch)
treecff2cb48fa3199d40ab292cca9ddf5ee4ef5505e /docs/config/processors/protractor-generate.js
parent1293cc88cd3d2e72c55fa8b8d268fab246e79fed (diff)
downloadangular.js-39c82f3fb7a8459304d5e07dc87bd0623ad1efd0.tar.bz2
chore(travis): reorganize protractor configs to group by spec instead of by browser
Use the multiConfiguration ability of Protractor to start tests on multiple browsers from the same travis cell. Group tests by type (jquery, jqlite, or docs tests) instead of by browser. Turn on tests for jQuery.
Diffstat (limited to 'docs/config/processors/protractor-generate.js')
-rw-r--r--docs/config/processors/protractor-generate.js39
1 files changed, 23 insertions, 16 deletions
diff --git a/docs/config/processors/protractor-generate.js b/docs/config/processors/protractor-generate.js
index 39c79212..100202b4 100644
--- a/docs/config/processors/protractor-generate.js
+++ b/docs/config/processors/protractor-generate.js
@@ -5,6 +5,26 @@ var trimIndentation = require('dgeni/lib/utils/trim-indentation');
var code = require('dgeni/lib/utils/code');
var protractorFolder;
+function createProtractorDoc(example, file, env) {
+ var protractorDoc = {
+ docType: 'e2e-test',
+ id: 'protractorTest' + '-' + example.id,
+ template: 'protractorTests.template.js',
+ outputPath: path.join(protractorFolder, example.id, env + '_test.js'),
+ innerTest: file.fileContents,
+ pathPrefix: '.', // Hold for if we test with full jQuery
+ exampleId: example.id,
+ description: example.doc.id
+ };
+
+ if (env === 'jquery') {
+ protractorDoc.examplePath = example.outputFolder + '/index-jquery.html'
+ } else {
+ protractorDoc.examplePath = example.outputFolder + '/index.html'
+ }
+ return protractorDoc;
+}
+
module.exports = {
name: 'protractor-generate',
description: 'Generate a protractor test file from the e2e tests in the examples',
@@ -23,22 +43,9 @@ module.exports = {
return;
}
- // Create a new file for the test.
- // TODO - at the moment, only jqLite is being used. Will need to generate
- // another doc for jQuery if we want to test against that.
- var protractorDoc = {
- docType: 'e2e-test',
- id: 'protractorTest' + '-' + example.id,
- template: 'protractorTests.template.js',
- outputPath: path.join(protractorFolder, example.id, 'jqlite' + '_test.js'),
- innerTest: file.fileContents,
- pathPrefix: '.', // Hold for if we test with full jQuery
- exampleId: example.id,
- description: example.doc.id,
- examplePath: example.outputFolder + '/index.html'
- };
-
- docs.push(protractorDoc);
+ // Create new files for the tests.
+ docs.push(createProtractorDoc(example, file, 'jquery'));
+ docs.push(createProtractorDoc(example, file, 'jqlite'));
});
});
}