collection.spec.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { test, expect, type TestInfo } from '@playwright/test';
  2. import * as utils from "../global-utils";
  3. import { createAccount } from './setups/user';
  4. let users = utils.loadEnv();
  5. test.beforeAll('Setup', async ({ browser }, testInfo: TestInfo) => {
  6. await utils.startVault(browser, testInfo);
  7. });
  8. test.afterAll('Teardown', async ({}) => {
  9. utils.stopVault();
  10. });
  11. test('Create', async ({ page }) => {
  12. await createAccount(test, page, users.user1);
  13. await test.step('Create Org', async () => {
  14. await page.getByRole('link', { name: 'New organisation' }).click();
  15. await page.getByLabel('Organisation name (required)').fill('Test');
  16. await page.getByRole('button', { name: 'Submit' }).click();
  17. await page.locator('div').filter({ hasText: 'Members' }).nth(2).click();
  18. await utils.checkNotification(page, 'Organisation created');
  19. });
  20. await test.step('Create Collection', async () => {
  21. await page.getByRole('link', { name: 'Collections' }).click();
  22. await page.getByRole('button', { name: 'New' }).click();
  23. await page.getByRole('menuitem', { name: 'Collection' }).click();
  24. await page.getByLabel('Name (required)').fill('RandomCollec');
  25. await page.getByRole('button', { name: 'Save' }).click();
  26. await utils.checkNotification(page, 'Created collection RandomCollec');
  27. await expect(page.getByRole('button', { name: 'RandomCollec' })).toBeVisible();
  28. });
  29. });