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
  • Loading branch information
elikoga committed Jan 22, 2025
1 parent edd4ba1 commit 284e6c8
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 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 @@ -275,8 +279,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 284e6c8

Please sign in to comment.