access-to-admin-page.spec.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import { expect, test } from '@playwright/test';
  2. test('admin is successfully loaded', async ({ page }) => {
  3. await page.goto('/admin');
  4. await expect(page.getByTestId('admin-home')).toBeVisible();
  5. await expect(
  6. page.getByTestId('admin-system-information-table'),
  7. ).toBeVisible();
  8. });
  9. test('admin/app is successfully loaded', async ({ page }) => {
  10. await page.goto('/admin/app');
  11. await expect(page.getByTestId('admin-app-settings')).toBeVisible();
  12. });
  13. test('admin/security is successfully loaded', async ({ page }) => {
  14. await page.goto('/admin/security');
  15. await expect(page.getByTestId('admin-security')).toBeVisible();
  16. await expect(page.locator('#isShowRestrictedByOwner')).toHaveText(
  17. 'Always displayed',
  18. );
  19. await expect(page.locator('#isShowRestrictedByGroup')).toHaveText(
  20. 'Always displayed',
  21. );
  22. });
  23. test('admin/markdown is successfully loaded', async ({ page }) => {
  24. await page.goto('/admin/markdown');
  25. await expect(page.getByTestId('admin-markdown')).toBeVisible();
  26. await expect(page.locator('#isEnabledLinebreaksInComments')).toBeChecked();
  27. });
  28. test('admin/customize is successfully loaded', async ({ page }) => {
  29. await page.goto('/admin/customize');
  30. await expect(page.getByTestId('admin-customize')).toBeVisible();
  31. });
  32. test('admin/importer is successfully loaded', async ({ page }) => {
  33. await page.goto('/admin/importer');
  34. await expect(page.getByTestId('admin-import-data')).toBeVisible();
  35. });
  36. test('admin/export is successfully loaded', async ({ page }) => {
  37. await page.goto('/admin/export');
  38. await expect(page.getByTestId('admin-export-archive-data')).toBeVisible();
  39. });
  40. test('admin/data-transfer is successfully loaded', async ({ page }) => {
  41. await page.goto('/admin/data-transfer');
  42. await expect(page.getByTestId('admin-export-archive-data')).toBeVisible();
  43. });
  44. test('admin/notification is successfully loaded', async ({ page }) => {
  45. await page.goto('/admin/notification');
  46. await expect(page.getByTestId('admin-notification')).toBeVisible();
  47. // wait for retrieving slack integration status
  48. await expect(page.getByTestId('slack-integration-list-item')).toBeVisible();
  49. });
  50. test('admin/slack-integration is successfully loaded', async ({ page }) => {
  51. await page.goto('/admin/slack-integration');
  52. await expect(page.getByTestId('admin-slack-integration')).toBeVisible();
  53. await expect(page.locator('img.bot-difficulty-icon')).toHaveCount(3);
  54. await expect(page.locator('img.bot-difficulty-icon').first()).toBeVisible();
  55. });
  56. test('admin/slack-integration-legacy is successfully loaded', async ({
  57. page,
  58. }) => {
  59. await page.goto('/admin/slack-integration-legacy');
  60. await expect(
  61. page.getByTestId('admin-slack-integration-legacy'),
  62. ).toBeVisible();
  63. });
  64. test('admin/users is successfully loaded', async ({ page }) => {
  65. await page.goto('/admin/users');
  66. await expect(page.getByTestId('admin-users')).toBeVisible();
  67. await expect(page.getByTestId('user-table-tr').first()).toBeVisible();
  68. });
  69. test('admin/user-groups is successfully loaded', async ({ page }) => {
  70. await page.goto('/admin/user-groups');
  71. await expect(page.getByTestId('admin-user-groups')).toBeVisible();
  72. await expect(page.getByTestId('grw-user-group-table').first()).toBeVisible();
  73. });
  74. test('admin/search is successfully loaded', async ({ page }) => {
  75. await page.goto('/admin/search');
  76. await expect(page.getByTestId('admin-full-text-search')).toBeVisible();
  77. // Only successful in the local environment.
  78. // wait for connected
  79. // await expect(page.getByTestId('connection-status-badge-connected')).toBeVisible();
  80. });