fix: Enhance DB queries with async pagination and improve test reliability (#8040)
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
a72995c408
commit
183a8c28d9
3 changed files with 16 additions and 15 deletions
|
|
@ -8,7 +8,7 @@ import { generateRandomFilename } from "../../utils/generate-filename";
|
|||
// Configure tests to run serially with a delay between each test
|
||||
test(
|
||||
"should navigate to files page and show empty state",
|
||||
{ tag: ["@release", "@files"] },
|
||||
{ tag: ["@release", "@components"] },
|
||||
async ({ page }) => {
|
||||
await awaitBootstrapTest(page, { skipModal: true });
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ test(
|
|||
|
||||
test(
|
||||
"should upload file using upload button",
|
||||
{ tag: ["@release", "@files"] },
|
||||
{ tag: ["@release", "@components"] },
|
||||
async ({ page }) => {
|
||||
const fileName = generateRandomFilename();
|
||||
const testFilePath = path.join(__dirname, "../../assets/test-file.txt");
|
||||
|
|
@ -94,7 +94,7 @@ test(
|
|||
|
||||
test(
|
||||
"should upload file using drag and drop",
|
||||
{ tag: ["@release", "@files"] },
|
||||
{ tag: ["@release", "@components"] },
|
||||
async ({ page }) => {
|
||||
const fileName = generateRandomFilename();
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ test(
|
|||
|
||||
test(
|
||||
"should upload multiple files with different types",
|
||||
{ tag: ["@release", "@files"] },
|
||||
{ tag: ["@release", "@components"] },
|
||||
async ({ page }) => {
|
||||
const fileNames = {
|
||||
txt: generateRandomFilename(),
|
||||
|
|
@ -222,7 +222,7 @@ test(
|
|||
|
||||
test(
|
||||
"should search uploaded files",
|
||||
{ tag: ["@release", "@files"] },
|
||||
{ tag: ["@release", "@components"] },
|
||||
async ({ page }) => {
|
||||
const fileNames = {
|
||||
txt: generateRandomFilename(),
|
||||
|
|
@ -321,7 +321,7 @@ test(
|
|||
|
||||
test(
|
||||
"should handle bulk actions for multiple files",
|
||||
{ tag: ["@release", "@files"] },
|
||||
{ tag: ["@release", "@components"] },
|
||||
async ({ page }) => {
|
||||
const fileNames = {
|
||||
txt: generateRandomFilename(),
|
||||
|
|
@ -421,13 +421,13 @@ test(
|
|||
const download = await downloadPromise;
|
||||
|
||||
// Verify the download was initiated
|
||||
expect(download).toBeTruthy();
|
||||
await expect(download).toBeTruthy();
|
||||
|
||||
// Check for success message
|
||||
const downloadSuccessMessage = await page.getByText(
|
||||
/Files? downloaded successfully/,
|
||||
);
|
||||
expect(downloadSuccessMessage).toBeTruthy();
|
||||
await expect(downloadSuccessMessage).toBeTruthy();
|
||||
|
||||
// Select both files (checkbox on the grid)
|
||||
|
||||
|
|
@ -453,13 +453,14 @@ test(
|
|||
const deleteSuccessMessage = await page.getByText(
|
||||
"Files deleted successfully",
|
||||
);
|
||||
expect(deleteSuccessMessage).toBeTruthy();
|
||||
await expect(deleteSuccessMessage).toBeTruthy();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify the deleted files are no longer visible
|
||||
const remainingFileCount =
|
||||
(await page.getByText(fileNames.py + ".py").count()) +
|
||||
(await page.getByText(fileNames.txt + ".txt").count()) +
|
||||
(await page.getByText(fileNames.json + ".json").count());
|
||||
expect(remainingFileCount).toBe(1);
|
||||
await expect(remainingFileCount).toBe(1);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue