1
0
Fork 0
mirror of synced 2024-06-17 18:04:42 +12:00
budibase/qa-core/src/config/internal-api/TestConfiguration/index.ts
2022-10-20 17:37:46 +01:00

34 lines
810 B
TypeScript

import ApplicationApi from "./applications"
import AuthApi from "./auth"
import InternalAPIClient from "./InternalAPIClient"
import TablesApi from "./tables"
import RowApi from "./rows"
import ScreenApi from "./screens"
export default class TestConfiguration<T> {
applications: ApplicationApi
auth: AuthApi
screen: ScreenApi
context: T
tables: TablesApi
rows: RowApi
constructor(apiClient: InternalAPIClient) {
this.applications = new ApplicationApi(apiClient)
this.tables = new TablesApi(apiClient)
this.rows = new RowApi(apiClient)
this.auth = new AuthApi(apiClient)
this.screen = new ScreenApi(apiClient)
this.context = <T>{}
}
async beforeAll() {
await this.auth.login()
}
async afterAll() {
this.context = <T>{}
await this.auth.logout()
}
}