Skip to content

Commit c50271c

Browse files
authored
Merge pull request #1021 from jtpio/ui-test-reveal
Add UI test for the reveal notebook
2 parents 6744872 + 6f0e6bb commit c50271c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.github/workflows/ui-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,21 @@ jobs:
7272
resource: http-get://localhost:8866/
7373
timeout: 360000
7474

75-
- uses: iterative/setup-cml@v1
7675
- name: Test
76+
run: |
77+
cd ui-tests
78+
jlpm run test
79+
80+
- uses: iterative/setup-cml@v1
81+
82+
- name: Publish Results
7783
env:
7884
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7985
REPORT: ./benchmark-results/voila-benchmark.md
8086
shell: bash
8187
run: |
8288
cd ui-tests
83-
jlpm run test
84-
89+
8590
# Publish image to cml.dev
8691
echo "" >> ${REPORT}
8792
cml-publish ./benchmark-results/voila-benchmark.png --md >> ${REPORT}

ui-tests/tests/voila.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,16 @@ test.describe('Voila performance Tests', () => {
167167
await page.waitForSelector('#MathJax_Message', { state: 'hidden' });
168168
expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`);
169169
});
170+
test('Render and benchmark reveal.ipynb', async ({
171+
page,
172+
browserName
173+
}, testInfo) => {
174+
const notebookName = 'reveal';
175+
const testFunction = async () => {
176+
await page.goto(`render/${notebookName}.ipynb`);
177+
await page.waitForSelector('span[role="presentation"] >> text=x');
178+
};
179+
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
180+
expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`);
181+
});
170182
});
10.6 KB
Loading

0 commit comments

Comments
 (0)