[ACS-5585] add direct api-client-factory call in tests (#3323)

This commit is contained in:
Adam Zakrzewski
2023-07-10 16:12:51 +02:00
committed by GitHub
parent e0e4dec218
commit f54ba92f77
7 changed files with 32 additions and 34 deletions

View File

@@ -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);
}
});