From 39c82f3fb7a8459304d5e07dc87bd0623ad1efd0 Mon Sep 17 00:00:00 2001 From: Julie Date: Wed, 19 Feb 2014 21:01:54 -0800 Subject: 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. --- docs/config/processors/protractor-generate.js | 39 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'docs/config/processors/protractor-generate.js') 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')); }); }); } -- cgit v1.2.3