Skip to content

Commit 7b9dac4

Browse files
authored
FIREFLY-77: merge pr #814, chart tests
FIREFLY-77: Add Chart test to the new UI testing framework
2 parents 2e8d407 + c8e7ec0 commit 7b9dac4

File tree

12 files changed

+497
-267
lines changed

12 files changed

+497
-267
lines changed

src/firefly/html/demo/ffapi-highlevel-charttest.html

Lines changed: 0 additions & 243 deletions
This file was deleted.
58.3 KB
Loading
34.1 KB
Loading
47.9 KB
Loading
Loading
50.9 KB
Loading

src/firefly/html/test/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ <h3>Firefly Test</h3>
4545
<li class="test-item"><a href="tests-viewer.html">Viewer Tests</a>
4646
<div class="test-desc">This page contains viewer test. Each test will show a new tab with the firefly viewer.</div>
4747
</li>
48+
<li class="test-item"><a href="tests-chart.html">Chart Tests</a>
49+
<div class="test-desc">This page tests various charts. </div>
50+
</li>
4851
</ul>
4952

5053

@@ -129,6 +132,9 @@ <h4>To add a new test page</h4>
129132

130133
<body>
131134
<!-- include your test template(s) here -->
135+
136+
<!-- this is where test cases will be attached-->
137+
<div id="tst-container"/>
132138
</body>
133139
</html>
134140

src/firefly/html/test/styles.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
--tpl-height: 450px;
3636
height: var(--tpl-height);
3737
}
38+
.tpl.xxl {
39+
--tpl-height: 550px;
40+
height: var(--tpl-height);
41+
}
3842

3943
.box {
4044
width: calc(var(--tpl-height) * 1);
@@ -54,6 +58,10 @@
5458
padding: 0 5px;
5559
}
5660

61+
ul.expected-list {
62+
margin: 2px;
63+
}
64+
5765
ul.expected-list li{
5866
list-style-type: circle;
5967
}
@@ -103,7 +111,7 @@ ul.expected-list li{
103111
#expected {
104112
width: 400px;
105113
white-space: normal;
106-
padding-top: 2px;
114+
padding: 2px;
107115
}
108116

109117
.tpl-test-container {

src/firefly/html/test/template_loader.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@
88
const expected = c.querySelector('#expected');
99
const actual = c.querySelector('#actual');
1010
const scpt = c.querySelector('script');
11-
const title = cnt++ + ' - ' + test.title;
1211

13-
renderTest(expected, actual, scpt, title, test);
12+
renderTest(cnt++, expected, actual, scpt, test);
1413
});
1514
};
1615

17-
function renderTest(expected, actual, script, title, testTmpl) {
16+
function renderTest(cnt, expected, actual, script, testTmpl) {
17+
const title = cnt + ' - ' + testTmpl.title;
1818
const iframe = document.createElement('iframe');
1919
iframe.id = 'iframe';
2020
iframe.src = './template.html';
2121
iframe.style.height= '100%';
2222
const iframeContainer = document.createElement('div');
23+
iframeContainer.id = 'test-' + cnt;
2324
iframeContainer.className = 'tst-iframe-container ' + testTmpl.className;
2425
iframeContainer.style.cssText = testTmpl.style.cssText;
2526
iframeContainer.appendChild(iframe);

0 commit comments

Comments
 (0)