-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protractor): add protractor rule
Copied over from angular/angular repo under packages/bazel
- Loading branch information
1 parent
8c14866
commit 35a344c
Showing
45 changed files
with
2,213 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ module.exports = { | |
'jasmine', | ||
'karma', | ||
'labs', | ||
'protractor', | ||
'rollup', | ||
'typescript', | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
{ | ||
"devDependencies": { | ||
"@bazel/hide-bazel-files": "file:../../dist/npm_bazel_hide-bazel-files", | ||
"@bazel/protractor": "file:../../dist/npm_bazel_protractor", | ||
"@bazel/typescript": "file:../../dist/npm_bazel_typescript", | ||
"@types/jasmine": "2.8.2", | ||
"@types/node": "7.0.18", | ||
"concurrently": "^3.5.1", | ||
"jasmine": "2.8.0", | ||
"protractor": "^5.4.2", | ||
"@types/jasmine": "3.3.15", | ||
"typescript": "2.7.x" | ||
}, | ||
"scripts": { | ||
"pretest": "bazel run @nodejs//:yarn && webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG", | ||
"e2e-devserver": "concurrently \"bazel run //:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor\" --kill-others --success first", | ||
"e2e-prodserver": "concurrently \"bazel run //:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor\" --kill-others --success first", | ||
"test": "bazel build ... && yarn e2e-devserver && yarn e2e-prodserver" | ||
"test": "bazel test ..." | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// The function exported from this file is used by the protractor_web_test_suite. | ||
// It is passed to the `onPrepare` configuration setting in protractor and executed | ||
// before running tests. | ||
// | ||
// If the function returns a promise, as it does here, protractor will wait | ||
// for the promise to resolve before running tests. | ||
|
||
const protractorUtils = require('@bazel/protractor/protractor-utils'); | ||
const protractor = require('protractor'); | ||
|
||
module.exports = function(config) { | ||
// In this example, `@bazel/protractor/protractor-utils` is used to run | ||
// the server. protractorUtils.runServer() runs the server on a randomly | ||
// selected port (given a port flag to pass to the server as an argument). | ||
// The port used is returned in serverSpec and the protractor serverUrl | ||
// is the configured. | ||
const isProdserver = config.server.endsWith('prodserver'); | ||
return protractorUtils | ||
.runServer(config.workspace, config.server, isProdserver ? '-p' : '-port', []) | ||
.then(serverSpec => { | ||
protractor.browser.baseUrl = `http://localhost:${serverSpec.port}`; | ||
}); | ||
}; |
Oops, something went wrong.