Skip to content

Commit

Permalink
fix: update tests to reflect configuration renaming and routing changes
Browse files Browse the repository at this point in the history
fix: update documentation and tests to reflect configuration renaming
  • Loading branch information
elikoga committed Jan 22, 2025
1 parent 1589946 commit b79e98b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/src/usage/existing_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ To add an existing NixOS device to Thymis, follow these steps:

### Step 2: Add a New Device

1. Click on the **Devices** tab in the sidebar.
2. Select **Create New Device**.
1. Click on the **Configurations** tab in the sidebar.
2. Select **Create New Configuration**.
3. Fill in the required details, such as the device name, hardware model, as well as tags to associate with the device.

![Thymis create device screen](thymis-create-device.png)
Expand Down
8 changes: 4 additions & 4 deletions docs/src/usage/provisioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Provisioning a new device with Thymis involves creating a fully-configured disk

![Thymis Login-Screen](thymis-login-screen.png)

## Step 2: Create a New Device Profile!
1. Click on the **Devices** tab in the sidebar.
2. Select **Create New Device**.
## Step 2: Create a New Device Configuration!
1. Click on the **Configurations** tab in the sidebar.
2. Select **Create New Configuration**.
3. Fill in the required details, such as the device name, hardware model, as well as tags to associate with the device.

![Thymis create device screen](thymis-create-device.png)

## Step 3: Configure the Device Settings
1. In the **Devices** tab, select **View Details** for the device you just created.
1. In the **Configurations** tab, select **View Details** for the device configuration you just created.
2. Click on **Core Device Configuration** to access the device configuration interface.
3. Use the graphical interface to set up the NixOS modules and services you want to include in your device's image.
4. Save the configuration when done.
Expand Down
26 changes: 15 additions & 11 deletions frontend/tests/screencaps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const createConfiguration = async (
deviceType: string,
tags: string[]
) => {
await page.goto('/devices');
await page.goto('/configuration/list');

const addConfigurationButton = page.locator('button').filter({ hasText: 'Create New Device' });
const addConfigurationButton = page
.locator('button')
.filter({ hasText: 'Create New Configuration' });
await addConfigurationButton.click();

const displayNameInput = page.locator('#display-name').first();
Expand All @@ -28,7 +30,7 @@ const createConfiguration = async (
await page.getByRole('option', { name: tag }).click();
}

const saveButton = page.locator('button').filter({ hasText: 'Create device' });
const saveButton = page.locator('button').filter({ hasText: 'Create device configuration' });
await saveButton.click();
};

Expand Down Expand Up @@ -73,9 +75,11 @@ colorSchemes.forEach((colorScheme) => {
expect(resp?.status()).toBe(200);
await expect(page).toHaveScreenshot();

// We can add Devices
const addDeviceButton = page.locator('button').filter({ hasText: 'Create New Device' });
await addDeviceButton.click();
// We can add Configurations
const addConfigurationButton = page
.locator('button')
.filter({ hasText: 'Create New Configuration' });
await addConfigurationButton.click();

await expect(page).toHaveScreenshot();

Expand All @@ -86,7 +90,7 @@ colorSchemes.forEach((colorScheme) => {
const deviceTypeSelect = page.locator('#device-type').first();
await deviceTypeSelect.selectOption({ label: 'Raspberry Pi 4' });

const saveButton = page.locator('button').filter({ hasText: 'Create device' });
const saveButton = page.locator('button').filter({ hasText: 'Create device configuration' });
console.log(`Is save button disabled? ${await saveButton.isDisabled()}`);
await saveButton.click();

Expand Down Expand Up @@ -217,10 +221,10 @@ colorSchemes.forEach((colorScheme) => {
// Assign the tag
await page.goto('/configuration/list');

await page.locator('button').filter({ hasText: 'Create New Device' }).click();
await page.locator('button').filter({ hasText: 'Create New Configuration' }).click();
await page.locator('#display-name').first().fill('Whoami Device');
await page.locator('#device-type').first().selectOption({ label: 'Raspberry Pi 4' });
await page.locator('button').filter({ hasText: 'Create device' }).click();
await page.locator('button').filter({ hasText: 'Create device configuration' }).click();

const editTagButton = page
.locator('tr')
Expand Down Expand Up @@ -279,8 +283,8 @@ colorSchemes.forEach((colorScheme) => {
await createConfiguration(page, device.name, 'Raspberry Pi 4', device.tags);
}

// Go to devices page
await page.goto('/devices');
// Go to configuration list
await page.goto('/configuration/list');

// Create a update task as well as a project build task
await page.locator('button').filter({ hasText: 'Update' }).click();
Expand Down

0 comments on commit b79e98b

Please sign in to comment.