Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: verify that Core & Zinnia starts #1032

Merged
merged 3 commits into from
Oct 17, 2023
Merged

test: verify that Core & Zinnia starts #1032

merged 3 commits into from
Oct 17, 2023

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Oct 17, 2023

  • test: forward main process output to console
  • test: verify that Core & Zinnia starts

Example test output with the current Core version:

  ✓  3 test/e2e/app-launch.e2e.test.js:84:3 › Application launch › renders Dashboard page (4ms)
  ✓  4 test/e2e/app-launch.e2e.test.js:88:3 › Application launch › wait for "Zinnia started." activity log (12ms)
Core exited via signal SIGTERM
Core closed all stdio with code <no code>
Waiting for the debugger to disconnect...

Example test output for Core version v14.3.0:

Core exited with code: 1
Core closed all stdio with code 1
  ✓  3 test/e2e/app-launch.e2e.test.js:84:3 › Application launch › renders Dashboard page (7ms)
  ✘  4 test/e2e/app-launch.e2e.test.js:88:3 › Application launch › wait for "Zinnia started." activity log (1.0s)
Waiting for the debugger to disconnect...


  1) test/e2e/app-launch.e2e.test.js:88:3 › Application launch › wait for "Zinnia started." activity log

    TimeoutError: page.waitForSelector: Timeout 1000ms exceeded.
    =========================== logs ===========================
    waiting for locator('div.activity-log p:has-text("Zinnia started.")') to be visible
    ============================================================

      87 |
      88 |   test('wait for "Zinnia started." activity log', async () => {
    > 89 |     await mainWindow.waitForSelector(
         |                      ^
      90 |       'div.activity-log p:has-text("Zinnia started.")',
      91 |       { timeout: 1000 * TIMEOUT_MULTIPLIER }
      92 |     )

        at /Users/bajtos/src/filstation/desktop/test/e2e/app-launch.e2e.test.js:89:22

  1 failed
    test/e2e/app-launch.e2e.test.js:88:3 › Application launch › wait for "Zinnia started." activity log

When running end-to-end tests, it's useful to see the messages
printed by the main electron process.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Add a new end-to-end test to verify that the activity log eventually
shows "Zinnia started.".

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos bajtos requested a review from juliangruber October 17, 2023 07:39
Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool and slick implementation 👏

@bajtos bajtos enabled auto-merge (squash) October 17, 2023 08:37
@bajtos bajtos merged commit 0341139 into main Oct 17, 2023
@bajtos bajtos deleted the test-core-startup branch October 17, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants