зеркало из https://github.com/mozilla/pluotsorbet.git
fix test automation
This commit is contained in:
Родитель
4d1e3e0897
Коммит
07d06897ac
5
Makefile
5
Makefile
|
@ -1,5 +1,8 @@
|
||||||
test: java/tests.jar java/classes.jar
|
test: java/tests.jar java/classes.jar
|
||||||
casperjs --enginer=slimerjs test `pwd`/tests/automation.js
|
killall python || true
|
||||||
|
python -m SimpleHTTPServer &
|
||||||
|
casperjs --verbose --log-level=debug --engine=slimerjs test `pwd`/tests/automation.js
|
||||||
|
killall python || true
|
||||||
|
|
||||||
java/tests.jar: java/classes.jar
|
java/tests.jar: java/classes.jar
|
||||||
cd tests && make
|
cd tests && make
|
||||||
|
|
10
index.html
10
index.html
|
@ -21,15 +21,7 @@
|
||||||
</style>
|
</style>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="initial-scale=1.0">
|
<meta name="viewport" content="initial-scale=1.0">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript" src="legacy.js" defer></script>
|
||||||
if (!window.TextDecoder) {
|
|
||||||
var script = document.createElement("script");
|
|
||||||
script.type = "text/javascript";
|
|
||||||
script.defer = true;
|
|
||||||
script.src = "encoding.js";
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(script);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="zipfile.js" defer></script>
|
<script type="text/javascript" src="zipfile.js" defer></script>
|
||||||
<script type="text/javascript" src="timer.js" defer></script>
|
<script type="text/javascript" src="timer.js" defer></script>
|
||||||
<script type="text/javascript" src="util.js" defer></script>
|
<script type="text/javascript" src="util.js" defer></script>
|
||||||
|
|
|
@ -73,6 +73,6 @@ public class RunTests {
|
||||||
pass += harness.passed();
|
pass += harness.passed();
|
||||||
fail += harness.failed();
|
fail += harness.failed();
|
||||||
}
|
}
|
||||||
System.out.println("TOTAL: " + pass + " pass, " + fail + " fail");
|
System.out.println("DONE: " + pass + " pass, " + fail + " fail");
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -1,4 +1,19 @@
|
||||||
casper.test.begin("Hello, Test!", 1, function(test) {
|
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
test.assert(true);
|
/* vim: set shiftwidth=4 tabstop=4 autoindent cindent expandtab: */
|
||||||
test.done();
|
|
||||||
|
casper.on('remote.message', function(message) {
|
||||||
|
this.echo(message);
|
||||||
|
});
|
||||||
|
|
||||||
|
casper.test.begin("unit tests", 1, function(test) {
|
||||||
|
casper
|
||||||
|
.start("http://localhost:8000/index.html?main=RunTests")
|
||||||
|
.waitForText("DONE", function then() {
|
||||||
|
test.assertTextExists("DONE: 702 pass, 0 fail", "run unit tests");
|
||||||
|
}, function error() {
|
||||||
|
this.captureSelector('screen.png', 'body');
|
||||||
|
})
|
||||||
|
.run(function() {
|
||||||
|
test.done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
2
util.js
2
util.js
|
@ -8,7 +8,7 @@ var util = (function () {
|
||||||
|
|
||||||
function decodeUtf8(arrayBuffer) {
|
function decodeUtf8(arrayBuffer) {
|
||||||
if (!Utf8TextDecoder) {
|
if (!Utf8TextDecoder) {
|
||||||
Utf8TextDecoder = new TextDecoder("utf-8");
|
Utf8TextDecoder = new TextDecoder("utf-8");
|
||||||
}
|
}
|
||||||
return Utf8TextDecoder.decode(new Uint8Array(arrayBuffer));
|
return Utf8TextDecoder.decode(new Uint8Array(arrayBuffer));
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче