Skip to content

Commit

Permalink
test: updated test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Oct 24, 2024
1 parent 85bfee8 commit 381d625
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions tests/project/projectList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ test.describe('Project List Tests', () => {
}
});

test('should navigate to project detail', async ({ page }) => {
const projectCount = await projectListPage.getTableRowCount();
if (projectCount > 0) {
await projectListPage.navigateToDetail(0);
await page.waitForSelector('.detail-layout');
expect(page.url()).toContain('/projects/');
} else {
// If no projects, skip this test
test.skip();
}
});

test('should verify project form placeholders', async () => {
await projectListPage.clickCreate();

Expand Down Expand Up @@ -90,19 +78,23 @@ test.describe('Project List Tests', () => {
expect(lastProjectData.description).toBe(projectDescription);
});

test('should navigate to project detail', async ({ page }) => {
const projectCount = await projectListPage.getTableRowCount();
expect(projectCount).toBeGreaterThan(0);
await projectListPage.navigateToDetail(0);
await page.waitForSelector('.detail-layout');
expect(page.url()).toMatch(/\/projects\/[0-9a-f]{24}/);
});

test('should delete a project', async ({ page }) => {
const projectCount = await projectListPage.getTableRowCount();
if (projectCount > 0) {
const initialCount = projectCount;
await projectListPage.deleteRow(0);

await page.waitForTimeout(1000); // Wait for deletion to process
const newCount = await projectListPage.getTableRowCount();
expect(newCount).toBe(initialCount - 1);
} else {
// If no projects, skip this test
test.skip();
}
expect(projectCount).toBeGreaterThan(0);
const initialCount = projectCount;
await projectListPage.deleteRow(0);

await page.waitForTimeout(1000); // Wait for deletion to process
const newCount = await projectListPage.getTableRowCount();
expect(newCount).toBe(initialCount - 1);
});
});
});

0 comments on commit 381d625

Please sign in to comment.