-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62c6c4e
commit 24c9417
Showing
11 changed files
with
96 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sed -z -r -f bpRunner.js.patch.sed -i node_modules/protractor/built/bpRunner.js | ||
# sed script (of a single replace command) that | ||
# * works on the whole input at once (-z) | ||
# * uses extended regex syntax (-r) | ||
# * is in a file so it can be documented (-f) | ||
# * replaces the input file in place (-i) | ||
|
||
# Expected input in bpRunner.js: | ||
#```javascript | ||
#class BlockingProxyRunner { | ||
# ... | ||
# this.bpProcess = child_process_1.fork(BP_PATH, args, { silent: true }); | ||
#``` | ||
|
||
# The script will replace the first and last lines into | ||
#```javascript | ||
# // HACKED -- begin | ||
# var execArgv = process.execArgv.filter(function(arg) { | ||
# return arg.indexOf('--debug-brk=') !== 0 && arg.indexOf('--inspect') !== 0; | ||
# }); | ||
# this.bpProcess = child_process_1.fork(BP_PATH, args, { silent: true, execArgv }); | ||
# // HACKED -- end | ||
#``` | ||
|
||
# Note: Each line end has to be unterminated with an escape, so sed handles multiline script correctly. | ||
# Note: s/ has to be on one line, because otherwise it'll not match. | ||
# Note: programming () {} . has to be escaped in search. | ||
# Note: programming && and // has to be escaped in replacement. | ||
s/this\.bpProcess = child_process_1\.fork\(BP_PATH, args, \{ silent: true \}\);/\ | ||
\/\/ HACKED -- begin\ | ||
var execArgv = process.execArgv.filter(function(arg) {\ | ||
return arg.indexOf('--debug-brk=') !== 0 \&\& arg.indexOf('--inspect') !== 0;\ | ||
});\ | ||
this.bpProcess = child_process_1.fork(BP_PATH, args, { silent: true, execArgv });\ | ||
\/\/ HACKED -- end\ | ||
/ |
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
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,26 +1,26 @@ | ||
/** | ||
* Matches the element to have a Bootstrap glyphicon element inside with the given icon name | ||
* Matches any element in {@param elementList} that has the same text as the resolved value of {@param textPromise}. | ||
* @param {ElementArrayFinder} elementList | ||
* @param {Promise<string>} textPromise the end of `glyphicon-name` | ||
* @param {Promise<string>} textPromise | ||
* @returns {Promise<boolean>} | ||
*/ | ||
export function anyWithText(elementList, textPromise) { | ||
//noinspection JSValidateTypes reduce will resolve correctly: `false` + `||` -> boolean | ||
return elementList.reduce(function (acc, elem) { | ||
return textPromise.then(function (resolvedText) { | ||
return textPromise.then(function (resolvedText) { | ||
return elementList.reduce(function (acc, elem) { | ||
return elem.getText().then(function (elemName) { | ||
return acc || resolvedText === elemName; | ||
}); | ||
}); | ||
}, false); | ||
}, false); | ||
}); | ||
} | ||
|
||
/** | ||
* Matches the element to have a Bootstrap glyphicon element inside with the given icon name | ||
* Checks if there are no elements in {@param elementList} that have the same text as the resolved value of {@param textPromise}. | ||
* @param {ElementArrayFinder} elementList | ||
* @param {Promise<string>} text the end of `glyphicon-name` | ||
* @param {Promise<string>} textPromise | ||
* @returns {Promise<boolean>} | ||
*/ | ||
export function noneWithText(elementList, text) { | ||
return anyWithText(elementList, text).then((result) => !result); | ||
export function noneWithText(elementList, textPromise) { | ||
return anyWithText(elementList, textPromise).then((result) => !result); | ||
} |
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