Skip to content

Commit

Permalink
Test added for system admin search and view group history
Browse files Browse the repository at this point in the history
  • Loading branch information
nk2136 committed Dec 9, 2024
1 parent 73acc32 commit 1c119c8
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion end2end/tests/userAccessGroup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,47 @@ test('Import a group from another leaf site and delete it', async ({ page }) =>

await page.reload();
await expect(importedGroup).not.toBeVisible();
});
});

test('System admin search', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=mod_groups');

const systemAdminsLink = page.getByRole('link', { name: 'System administrators' });
await systemAdminsLink.click();

const searchBox = page.getByLabel('Filter by group or user name');
await searchBox.fill('sysa');
await page.keyboard.press('Enter');

// Verify the system admin exists
const sysAdminGroup = page.locator('#groupTitle1');
await expect(sysAdminGroup).toBeVisible();
await expect(sysAdminGroup).toContainText('sysadmin');

// Verify primary admin not found in search results
const otherGroup = page.locator('#groupTitle2');
await expect(otherGroup).not.toBeVisible();
});

test('View user group history', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=mod_groups');

// Open group
const group = page.getByRole('heading', { name: 'Iron Games' });
await group.click();

const viewHistoryButton = page.getByRole('button', { name: 'View History' });
await viewHistoryButton.waitFor();
await viewHistoryButton.click();

// Verify the group name in the history
const historyName = page.locator('#historyName');
await historyName.waitFor();
await expect(historyName).toContainText('Group Name: Iron Games');

const closeHistoryButton = page.getByLabel('Group history').getByRole('button', { name: 'Close' });
await closeHistoryButton.click();

const closeButton = page.getByRole('button', { name: 'Close' });
await closeButton.click();
});

0 comments on commit 1c119c8

Please sign in to comment.