This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'main/master'
- Loading branch information
Showing
17 changed files
with
213 additions
and
27 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,22 @@ | ||
page = require("webpage").create() | ||
system = require("system") | ||
host = undefined | ||
port = undefined | ||
address = undefined | ||
if system.args.length < 4 | ||
console.log "Usage: openurlwithproxy.js <proxyHost> <proxyPort> <URL>" | ||
phantom.exit 1 | ||
else | ||
host = system.args[1] | ||
port = system.args[2] | ||
address = system.args[3] | ||
phantom.setProxy host, port, "manual", "", "" | ||
page.open address, (status) -> | ||
if status isnt "success" | ||
console.log "FAIL to load the address \"" + address + "\" using proxy \"" + host + ":" + port + "\"" | ||
else | ||
console.log "Page title is " + page.evaluate(-> | ||
document.title | ||
) | ||
phantom.exit() | ||
return |
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,24 @@ | ||
var page = require('webpage').create(), | ||
system = require('system'), | ||
host, port, address; | ||
|
||
if (system.args.length < 4) { | ||
console.log('Usage: openurlwithproxy.js <proxyHost> <proxyPort> <URL>'); | ||
phantom.exit(1); | ||
} else { | ||
host = system.args[1]; | ||
port = system.args[2]; | ||
address = system.args[3]; | ||
phantom.setProxy(host, port, 'manual', '', ''); | ||
page.open(address, function (status) { | ||
if (status !== 'success') { | ||
console.log('FAIL to load the address "' + | ||
address + '" using proxy "' + host + ':' + port + '"'); | ||
} else { | ||
console.log('Page title is ' + page.evaluate(function () { | ||
return document.title; | ||
})); | ||
} | ||
phantom.exit(); | ||
}); | ||
} |
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,92 @@ | ||
var system = require('system'); | ||
|
||
/** | ||
* Wait until the test condition is true or a timeout occurs. Useful for waiting | ||
* on a server response or for a ui change (fadeIn, etc.) to occur. | ||
* | ||
* @param testFx javascript condition that evaluates to a boolean, | ||
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | ||
* as a callback function. | ||
* @param onReady what to do when testFx condition is fulfilled, | ||
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | ||
* as a callback function. | ||
* @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. | ||
*/ | ||
function waitFor(testFx, onReady, timeOutMillis) { | ||
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timeout is 3s | ||
start = new Date().getTime(), | ||
condition = false, | ||
interval = setInterval(function() { | ||
if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { | ||
// If not time-out yet and condition not yet fulfilled | ||
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code | ||
} else { | ||
if(!condition) { | ||
// If condition still not fulfilled (timeout but condition is 'false') | ||
console.log("'waitFor()' timeout"); | ||
phantom.exit(1); | ||
} else { | ||
// Condition fulfilled (timeout and/or condition is 'true') | ||
console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms."); | ||
typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled | ||
clearInterval(interval); //< Stop this interval | ||
} | ||
} | ||
}, 100); //< repeat check every 100ms | ||
}; | ||
|
||
|
||
if (system.args.length !== 2) { | ||
console.log('Usage: run-jasmine.js URL'); | ||
phantom.exit(1); | ||
} | ||
|
||
var page = require('webpage').create(); | ||
|
||
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") | ||
page.onConsoleMessage = function(msg) { | ||
console.log(msg); | ||
}; | ||
|
||
page.open(system.args[1], function(status){ | ||
if (status !== "success") { | ||
console.log("Unable to access network"); | ||
phantom.exit(); | ||
} else { | ||
waitFor(function(){ | ||
return page.evaluate(function(){ | ||
return document.body.querySelector('.symbolSummary .pending') === null | ||
}); | ||
}, function(){ | ||
var exitCode = page.evaluate(function(){ | ||
console.log(''); | ||
|
||
var el = document.body.querySelector('.banner'); | ||
var banner = el.querySelector('.title').innerText + " " + | ||
el.querySelector('.version').innerText + " " + | ||
el.querySelector('.duration').innerText; | ||
console.log(banner); | ||
|
||
var list = document.body.querySelectorAll('.results > .failures > .spec-detail.failed'); | ||
if (list && list.length > 0) { | ||
console.log(''); | ||
console.log(list.length + ' test(s) FAILED:'); | ||
for (i = 0; i < list.length; ++i) { | ||
var el = list[i], | ||
desc = el.querySelector('.description'), | ||
msg = el.querySelector('.messages > .result-message'); | ||
console.log(''); | ||
console.log(desc.innerText); | ||
console.log(msg.innerText); | ||
console.log(''); | ||
} | ||
return 1; | ||
} else { | ||
console.log(document.body.querySelector('.alert > .bar.passed').innerText); | ||
return 0; | ||
} | ||
}); | ||
phantom.exit(exitCode); | ||
}); | ||
} | ||
}); |
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 |
---|---|---|
|
@@ -79,6 +79,8 @@ cp README.md %{mybuilddir}%{prefix}/share/%{name}/ | |
%{prefix}/share/%{name}/examples/netlog.js | ||
%{prefix}/share/%{name}/examples/netsniff.coffee | ||
%{prefix}/share/%{name}/examples/netsniff.js | ||
%{prefix}/share/%{name}/examples/openurlwithproxy.coffee | ||
%{prefix}/share/%{name}/examples/openurlwithproxy.js | ||
%{prefix}/share/%{name}/examples/outputEncoding.coffee | ||
%{prefix}/share/%{name}/examples/outputEncoding.js | ||
%{prefix}/share/%{name}/examples/page_events.coffee | ||
|
@@ -91,6 +93,8 @@ cp README.md %{mybuilddir}%{prefix}/share/%{name}/ | |
%{prefix}/share/%{name}/examples/pizza.js | ||
%{prefix}/share/%{name}/examples/post.coffee | ||
%{prefix}/share/%{name}/examples/post.js | ||
%{prefix}/share/%{name}/examples/postjson.coffee | ||
%{prefix}/share/%{name}/examples/postjson.js | ||
%{prefix}/share/%{name}/examples/postserver.coffee | ||
%{prefix}/share/%{name}/examples/postserver.js | ||
%{prefix}/share/%{name}/examples/printenv.coffee | ||
|
@@ -105,6 +109,7 @@ cp README.md %{mybuilddir}%{prefix}/share/%{name}/ | |
%{prefix}/share/%{name}/examples/render_multi_url.js | ||
%{prefix}/share/%{name}/examples/run-jasmine.coffee | ||
%{prefix}/share/%{name}/examples/run-jasmine.js | ||
%{prefix}/share/%{name}/examples/run-jasmine2.js | ||
%{prefix}/share/%{name}/examples/run-qunit.coffee | ||
%{prefix}/share/%{name}/examples/run-qunit.js | ||
%{prefix}/share/%{name}/examples/scandir.coffee | ||
|
@@ -142,6 +147,9 @@ cp README.md %{mybuilddir}%{prefix}/share/%{name}/ | |
%{prefix}/share/%{name}/README.md | ||
|
||
%changelog | ||
* Fri Apr 18 2014 Eric Heydenberk <[email protected]> | ||
- add missing filenames for examples to files section | ||
|
||
* Tue Apr 30 2013 Eric Heydenberk <[email protected]> | ||
- add missing filenames for examples to files section | ||
|
||
|
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,3 +1,12 @@ | ||
load(exclusive_builds) | ||
### Qt 5: remove "uic" and "resources" - or add "qt" | ||
CONFIG = lex yacc warn_on debug uic resources $$CONFIG | ||
|
||
# Variables QT_GCC_MAJOR_VERSION and QT_GCC_MINOR_VERSION are undefined for QPA, | ||
# therefore a few warning suppressions were not properly enabled. | ||
qpa { | ||
QT_GCC_VERSION = $$system(gcc -dumpversion) | ||
QT_GCC_VERSION = $$split(QT_GCC_VERSION, ".") | ||
QT_GCC_MAJOR_VERSION = $$first(QT_GCC_VERSION) | ||
QT_GCC_MINOR_VERSION = $$member(QT_GCC_VERSION, 1) | ||
} |
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
Binary file not shown.
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