Network - DHCP : PXE Boot Options test completed

This commit is contained in:
ajasma6570 2024-06-24 18:40:58 +05:30
parent 649b9d8fd2
commit 7ba89b995a

View file

@ -189,34 +189,34 @@ test.describe('Network & Services - Network - DHCP', () => {
const isSectionVisible = await section.isVisible();
expect(isSectionVisible).toBe(true);
const label = await page.$('#content-pxetftp p:has-text("New PXE Boot Option")');
const label = await page.$('#newPxe p:has-text("New PXE Boot Option")');
expect(label).toBeTruthy();
const fileName = await page.$('#content-pxetftp p:has-text("Filename")');
const fileName = await page.$('#content-pxetftp label: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")');
const serverName = await page.$('#content-pxetftp label: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")');
const serverAddress = await page.$('#content-pxetftp label: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")');
const dhcpOptions = await page.$('#content-pxetftp label: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 ")');
const ForceDhcpOptions = await page.$('#content-pxetftp label:has-text("Force DHCP Options ")');
expect(ForceDhcpOptions).toBeTruthy();
const ForceDhcpOptionsToggle = await page.locator('#newPxe .pxe-force');
const ForceDhcpOptionsToggleIsVisible = await ForceDhcpOptionsToggle.isVisible();
@ -228,5 +228,38 @@ test.describe('Network & Services - Network - DHCP', () => {
const discardButton = page.locator('#discardPxeOption');
expect(discardButton).toBeTruthy();
});
test('Add, Read Values in Add New PXE Boot Option', async ({ page }) => {
await page.waitForSelector('#newPxeOption');
const addButton = await page.locator('#newPxeOption');
await addButton.click();
await page.waitForSelector('#pxe-filename');
const filename = await page.locator('#pxe-filename');
await filename.fill('pxelinux.0');
const serverName = await page.locator('#pxe-server-name');
await serverName.fill('office-server');
const serverAddress = await page.locator('#pxe-server-address');
await serverAddress.fill('192.168.2.1');
const dhcpOptions = await page.locator('#pxe-dhcp-options');
await dhcpOptions.fill('42,192.168.1.4');
const forceDHCPOptions = await page.locator('.pxe-force').elementHandle();
const isChecked = await forceDHCPOptions.isChecked();
if (!isChecked) {
await page.evaluate((checkbox) => checkbox.click(), forceDHCPOptions);
}
const saveButton = await page.locator('#newPxe button.button.green:has-text("Save")');
await saveButton.click();
expect(page.locator('div:has-text("pxelinux.0")')).toBeTruthy();
expect(page.locator('div:has-text("office-server")')).toBeTruthy();
expect(page.locator('div:has-text("192.168.2.1")')).toBeTruthy();
expect(page.locator('div:has-text("42,192.168.1.4")')).toBeTruthy();
});
});
});