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

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