Add the vector policy source embedding controls

This commit is contained in:
Sung-Hyun Kang
2026-06-16 11:03:20 -05:00
parent 74b6a92219
commit c6139c0cd1
11 changed files with 493 additions and 59 deletions
@@ -190,4 +190,59 @@ test.describe("Vector Policy under Scale & Settings", () => {
const saveButton = explorer.commandBarButton(CommandBarButton.Save);
await expect(saveButton).toBeDisabled();
});
test("Add embedding source to vector embedding policy", async () => {
const addButton = explorer.frame.getByTestId("VectorEmbedding/AddButton");
await addButton.click();
const embeddingSourceSection = explorer.frame.getByTestId("VectorEmbeddingSource/Section/1");
if ((await embeddingSourceSection.count()) === 0) {
test.skip(true, "Test account does not have the integrated embedding capability.");
}
await explorer.frame.getByTestId("VectorEmbedding/Path/1").fill("/embedding");
await explorer.frame.getByTestId("VectorEmbedding/Dimensions/1").fill("1536");
// Expand embedding source section and fill fields
await embeddingSourceSection.click();
await explorer.frame.getByTestId("VectorEmbeddingSource/SourcePaths/1").fill("/description");
await explorer.frame.getByTestId("VectorEmbeddingSource/DeploymentName/1").fill("text-embedding-3-small");
await explorer.frame.getByTestId("VectorEmbeddingSource/ModelName/1").fill("text-embedding-3-small");
await explorer.frame
.getByTestId("VectorEmbeddingSource/Endpoint/1")
.fill("https://e2e-embedding.cognitiveservices.azure.com/");
// Save changes
const saveButton = explorer.commandBarButton(CommandBarButton.Save);
await expect(saveButton).toBeEnabled();
await saveButton.click();
await expect(explorer.getConsoleHeaderStatus()).toContainText(
`Successfully updated container ${context.container.id}`,
{ timeout: 2 * ONE_MINUTE_MS },
);
});
test("Existing embedding source fields are disabled after save", async () => {
// Ensure a policy with embedding source exists (from previous test or create one)
const sourcePathsInput = explorer.frame.getByTestId("VectorEmbeddingSource/SourcePaths/1");
if ((await sourcePathsInput.count()) === 0) {
test.skip(true, "No embedding source present; previous test may have been skipped.");
}
await expect(sourcePathsInput).toBeDisabled();
await expect(sourcePathsInput).toHaveValue("/description");
const deploymentInput = explorer.frame.getByTestId("VectorEmbeddingSource/DeploymentName/1");
await expect(deploymentInput).toBeDisabled();
await expect(deploymentInput).toHaveValue("text-embedding-3-small");
const modelInput = explorer.frame.getByTestId("VectorEmbeddingSource/ModelName/1");
await expect(modelInput).toBeDisabled();
await expect(modelInput).toHaveValue("text-embedding-3-small");
const endpointInput = explorer.frame.getByTestId("VectorEmbeddingSource/Endpoint/1");
await expect(endpointInput).toBeDisabled();
await expect(endpointInput).toHaveValue("https://e2e-embedding.cognitiveservices.azure.com/");
});
});