mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
e2e component rename
This commit is contained in:
@@ -205,36 +205,16 @@ test.describe('Context View - File Management', () => {
|
|||||||
|
|
||||||
await navigateToContext(page);
|
await navigateToContext(page);
|
||||||
|
|
||||||
// Click Add File button
|
// Use the hidden file input to upload an image directly
|
||||||
await clickElement(page, 'add-context-file');
|
// The "Import File" button triggers this input
|
||||||
await page.waitForSelector('[data-testid="add-context-dialog"]', {
|
const fileInput = page.locator('[data-testid="file-import-input"]');
|
||||||
timeout: 5000,
|
await fileInput.setInputFiles(TEST_IMAGE_SRC);
|
||||||
});
|
|
||||||
|
|
||||||
// Select image type
|
// Wait for file to appear in the list (filename is extracted from path)
|
||||||
await clickElement(page, 'add-image-type');
|
await waitForContextFile(page, 'logo.png', 10000);
|
||||||
|
|
||||||
// Enter filename
|
|
||||||
await fillInput(page, 'new-file-name', 'test-image.png');
|
|
||||||
|
|
||||||
// Upload image using file input
|
|
||||||
await page.setInputFiles('[data-testid="image-upload-input"]', TEST_IMAGE_SRC);
|
|
||||||
|
|
||||||
// Wait for image preview to appear (indicates upload success)
|
|
||||||
const addDialog = await getByTestId(page, 'add-context-dialog');
|
|
||||||
await addDialog.locator('img').waitFor({ state: 'visible' });
|
|
||||||
|
|
||||||
// Click confirm
|
|
||||||
await clickElement(page, 'confirm-add-file');
|
|
||||||
|
|
||||||
// Wait for dialog to close
|
|
||||||
await page.waitForFunction(
|
|
||||||
() => !document.querySelector('[data-testid="add-context-dialog"]'),
|
|
||||||
{ timeout: 5000 }
|
|
||||||
);
|
|
||||||
|
|
||||||
// Verify file appears in list
|
// Verify file appears in list
|
||||||
const fileButton = await getByTestId(page, 'context-file-test-image.png');
|
const fileButton = await getByTestId(page, 'context-file-logo.png');
|
||||||
await expect(fileButton).toBeVisible();
|
await expect(fileButton).toBeVisible();
|
||||||
|
|
||||||
// Click on the image to view it
|
// Click on the image to view it
|
||||||
|
|||||||
Reference in New Issue
Block a user