Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 1e889c8

Browse files
committed
chore(test): add protractor4
1 parent b16b058 commit 1e889c8

File tree

99 files changed

+4459
-12780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+4459
-12780
lines changed

gulpfile.js

+12-37
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var TEMP_PATH = './_temp';
3737
var DOCS_PATH = path.join(PUBLIC_PATH, 'docs');
3838

3939
var EXAMPLES_PATH = path.join(DOCS_PATH, '_examples');
40-
var EXAMPLES_PROTRACTOR_PATH = path.join(EXAMPLES_PATH, '_protractor');
40+
var BOILERPLATE_PATH = path.join(EXAMPLES_PATH, '_boilerplate');
4141
var NOT_API_DOCS_GLOB = path.join(PUBLIC_PATH, './{docs/*/latest/!(api),!(docs)}/**/*.*');
4242
var RESOURCES_PATH = path.join(PUBLIC_PATH, 'resources');
4343
var LIVE_EXAMPLES_PATH = path.join(RESOURCES_PATH, 'live-examples');
@@ -89,25 +89,18 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
8989
});
9090

9191
var _exampleBoilerplateFiles = [
92-
'.editorconfig',
9392
'a2docs.css',
9493
'karma.conf.js',
9594
'karma-test-shim.js',
9695
'package.json',
9796
'styles.css',
9897
'systemjs.config.js',
9998
'tsconfig.json',
100-
'tslint.json',
101-
'typings.json',
10299
'wallaby.js'
103100
];
104101

105102
var _exampleDartWebBoilerPlateFiles = ['a2docs.css', 'styles.css'];
106103

107-
var _exampleProtractorBoilerplateFiles = [
108-
'tsconfig.json'
109-
];
110-
111104
var _exampleConfigFilename = 'example-config.json';
112105

113106
var _styleLessName = 'a2docs.less';
@@ -200,18 +193,13 @@ function runE2e() {
200193
});
201194
*/
202195
// Not 'fast'; do full setup
203-
gutil.log('runE2e: install _protractor stuff');
204-
var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PROTRACTOR_PATH});
196+
gutil.log('runE2e: install _examples stuff');
197+
var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH});
205198
promise = spawnInfo.promise
206-
.then(function() {
207-
gutil.log('runE2e: install _examples stuff');
208-
spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH})
209-
return spawnInfo.promise;
210-
})
211199
.then(function() {
212200
buildStyles(copyExampleBoilerplate, _.noop);
213201
gutil.log('runE2e: update webdriver');
214-
spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PROTRACTOR_PATH});
202+
spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PATH});
215203
return spawnInfo.promise;
216204
});
217205
};
@@ -246,11 +234,10 @@ function findAndRunE2eTests(filter, outputFile) {
246234
fs.writeFileSync(outputFile, header);
247235

248236
// create an array of combos where each
249-
// combo consists of { examplePath: ... , protractorConfigFilename: ... }
237+
// combo consists of { examplePath: ... }
250238
var examplePaths = [];
251239
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
252240
e2eSpecPaths.forEach(function(specPath) {
253-
var destConfig = path.join(specPath, 'protractor.config.js');
254241
// get all of the examples under each dir where a pcFilename is found
255242
localExamplePaths = getExamplePaths(specPath, true);
256243
// Filter by language
@@ -319,7 +306,7 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
319306
// start protractor
320307

321308
var spawnInfo = spawnExt('npm', [ 'run', 'protractor', '--', 'protractor.config.js',
322-
`--specs=${specFilename}`, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: EXAMPLES_PROTRACTOR_PATH });
309+
`--specs=${specFilename}`, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: EXAMPLES_PATH });
323310

324311
spawnInfo.proc.stderr.on('data', function (data) {
325312
transpileError = transpileError || /npm ERR! Exit status 100/.test(data.toString());
@@ -481,12 +468,12 @@ function buildStyles(cb, done){
481468
function copyExampleBoilerplate() {
482469
gutil.log('Copying example boilerplate files');
483470
var sourceFiles = _exampleBoilerplateFiles.map(function(fn) {
484-
return path.join(EXAMPLES_PATH, fn);
471+
return path.join(BOILERPLATE_PATH, fn);
485472
});
486473
var examplePaths = excludeDartPaths(getExamplePaths(EXAMPLES_PATH));
487474

488475
var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles.map(function(fn){
489-
return path.join(EXAMPLES_PATH, fn);
476+
return path.join(BOILERPLATE_PATH, fn);
490477
});
491478
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);
492479

@@ -495,14 +482,6 @@ function copyExampleBoilerplate() {
495482
return copyFiles(sourceFiles, examplePaths, destFileMode)
496483
.then(function() {
497484
return copyFiles(dartWebSourceFiles, dartExampleWebPaths, destFileMode);
498-
})
499-
// copy certain files from _examples/_protractor dir to each subdir that contains an e2e-spec file.
500-
.then(function() {
501-
var protractorSourceFiles =
502-
_exampleProtractorBoilerplateFiles
503-
.map(function(name) {return path.join(EXAMPLES_PROTRACTOR_PATH, name);});;
504-
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
505-
return copyFiles(protractorSourceFiles, e2eSpecPaths, destFileMode);
506485
});
507486
}
508487

@@ -581,11 +560,6 @@ function deleteExampleBoilerPlate() {
581560
return deleteFiles(_exampleBoilerplateFiles, examplePaths)
582561
.then(function() {
583562
return deleteFiles(_exampleDartWebBoilerPlateFiles, dartExampleWebPaths);
584-
})
585-
.then(function() {
586-
var protractorFiles = _exampleProtractorBoilerplateFiles;
587-
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
588-
return deleteFiles(protractorFiles, e2eSpecPaths);
589563
});
590564
}
591565

@@ -805,7 +779,7 @@ gulp.task('_harp-compile', function() {
805779

806780
gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() {
807781
// Split big shredding task into partials 2016-06-14
808-
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/', '_protractor/']});
782+
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/']});
809783
var promise = Promise.resolve(true);
810784
examplePaths.forEach(function (examplePath) {
811785
promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath));
@@ -864,7 +838,6 @@ gulp.task('lint', function() {
864838
'!./public/docs/_examples/**/ts-snippets/*.ts',
865839
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts',
866840
'!./public/docs/_examples/**/node_modules/**/*',
867-
'!./public/docs/_examples/_protractor/**/*',
868841
'!./public/docs/_examples/**/typings/**/*',
869842
'!./public/docs/_examples/**/typings-ng1/**/*',
870843
'!./public/docs/_examples/**/build/**/*',
@@ -1107,7 +1080,7 @@ function getTypingsPaths(basePath) {
11071080

11081081
function getExamplePaths(basePath, includeBase) {
11091082
// includeBase defaults to false
1110-
return getPaths(basePath, _exampleConfigFilename, includeBase)
1083+
return getPaths(basePath, _exampleConfigFilename, includeBase);
11111084
}
11121085

11131086
function getDartExampleWebPaths(basePath) {
@@ -1130,6 +1103,8 @@ function getFilenames(basePath, filename, includeBase) {
11301103
// ignore (skip) the top level version.
11311104
includePatterns.push("!" + path.join(basePath, "/" + filename));
11321105
}
1106+
// ignore (skip) the files in BOILERPLATE_PATH.
1107+
includePatterns.push("!" + path.join(BOILERPLATE_PATH, "/" + filename));
11331108
var nmPattern = path.join(basePath, "**/node_modules/**");
11341109
var filenames = globby.sync(includePatterns, {ignore: [nmPattern]});
11351110
return filenames;

public/docs/_examples/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ tslint.json
1010
typings.json
1111
wallaby.js
1212

13-
protractor.config.js
1413
_test-output
1514
**/ts/**/*.js
1615
**/ts-snippets/**/*.js
1716
*.d.ts
1817

1918
!**/*e2e-spec.js
2019
!systemjs.config.1.js
20+
!_boilerplate/*

0 commit comments

Comments
 (0)