mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +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
31 lines
1.1 KiB
TypeScript
31 lines
1.1 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 { Page } from '@playwright/test';
|
|
import { timeouts } from '../../utils/timeouts';
|
|
import { ComponentTitles } from '../../models/component-titles.model';
|
|
import { PlaywrightBase } from '../playwright-base';
|
|
|
|
interface NavigateParameters { componentName: string; story: string };
|
|
|
|
export class BaseStories extends PlaywrightBase {
|
|
private rootComponentTitle: string;
|
|
|
|
constructor(page: Page, rootComponentTitle: ComponentTitles) {
|
|
super(page);
|
|
this.rootComponentTitle = rootComponentTitle;
|
|
}
|
|
|
|
async navigateTo({ componentName, story }: NavigateParameters): Promise<void> {
|
|
await this.page.goto(`/iframe.html?id=${this.rootComponentTitle}-components-${componentName}--${story}`, {
|
|
waitUntil: 'networkidle',
|
|
timeout: timeouts.large
|
|
});
|
|
}
|
|
}
|