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

Commit f2a18d0

Browse files
committed
chore(test): add protractor4
1 parent 7c262cc commit f2a18d0

File tree

100 files changed

+4722
-12830
lines changed

Some content is hidden

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

100 files changed

+4722
-12830
lines changed

gulpfile.js

+13-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 EXAMPLES_TESTING_PATH = path.join(EXAMPLES_PATH, 'testing/ts');
4242
var NOT_API_DOCS_GLOB = path.join(PUBLIC_PATH, './{docs/*/latest/!(api),!(docs)}/**/*.*');
4343
var RESOURCES_PATH = path.join(PUBLIC_PATH, 'resources');
@@ -92,22 +92,16 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
9292
});
9393

9494
var _exampleBoilerplateFiles = [
95-
'.editorconfig',
9695
'a2docs.css',
9796
'package.json',
9897
'styles.css',
9998
'systemjs.config.js',
10099
'tsconfig.json',
101-
'tslint.json',
102-
'typings.json'
100+
'tslint.json'
103101
];
104102

105103
var _exampleDartWebBoilerPlateFiles = ['a2docs.css', 'styles.css'];
106104

107-
var _exampleProtractorBoilerplateFiles = [
108-
'tsconfig.json'
109-
];
110-
111105
var _exampleUnitTestingBoilerplateFiles = [
112106
'karma-test-shim.js',
113107
'karma.conf.js'
@@ -205,18 +199,13 @@ function runE2e() {
205199
});
206200
*/
207201
// Not 'fast'; do full setup
208-
gutil.log('runE2e: install _protractor stuff');
209-
var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PROTRACTOR_PATH});
202+
gutil.log('runE2e: install _examples stuff');
203+
var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH});
210204
promise = spawnInfo.promise
211-
.then(function() {
212-
gutil.log('runE2e: install _examples stuff');
213-
spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH})
214-
return spawnInfo.promise;
215-
})
216205
.then(function() {
217206
buildStyles(copyExampleBoilerplate, _.noop);
218207
gutil.log('runE2e: update webdriver');
219-
spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PROTRACTOR_PATH});
208+
spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PATH});
220209
return spawnInfo.promise;
221210
});
222211
};
@@ -251,11 +240,10 @@ function findAndRunE2eTests(filter, outputFile) {
251240
fs.writeFileSync(outputFile, header);
252241

253242
// create an array of combos where each
254-
// combo consists of { examplePath: ... , protractorConfigFilename: ... }
243+
// combo consists of { examplePath: ... }
255244
var examplePaths = [];
256245
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
257246
e2eSpecPaths.forEach(function(specPath) {
258-
var destConfig = path.join(specPath, 'protractor.config.js');
259247
// get all of the examples under each dir where a pcFilename is found
260248
localExamplePaths = getExamplePaths(specPath, true);
261249
// Filter by language
@@ -326,7 +314,7 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
326314
// start protractor
327315

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

331319
spawnInfo.proc.stderr.on('data', function (data) {
332320
transpileError = transpileError || /npm ERR! Exit status 100/.test(data.toString());
@@ -488,12 +476,12 @@ function buildStyles(cb, done){
488476
function copyExampleBoilerplate() {
489477
gutil.log('Copying example boilerplate files');
490478
var sourceFiles = _exampleBoilerplateFiles.map(function(fn) {
491-
return path.join(EXAMPLES_PATH, fn);
479+
return path.join(BOILERPLATE_PATH, fn);
492480
});
493481
var examplePaths = excludeDartPaths(getExamplePaths(EXAMPLES_PATH));
494482

495483
var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles.map(function(fn){
496-
return path.join(EXAMPLES_PATH, fn);
484+
return path.join(BOILERPLATE_PATH, fn);
497485
});
498486
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);
499487

@@ -503,14 +491,6 @@ function copyExampleBoilerplate() {
503491
.then(function() {
504492
return copyFiles(dartWebSourceFiles, dartExampleWebPaths, destFileMode);
505493
})
506-
// copy certain files from _examples/_protractor dir to each subdir that contains an e2e-spec file.
507-
.then(function() {
508-
var protractorSourceFiles =
509-
_exampleProtractorBoilerplateFiles
510-
.map(function(name) {return path.join(EXAMPLES_PROTRACTOR_PATH, name); });
511-
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
512-
return copyFiles(protractorSourceFiles, e2eSpecPaths, destFileMode);
513-
})
514494
// copy the unit test boilerplate
515495
.then(function() {
516496
var unittestSourceFiles =
@@ -596,11 +576,6 @@ function deleteExampleBoilerPlate() {
596576
return deleteFiles(_exampleBoilerplateFiles, examplePaths)
597577
.then(function() {
598578
return deleteFiles(_exampleDartWebBoilerPlateFiles, dartExampleWebPaths);
599-
})
600-
.then(function() {
601-
var protractorFiles = _exampleProtractorBoilerplateFiles;
602-
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
603-
return deleteFiles(protractorFiles, e2eSpecPaths);
604579
});
605580
}
606581

@@ -820,7 +795,7 @@ gulp.task('_harp-compile', function() {
820795

821796
gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() {
822797
// Split big shredding task into partials 2016-06-14
823-
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/', '_protractor/']});
798+
var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/']});
824799
var promise = Promise.resolve(true);
825800
examplePaths.forEach(function (examplePath) {
826801
promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath));
@@ -879,7 +854,6 @@ gulp.task('lint', function() {
879854
'!./public/docs/_examples/**/ts-snippets/*.ts',
880855
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts',
881856
'!./public/docs/_examples/**/node_modules/**/*',
882-
'!./public/docs/_examples/_protractor/**/*',
883857
'!./public/docs/_examples/**/typings/**/*',
884858
'!./public/docs/_examples/**/typings-ng1/**/*',
885859
'!./public/docs/_examples/**/build/**/*',
@@ -1152,7 +1126,7 @@ function getTypingsPaths(basePath) {
11521126

11531127
function getExamplePaths(basePath, includeBase) {
11541128
// includeBase defaults to false
1155-
return getPaths(basePath, _exampleConfigFilename, includeBase)
1129+
return getPaths(basePath, _exampleConfigFilename, includeBase);
11561130
}
11571131

11581132
function getDartExampleWebPaths(basePath) {
@@ -1183,6 +1157,8 @@ function getFilenames(basePath, filename, includeBase) {
11831157
// ignore (skip) the top level version.
11841158
includePatterns.push("!" + path.join(basePath, "/" + filename));
11851159
}
1160+
// ignore (skip) the files in BOILERPLATE_PATH.
1161+
includePatterns.push("!" + path.join(BOILERPLATE_PATH, "/" + filename));
11861162
var nmPattern = path.join(basePath, "**/node_modules/**");
11871163
var filenames = globby.sync(includePatterns, {ignore: [nmPattern]});
11881164
return filenames;

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"q": "^1.4.1",
7272
"tree-kill": "^1.0.0",
7373
"tslint": "^3.15.1",
74+
"typescript": "^2.0.3",
7475
"yargs": "^4.7.1"
7576
},
7677
"dependencies": {

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)