-
Notifications
You must be signed in to change notification settings - Fork 90
feat(installation-media): replace modal with wizard by default #2246
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,197 @@ | ||
| // Copyright (c) 2026 Sidero Labs, Inc. | ||
| // | ||
| // Use of this software is governed by the Business Source License | ||
| // included in the LICENSE file. | ||
| import { stat } from 'node:fs/promises' | ||
|
|
||
| import { faker } from '@faker-js/faker' | ||
| import { milliseconds } from 'date-fns' | ||
| import { load } from 'js-yaml' | ||
|
|
||
| import { expect, test } from '../auth_fixtures' | ||
|
|
||
| test.describe.configure({ mode: 'parallel' }) | ||
|
|
||
| test('Download installation media', async ({ page }, testInfo) => { | ||
| test.slow() | ||
|
|
||
| await test.step('Go to wizard', async () => { | ||
| await page.goto('/') | ||
| await page.getByRole('link', { name: 'Download Installation Media' }).click() | ||
|
|
||
| const firstStepHeading = page.getByRole('heading', { name: 'Create New Media' }) | ||
|
|
||
| const isVisible = await firstStepHeading | ||
| .waitFor({ timeout: milliseconds({ seconds: 2 }) }) | ||
| .then(() => true) | ||
| .catch(() => false) | ||
|
|
||
| // Only click "Create New" if we don't auto redirect (redirects directly to wizard if no configs exist) | ||
| if (!isVisible) { | ||
| await page.getByRole('link', { name: 'Create New' }).click() | ||
| } | ||
|
|
||
| await expect(firstStepHeading).toBeVisible() | ||
| }) | ||
|
|
||
| await test.step('Entry step', async () => { | ||
| await page.getByRole('radio', { name: 'Bare-metal Machine' }).click() | ||
| await expect(page.getByRole('radio', { name: 'Bare-metal Machine' })).toBeChecked() | ||
|
|
||
| await page.getByRole('link', { name: 'Next' }).click() | ||
| }) | ||
|
|
||
| await test.step('Talos version step', async () => { | ||
| await page.getByRole('combobox', { name: 'Choose Talos Linux Version' }).click() | ||
| await page.getByRole('option', { name: '1.12.0' }).click() | ||
| await expect(page.getByRole('combobox', { name: 'Choose Talos Linux Version' })).toHaveText( | ||
| '1.12.0', | ||
| ) | ||
|
|
||
| await page.getByRole('combobox', { name: 'Join Token' }).click() | ||
| await page.getByRole('option', { name: 'initial token' }).click() | ||
| await expect(page.getByRole('combobox', { name: 'Join Token' })).toHaveText('initial token') | ||
|
|
||
| await page.getByText('Tunnel Omni management').click() | ||
| await expect(page.getByRole('checkbox', { name: 'Tunnel Omni management' })).toBeChecked() | ||
|
|
||
| await page.getByRole('button', { name: 'new label' }).click() | ||
| await page.getByRole('textbox').first().fill('foo:bar') | ||
| await page.getByRole('textbox').first().press('Enter') | ||
| await expect(page.getByRole('button', { name: 'foo:bar' })).toBeVisible() | ||
|
|
||
| await page.getByRole('link', { name: 'Next' }).click() | ||
| }) | ||
|
|
||
| await test.step('Architecture step', async () => { | ||
| await page.getByRole('radio', { name: 'arm64' }).click() | ||
| await expect(page.getByRole('radio', { name: 'arm64' })).toBeChecked() | ||
|
|
||
| await page.getByRole('checkbox', { name: 'SecureBoot' }).click() | ||
| await expect(page.getByRole('checkbox', { name: 'SecureBoot' })).toBeChecked() | ||
|
|
||
| await page.getByRole('link', { name: 'Next' }).click() | ||
| }) | ||
|
|
||
| await test.step('System extensions step', async () => { | ||
| await page.getByPlaceholder('Search').fill('hello') | ||
| await page.getByText('siderolabs/hello-world-service').click() | ||
| await expect( | ||
| page.getByRole('checkbox', { name: 'siderolabs/hello-world-service' }), | ||
| ).toBeChecked() | ||
|
|
||
| await page.getByRole('link', { name: 'Next' }).click() | ||
| }) | ||
|
|
||
| await test.step('Extra args step', async () => { | ||
| await page.getByRole('radio', { name: 'Auto' }).click() | ||
| await page.locator('.flex.max-h-full').first().click() | ||
|
|
||
| await page | ||
| .getByRole('textbox', { name: 'Extra kernel command line' }) | ||
| .fill(`-console console=tty0`) | ||
|
|
||
| await page.getByRole('link', { name: 'Next' }).click() | ||
| }) | ||
|
|
||
| const savedPresetName = `e2e-media-${faker.string.alphanumeric(8)}` | ||
|
|
||
| let schematicId: string | ||
|
|
||
| await test.step('Confirmation step', async () => { | ||
| await page.getByRole('button', { name: 'Copy schematic ID' }).click() | ||
|
|
||
| schematicId = await page.evaluate(() => navigator.clipboard.readText()) | ||
| expect(schematicId, 'Expect schematic ID to be valid').toMatch(/[a-zA-Z0-9]{64}/) | ||
|
|
||
| await page.getByRole('button', { name: 'Copy schematic YAML' }).click() | ||
|
|
||
| const schematicYml = await page.evaluate(() => navigator.clipboard.readText()) | ||
| const parsedSchematicYml = load(schematicYml) | ||
| await testInfo.attach('schematic.yaml', { | ||
| body: schematicYml, | ||
| contentType: 'application/yaml', | ||
| }) | ||
|
|
||
| expect(parsedSchematicYml, 'Expect YAML to match expected shape').toEqual({ | ||
| customization: { | ||
| extraKernelArgs: [ | ||
| expect.stringContaining('siderolink.api=grpc://'), | ||
| expect.stringContaining('talos.events.sink='), | ||
| expect.stringContaining('talos.logging.kernel='), | ||
| '-console', | ||
| 'console=tty0', | ||
| ], | ||
| meta: [{ key: 12, value: expect.any(String) }], | ||
| systemExtensions: { | ||
| officialExtensions: ['siderolabs/hello-world-service'], | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| await expect( | ||
| page.getByText( | ||
| `https://factory.talos.dev/image/${schematicId}/1.12.0/metal-arm64-secureboot.iso`, | ||
| ), | ||
| ).toBeVisible() | ||
|
|
||
| await expect( | ||
| page.getByText( | ||
| `https://factory.talos.dev/image/${schematicId}/1.12.0/metal-arm64-secureboot.raw.zst`, | ||
| ), | ||
| ).toBeVisible() | ||
|
|
||
| await expect( | ||
| page.getByText(`https://pxe.factory.talos.dev/${schematicId}/1.12.0/metal-arm64-secureboot`), | ||
| ).toBeVisible() | ||
|
|
||
| await page.getByRole('button', { name: 'Save' }).click() | ||
| await page.getByRole('textbox', { name: 'Name:' }).fill(savedPresetName) | ||
| await page.getByRole('textbox', { name: 'Name:' }).click() | ||
| await page.getByLabel('Save preset').getByRole('button', { name: 'Save' }).click() | ||
| await page.getByRole('link', { name: 'Finished' }).click() | ||
| }) | ||
|
|
||
| const presetRow = page.getByRole('row', { name: savedPresetName }) | ||
|
|
||
| await test.step('Download the image', async () => { | ||
| await presetRow.getByLabel('download').click() | ||
|
|
||
| const isoRow = page.getByRole('row', { name: 'SecureBoot ISO' }) | ||
| await isoRow.getByLabel('copy link').click() | ||
|
|
||
| const isoLink = await page.evaluate(() => navigator.clipboard.readText()) | ||
| expect(isoLink).toBe( | ||
| `https://factory.talos.dev/image/${schematicId}/1.12.0/metal-arm64-secureboot.iso`, | ||
| ) | ||
|
|
||
| await isoRow.getByLabel('download').click() | ||
|
|
||
| const [download] = await Promise.all([ | ||
| page.waitForEvent('download'), | ||
| expect(page.getByText('Generating Image')).toBeVisible(), | ||
| ]) | ||
|
|
||
| const filePath = testInfo.outputPath(download.suggestedFilename()) | ||
| await download.saveAs(filePath) | ||
|
|
||
| const { size } = await stat(filePath) | ||
|
|
||
| expect(size, 'Expect ISO to be at least 50MB').toBeGreaterThan(50 * 1024 * 1024) | ||
|
|
||
| await page.getByRole('button', { name: 'Close', exact: true }).click() | ||
| }) | ||
|
|
||
| await test.step('Delete the image', async () => { | ||
| await presetRow.getByLabel('delete').click() | ||
|
|
||
| await expect( | ||
| page.getByText(`Are you sure you want to delete preset "${savedPresetName}"?`), | ||
| ).toBeVisible() | ||
|
|
||
| await page.getByRole('button', { name: 'Confirm' }).click() | ||
|
|
||
| await expect(page.getByText(`Deleted preset ${savedPresetName}`)).toBeVisible() | ||
| await expect(presetRow).toBeHidden() | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.