Add huxley screenshot tests
Summary: Add in a testing page, which just renders the location hash in the body. Use this to make some screenshot tests in huxley. Note, these screenshots were made in Firefox on a Linux computer, so running the tests somewhere else might produce something else. Test Plan: - Serve KaTeX (`make serve`) - Run a Selenium Server (I used selenium 2.40.0) - Run `huxley` from the test/huxley/ directory - Ensure that all of the tests pass Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D7258
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
build
|
||||
node_modules
|
||||
last.png
|
||||
|
|
1
test/huxley/Baseline.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/Baseline.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 11 KiB |
1
test/huxley/BasicTest.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/BasicTest.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
1
test/huxley/Colors.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/Colors.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
1
test/huxley/Exponents.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/Exponents.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
1
test/huxley/FractionTest.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/FractionTest.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
1
test/huxley/Functions.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/Functions.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 12 KiB |
1
test/huxley/GreekLetters.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/GreekLetters.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
32
test/huxley/Huxleyfile
Normal file
|
@ -0,0 +1,32 @@
|
|||
[BasicTest]
|
||||
url=http://localhost:7936/test/huxley/test.html#a
|
||||
|
||||
[FractionTest]
|
||||
url=http://localhost:7936/test/huxley/test.html#\dfrac{a}{b}\frac{a}{b}\tfrac{a}{b}
|
||||
|
||||
[NestedFractions]
|
||||
url=http://localhost:7936/test/huxley/test.html#\dfrac{\frac{a}{b}}{\frac{c}{d}}\dfrac{\dfrac{a}{b}}{\dfrac{c}{d}}\frac{\frac{a}{b}}{\frac{c}{d}}
|
||||
|
||||
[Exponents]
|
||||
url=http://localhost:7936/test/huxley/test.html#a^{a^a_a}_{a^a_a}
|
||||
|
||||
[Colors]
|
||||
url=http://localhost:7936/test/huxley/test.html#\blue{a}\green{b}\red{c}
|
||||
|
||||
[GreekLetters]
|
||||
url=http://localhost:7936/test/huxley/test.html#\alpha\beta\gamma\omega
|
||||
|
||||
[Baseline]
|
||||
url=http://localhost:7936/test/huxley/test.html#a+b-c\cdot d/e
|
||||
|
||||
[Spacing]
|
||||
url=http://localhost:7936/test/huxley/test.html#[-1][1-1]1=1(=1)\lvert a\rvert
|
||||
|
||||
[Functions]
|
||||
url=http://localhost:7936/test/huxley/test.html#\sin\cos\tan\ln\log
|
||||
|
||||
[Lap]
|
||||
url=http://localhost:7936/test/huxley/test.html#ab\llap{f}cd\rlap{g}h
|
||||
|
||||
[KaTeX]
|
||||
url=http://localhost:7936/test/huxley/test.html#\KaTeX
|
1
test/huxley/KaTeX.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/KaTeX.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
1
test/huxley/Lap.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/Lap.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 12 KiB |
1
test/huxley/NestedFractions.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/NestedFractions.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 16 KiB |
1
test/huxley/Spacing.huxley/record.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]}
|
BIN
test/huxley/Spacing.huxley/screenshot0.png
Normal file
After Width: | Height: | Size: 11 KiB |
22
test/huxley/test.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Huxley test</title>
|
||||
<script src="/katex.js" type="text/javascript"></script>
|
||||
<link href="/fonts/fonts.css" rel="stylesheet" type="text/css">
|
||||
<link href="/katex.less.css" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
#math {
|
||||
font-size: 4em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="math"></div>
|
||||
<script type="text/javascript">
|
||||
var hash = window.location.hash.slice(1);
|
||||
var mathNode = document.getElementById("math");
|
||||
katex.process(hash, mathNode);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|