forked from finos/perspective
-
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.
Merge pull request #117 from redbearsam/feature/test-more-charts
Added integration screenshot tests for more d3fc charts
- Loading branch information
Showing
15 changed files
with
5,734 additions
and
154 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
81 changes: 40 additions & 41 deletions
81
...rspective-viewer-d3fc/test/html/line.html → ...iewer-d3fc/test/html/shares-template.html
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,41 +1,40 @@ | ||
<!-- | ||
Copyright (c) 2017, the Perspective Authors. | ||
This file is part of the Perspective library, distributed under the terms of | ||
the Apache License 2.0. The full license can be found in the LICENSE file. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> | ||
<script src="perspective.view.js"></script> | ||
<script src="d3fc.plugin.js"></script> | ||
|
||
<link rel='stylesheet' href="demo.css"> | ||
|
||
</head> | ||
<body> | ||
|
||
<perspective-viewer | ||
view="d3_y_line" | ||
columns='["Sales"]'> | ||
|
||
</perspective-viewer> | ||
|
||
<script> | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'superstore.csv', true); | ||
xhr.onload = function () { | ||
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response); | ||
} | ||
xhr.send(null); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> | ||
<!-- | ||
Copyright (c) 2017, the Perspective Authors. | ||
This file is part of the Perspective library, distributed under the terms of | ||
the Apache License 2.0. The full license can be found in the LICENSE file. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> | ||
<script src="perspective.view.js"></script> | ||
<script src="d3fc.plugin.js"></script> | ||
|
||
<link rel='stylesheet' href="demo.css"> | ||
</head> | ||
<body> | ||
|
||
<perspective-viewer view="{view-name}" row-pivots='["Date"]' column-pivots='[]' filters='[]' | ||
sort='[]' columns='["Open","Price","High","Low"]' | ||
aggregates='{"Date":"distinct count","Change%":"sum","High":"sum","Low":"sum","Open":"sum","Price":"sum","Vol.":"sum"}'> | ||
|
||
</perspective-viewer> | ||
|
||
<script> | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'shares.csv', true); | ||
xhr.onload = function () { | ||
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response); | ||
} | ||
xhr.send(null); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
5,277 changes: 5,277 additions & 0 deletions
5,277
packages/perspective-viewer-d3fc/test/html/shares.csv
Large diffs are not rendered by default.
Oops, something went wrong.
82 changes: 41 additions & 41 deletions
82
...erspective-viewer-d3fc/test/html/bar.html → ...iewer-d3fc/test/html/simple-template.html
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,41 +1,41 @@ | ||
<!-- | ||
Copyright (c) 2017, the Perspective Authors. | ||
This file is part of the Perspective library, distributed under the terms of | ||
the Apache License 2.0. The full license can be found in the LICENSE file. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> | ||
<script src="perspective.view.js"></script> | ||
<script src="d3fc.plugin.js"></script> | ||
|
||
<link rel='stylesheet' href="demo.css"> | ||
|
||
</head> | ||
<body> | ||
|
||
<perspective-viewer | ||
view="d3_y_bar" | ||
columns='["Sales"]'> | ||
|
||
</perspective-viewer> | ||
|
||
<script> | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'superstore.csv', true); | ||
xhr.onload = function () { | ||
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response); | ||
} | ||
xhr.send(null); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> | ||
<!-- | ||
Copyright (c) 2017, the Perspective Authors. | ||
This file is part of the Perspective library, distributed under the terms of | ||
the Apache License 2.0. The full license can be found in the LICENSE file. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> | ||
<script src="perspective.view.js"></script> | ||
<script src="d3fc.plugin.js"></script> | ||
|
||
<link rel='stylesheet' href="demo.css"> | ||
|
||
</head> | ||
<body> | ||
|
||
<perspective-viewer | ||
view="{view-name}" | ||
columns='{columns}'> | ||
|
||
</perspective-viewer> | ||
|
||
<script> | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'superstore.csv', true); | ||
xhr.onload = function () { | ||
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response); | ||
} | ||
xhr.send(null); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
77 changes: 77 additions & 0 deletions
77
packages/perspective-viewer-d3fc/test/html/themed-template.html
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,77 @@ | ||
<!-- | ||
Copyright (c) 2017, the Perspective Authors. | ||
This file is part of the Perspective library, distributed under the terms of | ||
the Apache License 2.0. The full license can be found in the LICENSE file. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> | ||
<script src="perspective.view.js"></script> | ||
<script src="d3fc.plugin.js"></script> | ||
|
||
<link rel='stylesheet' href="demo.css"> | ||
|
||
<style> | ||
perspective-viewer { | ||
--active-column--background: none; | ||
--select--background-color: none; | ||
--column-drop-container--background: none; | ||
background-color: #2a2c2f; | ||
color: #cfd8dc; | ||
--plugin--background: #2f3136; | ||
--column-drop-label--color: #666; | ||
--column--border-color: #3b3f46; | ||
--column-drop-target--background: #135d78; | ||
--active-column-selector--color: #22a0ce; | ||
--column_type-float--color: #22a0ce; | ||
--column_type-string--color: #ff8888; | ||
--psp-text-field--border-color: #22a0ce; | ||
--button-hover--color: #22a0ce; | ||
--d3fc-legend-text: #bbbbbb; | ||
--d3fc-axis--ticks: #bbbbbb; | ||
--d3fc-axis--lines: #555555; | ||
--d3fc-tooltip--background: #333333; | ||
--d3fc-tooltip--color: #cfd8dc; | ||
--d3fc-series: #d62728; | ||
--d3fc-series-1: #d62728; | ||
--d3fc-series-2: #9467bd; | ||
--d3fc-series-3: #8c564b; | ||
--d3fc-series-4: #e377c2; | ||
--d3fc-series-5: #7f7f7f; | ||
--d3fc-series-6: #bcbd22; | ||
--d3fc-series-7: #17becf; | ||
--d3fc-series-8: #0366d6; | ||
--d3fc-series-9: #ff7f0e; | ||
--d3fc-series-10: #2ca02c; | ||
--warning--color: #333; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
|
||
<perspective-viewer | ||
view="{view-name}" | ||
columns='{columns}'> | ||
|
||
</perspective-viewer> | ||
|
||
<script> | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'superstore.csv', true); | ||
xhr.onload = function () { | ||
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response); | ||
} | ||
xhr.send(null); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
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,26 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2017, the Perspective Authors. | ||
* | ||
* This file is part of the Perspective library, distributed under the terms of | ||
* the Apache License 2.0. The full license can be found in the LICENSE file. | ||
* | ||
*/ | ||
|
||
const path = require("path"); | ||
|
||
const utils = require("@jpmorganchase/perspective-viewer/test/js/utils.js"); | ||
const simple_tests = require("@jpmorganchase/perspective-viewer/test/js/simple_tests.js"); | ||
|
||
const {withTemplate} = require("./simple-template"); | ||
withTemplate("area", "d3_y_area"); | ||
|
||
utils.with_server({}, () => { | ||
describe.page( | ||
"area.html", | ||
() => { | ||
simple_tests.default(); | ||
}, | ||
{reload_page: false, root: path.join(__dirname, "..", "..")} | ||
); | ||
}); |
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
35 changes: 35 additions & 0 deletions
35
packages/perspective-viewer-d3fc/test/js/candlestick.spec.js
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,35 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2017, the Perspective Authors. | ||
* | ||
* This file is part of the Perspective library, distributed under the terms of | ||
* the Apache License 2.0. The full license can be found in the LICENSE file. | ||
* | ||
*/ | ||
|
||
const path = require("path"); | ||
|
||
const utils = require("@jpmorganchase/perspective-viewer/test/js/utils.js"); | ||
|
||
const {withTemplate} = require("./simple-template"); | ||
withTemplate("candlestick", "d3_candlestick", {template: "shares-template"}); | ||
|
||
utils.with_server({}, () => { | ||
describe.page( | ||
"candlestick.html", | ||
() => { | ||
test.capture("filter by a single instrument.", async page => { | ||
const viewer = await page.$("perspective-viewer"); | ||
await page.evaluate(element => element.setAttribute("filters", '[["Name", "==", "BARC"]]'), viewer); | ||
}); | ||
|
||
test.capture("filter to date range.", async page => { | ||
const viewer = await page.$("perspective-viewer"); | ||
await page.shadow_click("perspective-viewer", "#config_button"); | ||
await page.evaluate(element => element.setAttribute("column-pivots", '["Name"]'), viewer); | ||
await page.evaluate(element => element.setAttribute("filters", '[["Date", ">", "2019-01-01"]]'), viewer); | ||
}); | ||
}, | ||
{reload_page: false, root: path.join(__dirname, "..", "..")} | ||
); | ||
}); |
Oops, something went wrong.