mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-7160] Setup Playwright in ADF - Storybook testing (#7537)
* [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
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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);
|
||||
});
|
||||
|
||||
});
|
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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('People component stories tests', () => {
|
||||
test('Valid Preselected Users', async ({ processServicesCloud, peopleComponent }) => {
|
||||
const expectedUsersName = `
|
||||
first-name-1 last-name-1 cancel
|
||||
first-name-2 last-name-2 cancel
|
||||
first-name-3 last-name-3 cancel
|
||||
first-name-4 last-name-4 cancel
|
||||
first-name-5 last-name-5
|
||||
`;
|
||||
|
||||
await processServicesCloud.navigateTo({ componentName: 'people', story: 'valid-preselected-users' });
|
||||
|
||||
await expect(peopleComponent.usersNaming).toContainText(expectedUsersName);
|
||||
});
|
||||
|
||||
test('Mandatory Preselected Users', async ({ processServicesCloud, peopleComponent }) => {
|
||||
const expectedUsersName = `
|
||||
first-name-1 last-name-1
|
||||
first-name-2 last-name-2 cancel
|
||||
`;
|
||||
|
||||
await processServicesCloud.navigateTo({ componentName: 'people', story: 'mandatory-preselected-users' });
|
||||
await peopleComponent.getUserLocator('userName1').hover();
|
||||
|
||||
await expect.soft(peopleComponent.usersNaming).toContainText(expectedUsersName);
|
||||
await expect(peopleComponent.tooltip.content).toContainText('Mandatory');
|
||||
});
|
||||
|
||||
test('Invalid Preselected Users', async ({ processServicesCloud, peopleComponent }) => {
|
||||
const expectedWarningMessage = 'warning No user found with the username invalid user';
|
||||
|
||||
await processServicesCloud.navigateTo({ componentName: 'people', story: 'invalid-preselected-users' });
|
||||
|
||||
await expect(peopleComponent.error.content).toContainText(expectedWarningMessage);
|
||||
});
|
||||
|
||||
test('Excluded Users', async ({ processServicesCloud, peopleComponent }) => {
|
||||
const expectedExcludedUsers = `
|
||||
mocked-user-id-2
|
||||
mocked-user-id-3
|
||||
`;
|
||||
|
||||
await processServicesCloud.navigateTo({ componentName: 'people', story: 'excluded-users' });
|
||||
await peopleComponent.usersInput.type('user');
|
||||
|
||||
await expect(peopleComponent.listbox.allOptions).not.toContainText(expectedExcludedUsers);
|
||||
});
|
||||
|
||||
test('No Users', async ({ processServicesCloud, peopleComponent }) => {
|
||||
const expectedInformation = 'No user found with the username user';
|
||||
|
||||
await processServicesCloud.navigateTo({ componentName: 'people', story: 'no-users' });
|
||||
await peopleComponent.usersInput.type('user');
|
||||
|
||||
await expect(peopleComponent.listbox.oneOption).toContainText(expectedInformation);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user