Skip to content

Commit

Permalink
ci: take screenshot of settings and include more screenshots in commi…
Browse files Browse the repository at this point in the history
…t comment
  • Loading branch information
ErikBjare committed May 12, 2021
1 parent 43f9b5a commit ae8a8a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
cat .github/commit_comment_template.md >> comment.md
cml-publish screenshots/activity.png --md >> comment.md
cml-publish screenshots/home.png | sed -E 's/.+/<img width="20%" src="\0"\/>/' >> comment.md
cml-publish screenshots/timeline.png | sed -E 's/.+/<img width="20%" src="\0"\/>/' >> comment.md
cml-publish screenshots/buckets.png | sed -E 's/.+/<img width="20%" src="\0"\/>/' >> comment.md
cml-publish screenshots/stopwatch.png | sed -E 's/.+/<img width="20%" src="\0"\/>/' >> comment.md
cml-publish screenshots/settings.png | sed -E 's/.+/<img width="20%" src="\0"\/>/' >> comment.md
cml-publish screenshots/activity.png --md | >> comment.md
cml-send-comment comment.md
15 changes: 15 additions & 0 deletions test/e2e/screenshot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ test('Screenshot the home view', async t => {
fixture(`Activity view`).page(`http://localhost:27180/#/activity/fakedata`);

test('Screenshot the activity view', async t => {
// wait for a few seconds, since it can be slow to load
await t.wait(3000);

await hide_devonly(t);
await t.takeScreenshot({
path: 'activity.png',
fullPage: true,
});

// TODO: resize to mobile size and take another screenshot
});

fixture(`Timeline view`).page(`http://localhost:27180/#/timeline`);
Expand All @@ -59,6 +64,16 @@ test('Screenshot the buckets view', async t => {
});
});

fixture(`Setting view`).page(`http://localhost:27180/#/settings/`);

test('Screenshot the settings view', async t => {
await hide_devonly(t);
await t.takeScreenshot({
path: 'settings.png',
fullPage: true,
});
});

fixture(`Stopwatch view`).page(`http://localhost:27180/#/stopwatch/`);

test('Screenshot the stopwatch view', async t => {
Expand Down

0 comments on commit ae8a8a3

Please sign in to comment.