mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-02 17:35:08 +00:00
* [AAE-7160] Setup Playwright in ADF - Storybook testing * New test cases for groups component. Reorganize the files * Add to package.json scripts - npm run playwright * Change amount of workers * Change workesr to 2
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
/*
|
|
* Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
|
|
*
|
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
|
* pursuant to a written agreement and any use of this program without such an
|
|
* agreement is prohibited.
|
|
*/
|
|
|
|
import { test, expect } from '../fixtures/page-initialization';
|
|
|
|
test.describe.configure({ mode: 'parallel' });
|
|
|
|
test.describe('Groups component stories tests', () => {
|
|
test('Valid Preselected Groups', async ({ processServicesCloud, groupComponent }) => {
|
|
const expectedUsersName = `
|
|
Mock Group 1 cancel
|
|
Mock Group 2 cancel
|
|
Mock Group 3 cancel
|
|
Mock Group 4 cancel
|
|
Mock Group 5
|
|
`;
|
|
|
|
await processServicesCloud.navigateTo({ componentName: 'group', story: 'valid-preselected-groups' });
|
|
|
|
await expect(groupComponent.groupNaming).toContainText(expectedUsersName);
|
|
});
|
|
|
|
test('Mandatory Preselected Groups', async ({ processServicesCloud, groupComponent }) => {
|
|
const expectedUsersName = `
|
|
Mock Group 1
|
|
Mock Group 2 cancel
|
|
Mock Group 3
|
|
`;
|
|
|
|
await processServicesCloud.navigateTo({ componentName: 'group', story: 'mandatory-preselected-groups' });
|
|
await expect.soft(groupComponent.groupNaming).toContainText(expectedUsersName);
|
|
|
|
await groupComponent.getUserLocator('Mock Group 1').hover();
|
|
await expect(groupComponent.tooltip.content).toContainText('Mandatory');
|
|
});
|
|
|
|
test('Invalid Preselected Groups', async ({ processServicesCloud, groupComponent }) => {
|
|
const expectedWarningMessage = 'warning No group found with the name invalid groups';
|
|
|
|
await processServicesCloud.navigateTo({ componentName: 'group', story: 'invalid-preselected-groups' });
|
|
|
|
await expect(groupComponent.error.content).toContainText(expectedWarningMessage);
|
|
});
|
|
|
|
});
|