Skip to content

Commit b2aa367

Browse files
committed
Add some smoke-all test as screenshot tests are not working in CI yet
1 parent 30b8c87 commit b2aa367

File tree

3 files changed

+125
-3
lines changed

3 files changed

+125
-3
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: Table Appearance
3+
tbl-cap-location: bottom
4+
format: html
5+
_quarto:
6+
tests:
7+
html:
8+
ensureHtmlElements:
9+
- ['table tbody tr.odd', 'table tbody tr.even']
10+
- ['table tbody tr:not(.odd):not(.even)'] # All table should have .odd .even class for styling
11+
---
12+
13+
### Md table (w/caption) {#captioned}
14+
15+
A short sentence that makes a paragraph.
16+
17+
| Default | Left | Right | Center |
18+
|---------|:-----|------:|:------:|
19+
| 12 | 12 | 12 | 12 |
20+
| 123 | 123 | 123 | 123 |
21+
| 1 | 1 | 1 | 1 |
22+
23+
: Demonstration of pipe table syntax
24+
25+
### fancy table
26+
27+
A short sentence that makes a paragraph.
28+
29+
| fruit | price |
30+
|--------|--------|
31+
| apple | 2.05 |
32+
| pear | 1.37 |
33+
| orange | 3.09 |
34+
35+
: Fruit prices {.striped .hover}
36+
37+
38+
### xref table
39+
40+
A short sentence that makes a paragraph.
41+
42+
| Col1 | Col2 | Col3 |
43+
|------|------|------|
44+
| A | B | C |
45+
| E | F | G |
46+
| A | G | G |
47+
48+
: My Caption {#tbl-letters}
49+
50+
See @tbl-letters.
51+
52+
### subtables
53+
54+
A short sentence that makes a paragraph.
55+
56+
::: {#tbl-panel layout-ncol=2}
57+
| Col1 | Col2 | Col3 |
58+
|------|------|------|
59+
| A | B | C |
60+
| E | F | G |
61+
| A | G | G |
62+
63+
: First Table {#tbl-first}
64+
65+
| Col1 | Col2 | Col3 |
66+
|------|------|------|
67+
| A | B | C |
68+
| E | F | G |
69+
| A | G | G |
70+
71+
: Second Table {#tbl-second}
72+
73+
Main Caption
74+
:::
75+
76+
See @tbl-panel for details, especially @tbl-second.
77+
78+
### HTML Table
79+
80+
```{=html}
81+
<table>
82+
<caption>As described in the section above, Quarto tables are great.</caption>
83+
<thead>
84+
<tr>
85+
<th>Header 1</th>
86+
<th>Header 2</th>
87+
</tr>
88+
</thead>
89+
<tbody>
90+
<tr>
91+
<td>First Column</td>
92+
<td>Second Column</td>
93+
</tr>
94+
</tbody>
95+
</table>
96+
```

tests/docs/smoke-all/table/appearance.qmd

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
title: Table Appearance
33
format: html
4+
_quarto:
5+
tests:
6+
html:
7+
ensureHtmlElements:
8+
- ['table tbody tr.odd', 'table tbody tr.even']
9+
- ['table tbody tr:not(.odd):not(.even)'] # All table should have .odd .even class for styling
410
---
511

612
### With header
@@ -22,7 +28,7 @@ left 1 right 1
2228
left 2 right 2
2329
----------- ------------
2430

25-
### Md table (w/caption)
31+
### Md table (w/caption) {#captioned}
2632

2733
A short sentence that makes a paragraph.
2834

@@ -85,4 +91,24 @@ A short sentence that makes a paragraph.
8591
Main Caption
8692
:::
8793

88-
See @tbl-panel for details, especially @tbl-second.
94+
See @tbl-panel for details, especially @tbl-second.
95+
96+
### HTML Table
97+
98+
```{=html}
99+
<table>
100+
<caption>As described in the section above, Quarto tables are great.</caption>
101+
<thead>
102+
<tr>
103+
<th>Header 1</th>
104+
<th>Header 2</th>
105+
</tr>
106+
</thead>
107+
<tbody>
108+
<tr>
109+
<td>First Column</td>
110+
<td>Second Column</td>
111+
</tr>
112+
</tbody>
113+
</table>
114+
```

tests/integration/playwright/tests/html-tables.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ test('Markdown tables are styled correctly', async ({ page }) => {
1414

1515
// Test with bottom caption
1616
await testTables(page, 'markdown-tables-cap-bottom.html');
17-
});
17+
});

0 commit comments

Comments
 (0)