Network - DHCP : TFTP server tab partially completed

This commit is contained in:
Ajas 2024-06-20 21:59:38 +05:30
parent 99bca667e2
commit 649b9d8fd2

View file

@ -56,8 +56,8 @@ test.describe('Network & Services - Network - DHCP', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/network/dhcp', { waitUntil: 'networkidle' });
await page.waitForSelector('#static-tab-dndh');
const generalSettingsTab = await page.locator('#static-tab-dndh');
await generalSettingsTab.click();
const staticLeasesTab = await page.locator('#static-tab-dndh');
await staticLeasesTab.click();
await page.waitForTimeout(3000);
});
@ -136,4 +136,97 @@ test.describe('Network & Services - Network - DHCP', () => {
expect(tableIsVisible).toBe(true);
});
});
test.describe('TFTP Server Tab', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/network/dhcp', { waitUntil: 'networkidle' });
await page.waitForSelector('#pxetftp-tab-dndh');
const tftpServerTab = await page.locator('#pxetftp-tab-dndh');
await tftpServerTab.click();
await page.waitForTimeout(3000);
});
test('TFTP Server', async ({ page }) => {
const label = await page.$('#content-pxetftp label:has-text("TFTP Server")');
expect(label).toBeTruthy();
});
test('TFTP Server Root Input Field', async ({ page }) => {
const label = await page.$('#content-pxetftp label:has-text("TFTP Server Root")');
expect(label).toBeTruthy();
const inputField = await page.locator('#tftp-root');
const inputFieldIsVisible = await inputField.isVisible();
expect(inputFieldIsVisible).toBeTruthy();
});
test('Network Boot Image', async ({ page }) => {
const label = await page.$('#content-pxetftp label:has-text("Network Boot Image")');
expect(label).toBeTruthy();
});
test('Network Boot Image Input Field', async ({ page }) => {
const label = await page.$('#content-pxetftp label:has-text("Network Boot Image")');
expect(label).toBeTruthy();
const inputField = await page.locator('#tftp-boot-image');
const inputFieldIsVisible = await inputField.isVisible();
expect(inputFieldIsVisible).toBeTruthy();
});
test('Save Button', async ({ page }) => {
const button = page.locator('#content-pxetftp button.button.green:has-text("Save")');
expect(button).toBeTruthy();
});
test('check Add New PXE Boot Option visible', async ({ page }) => {
await page.waitForSelector('#newPxeOption');
const addButton = await page.locator('#newPxeOption');
await addButton.click();
await page.waitForSelector('#newPxe');
const section = await page.locator('#newPxe');
const isSectionVisible = await section.isVisible();
expect(isSectionVisible).toBe(true);
const label = await page.$('#content-pxetftp p:has-text("New PXE Boot Option")');
expect(label).toBeTruthy();
const fileName = await page.$('#content-pxetftp p:has-text("Filename")');
expect(fileName).toBeTruthy();
const fileNameInputField = await page.locator('#pxe-filename');
const fileNameInputFieldIsVisible = await fileNameInputField.isVisible();
expect(fileNameInputFieldIsVisible).toBeTruthy();
const serverName = await page.$('#content-pxetftp p:has-text("Server Name")');
expect(serverName).toBeTruthy();
const serverNameInputField = await page.locator('#pxe-server-name');
const serverNameInputFieldIsVisible = await serverNameInputField.isVisible();
expect(serverNameInputFieldIsVisible).toBeTruthy();
const serverAddress = await page.$('#content-pxetftp p:has-text("Server Address")');
expect(serverAddress).toBeTruthy();
const serverAddressInputField = await page.locator('#pxe-server-address');
const serverAddressInputFieldIsVisible = await serverAddressInputField.isVisible();
expect(serverAddressInputFieldIsVisible).toBeTruthy();
const dhcpOptions = await page.$('#content-pxetftp p:has-text("DHCP Options")');
expect(dhcpOptions).toBeTruthy();
const dhcpOptionsInputField = await page.locator('#pxe-dhcp-options');
const dhcpOptionsInputFieldIsVisible = await dhcpOptionsInputField.isVisible();
expect(dhcpOptionsInputFieldIsVisible).toBeTruthy();
const ForceDhcpOptions = await page.$('#content-pxetftp p:has-text("Force DHCP Options ")');
expect(ForceDhcpOptions).toBeTruthy();
const ForceDhcpOptionsToggle = await page.locator('#newPxe .pxe-force');
const ForceDhcpOptionsToggleIsVisible = await ForceDhcpOptionsToggle.isVisible();
expect(ForceDhcpOptionsToggleIsVisible).toBeTruthy();
const saveButton = page.locator('#newPxe button.button.green:has-text("Save")');
expect(saveButton).toBeTruthy();
const discardButton = page.locator('#discardPxeOption');
expect(discardButton).toBeTruthy();
});
});
});