Skip to content

feat(tests): [WD-22649] Screenshot automation tests#1377

Merged
Kxiru merged 3 commits intocanonical:mainfrom
Kxiru:screenshot-automation
Aug 20, 2025
Merged

feat(tests): [WD-22649] Screenshot automation tests#1377
Kxiru merged 3 commits intocanonical:mainfrom
Kxiru:screenshot-automation

Conversation

@Kxiru
Copy link
Contributor

@Kxiru Kxiru commented Jul 15, 2025

Done

  • Captures screenshots for the LXD docs (UI sections)
    • Instances (6) ✔️
    • Networks (9) ✔️
    • Storage (18)
      • Pools (4) ✔️
      • Volumes (8) ✔️
      • Volume snapshots (6) ✔️
    • Tutorial (13) ✔️
    • UI (20) ✔️

Fixes lack of screenshot automation in the UI.

QA

  1. Run the LXD-UI:
  2. Perform the following QA steps:
    • Locally run tests in docs-screenshots.spec.ts and observe the generated screenshots in screenshots/doc/images/...

Screenshots

Locally run tests in docs-screenshots.spec.ts and observe the generated screenshots in screenshots/doc/images/...

@webteam-app
Copy link

@Kxiru Kxiru changed the title feat: [WD-22649] Screenshot automation tests feat(tests): [WD-22649] Screenshot automation tests Jul 15, 2025
@Kxiru Kxiru force-pushed the screenshot-automation branch 3 times, most recently from 8e11ced to a72efac Compare July 17, 2025 00:34
@Kxiru Kxiru force-pushed the screenshot-automation branch 7 times, most recently from 618941c to e0757f8 Compare August 4, 2025 14:17
@Kxiru Kxiru marked this pull request as ready for review August 4, 2025 14:18
@Kxiru Kxiru force-pushed the screenshot-automation branch from e0757f8 to 9abbbfe Compare August 4, 2025 21:54
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

Good progress on this one.

Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

Please also note the linting error below.

/home/runner/work/lxd-ui/lxd-ui/tests/docs-screenshots.spec.ts
  523:24  error  Replace `'Allow·custom·restrictions·on'` with `"Allow·custom·restrictions·on"`  prettier/prettier

@Kxiru Kxiru force-pushed the screenshot-automation branch 3 times, most recently from dfd036f to 80a04ed Compare August 5, 2025 22:07
@Kxiru
Copy link
Contributor Author

Kxiru commented Aug 6, 2025

Let's isolate this into a dedicated test

@edlerd , "LXD - Tutorial - Graphical consoles" is the dedicated test 😅 . The only thing occuring in this test is setup for the Ubuntu desktop (one screenshot is taken as a part of this setup) and the rest is just attempting to start the Desktop console.

Did some testing and with a cached desktop image the boot only takes ~40 seconds. So should be within the timeout of two minutes if the image is cached. I think we can make it a prerequisite, the desktop image is cached. And as we schedule the job later in CI, we can add a pre-run command that is downloading the image.

This is good news, though I am unable to locally get the graphical console to appear so I cannot yet do the required navigation. I'll have another go with this tomorrow.

@Kxiru Kxiru force-pushed the screenshot-automation branch 3 times, most recently from 813f7cd to 253ab54 Compare August 11, 2025 14:10
@Kxiru Kxiru requested a review from edlerd August 11, 2025 14:10
@Kxiru Kxiru force-pushed the screenshot-automation branch from 253ab54 to b37f711 Compare August 11, 2025 15:17
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

This is really nice, well done! Some nitpicks on code and a couple of screens or paths don't match what is in the LXD docs yet. Especially in the networking / forward, there were some more screens with differences.

@Kxiru Kxiru force-pushed the screenshot-automation branch 2 times, most recently from 53136bf to 97a3e22 Compare August 13, 2025 22:43
@Kxiru Kxiru requested a review from edlerd August 13, 2025 22:43
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

Good progress, I really like the automated screens. Some tuning seems needed to get the timings right, then this seems good to merge.

@Kxiru Kxiru force-pushed the screenshot-automation branch from 97a3e22 to 845a172 Compare August 18, 2025 16:27
@Kxiru Kxiru requested a review from edlerd August 18, 2025 16:27
@Kxiru Kxiru force-pushed the screenshot-automation branch from 845a172 to dbe841c Compare August 18, 2025 16:28
@Kxiru
Copy link
Contributor Author

Kxiru commented Aug 19, 2025

This is still unresolved.

The instance summary appears in my local screenshots.image

I have replaced this with OpenInstanceDetailPanel for potentially more consistency, but as for the summary page appearing at all, this should have been fixed in my last push.

@Kxiru Kxiru force-pushed the screenshot-automation branch from dbe841c to 2ef5c78 Compare August 19, 2025 19:47
@Kxiru Kxiru requested a review from edlerd August 19, 2025 22:24
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

LGTM, the screens now all line up with the docs 👍

Just one issue with the cleanup of a test below and on the same test an idea to simplify.

@Kxiru Kxiru force-pushed the screenshot-automation branch from 2ef5c78 to e3f248b Compare August 20, 2025 14:07
@Kxiru Kxiru requested a review from edlerd August 20, 2025 14:22
@Kxiru Kxiru force-pushed the screenshot-automation branch from e3f248b to 07a0412 Compare August 20, 2025 14:43
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the automated doc screenshots :)

Kxiru added 3 commits August 20, 2025 16:50
Signed-off-by: Nkeiruka <nkeiruka.whenu@canonical.com>
Signed-off-by: Nkeiruka <nkeiruka.whenu@canonical.com>
Signed-off-by: Nkeiruka <nkeiruka.whenu@canonical.com>
@Kxiru Kxiru force-pushed the screenshot-automation branch from 07a0412 to 79db40c Compare August 20, 2025 15:51
@Kxiru Kxiru merged commit c7b6355 into canonical:main Aug 20, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants