mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5585] add direct api-client-factory call in tests (#3323)
This commit is contained in:
@@ -24,28 +24,18 @@
|
||||
|
||||
|
||||
import { test as base } from '@playwright/test';
|
||||
import { ApiClientFactory, NodesPage, PersonalFilesPage } from '../';
|
||||
import { NodesPage, PersonalFilesPage } from '../';
|
||||
|
||||
interface Pages {
|
||||
personalFiles: PersonalFilesPage;
|
||||
nodesPage: NodesPage;
|
||||
}
|
||||
|
||||
interface Api {
|
||||
superAdminApiClient: ApiClientFactory;
|
||||
}
|
||||
|
||||
export const test = base.extend<Pages & Api>({
|
||||
export const test = base.extend<Pages>({
|
||||
personalFiles: async ({ page }, use) => {
|
||||
await use(new PersonalFilesPage(page));
|
||||
},
|
||||
nodesPage: async ({ page }, use) => {
|
||||
await use(new NodesPage(page));
|
||||
},
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
superAdminApiClient: async ({ }, use) => {
|
||||
const apiClient = new ApiClientFactory();
|
||||
await apiClient.setUpAcaBackend('admin');
|
||||
await use(apiClient);
|
||||
}
|
||||
});
|
||||
|
@@ -75,6 +75,7 @@ export class ActionsDropdownComponent extends BaseComponent {
|
||||
await this.addActionButtonLocator.click();
|
||||
}
|
||||
await this.actionDropdownLocator.nth(index).click();
|
||||
await this.spinnerWaitForReload();
|
||||
const option = this.getOptionLocator(action);
|
||||
await option.click();
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
import { Locator, Page } from '@playwright/test';
|
||||
import { PlaywrightBase } from '../playwright-base';
|
||||
import { timeouts } from '../../utils';
|
||||
|
||||
export abstract class BaseComponent extends PlaywrightBase {
|
||||
private readonly rootElement: string;
|
||||
@@ -55,8 +56,8 @@ export abstract class BaseComponent extends PlaywrightBase {
|
||||
|
||||
async spinnerWaitForReload(): Promise<void> {
|
||||
try {
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: 2000 });
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'detached', timeout: 2000 });
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: timeouts.short });
|
||||
await this.page.locator('mat-progress-spinner').waitFor({ state: 'detached', timeout: timeouts.normal });
|
||||
} catch (e) {
|
||||
this.logger.info('Spinner was not present');
|
||||
}
|
||||
|
Reference in New Issue
Block a user