mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { expect, test } from "../baserowTest";
|
|
import { TablePage } from "../../pages/database/tablePage";
|
|
|
|
test.describe("File field tests", () => {
|
|
test.beforeEach(async ({ workspacePage }) => {
|
|
await workspacePage.goto();
|
|
});
|
|
|
|
test("User can upload an image and download it again @upload", async ({
|
|
page,
|
|
workspacePage,
|
|
}) => {
|
|
// Click "Add new" > "From template".
|
|
const templateModal =
|
|
await workspacePage.sidebar.openCreateAppFromTemplateModal();
|
|
await templateModal.waitUntilLoaded();
|
|
|
|
const templatesLoadingSpinner = templateModal.getLoadingSpinner();
|
|
|
|
await expect(
|
|
templatesLoadingSpinner,
|
|
"Checking that the templates modal spinner is hidden."
|
|
).toBeHidden();
|
|
|
|
await templateModal.clickUseThisTemplateButton();
|
|
|
|
await workspacePage.sidebar.selectDatabaseAndTableByName(
|
|
"Project Tracker",
|
|
"Projects"
|
|
);
|
|
|
|
const tablePage = new TablePage(page);
|
|
await tablePage.addNewFieldOfType("File");
|
|
const imageWidth =
|
|
await tablePage.uploadImageToFirstFileFieldCellAndGetWidth();
|
|
|
|
expect(imageWidth).toBeGreaterThan(0);
|
|
});
|
|
});
|