1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00
budibase/qa-core/src/config/internal-api/TestConfiguration/index.ts

34 lines
810 B
TypeScript
Raw Normal View History

2022-09-27 04:54:14 +13:00
import ApplicationApi from "./applications"
import AuthApi from "./auth"
import InternalAPIClient from "./InternalAPIClient"
2022-10-18 06:20:40 +13:00
import TablesApi from "./tables"
2022-10-19 22:35:00 +13:00
import RowApi from "./rows"
import ScreenApi from "./screens"
2022-09-27 04:54:14 +13:00
export default class TestConfiguration<T> {
applications: ApplicationApi
auth: AuthApi
screen: ScreenApi
2022-09-27 04:54:14 +13:00
context: T
2022-10-18 06:20:40 +13:00
tables: TablesApi
2022-10-19 22:35:00 +13:00
rows: RowApi
2022-09-27 04:54:14 +13:00
constructor(apiClient: InternalAPIClient) {
this.applications = new ApplicationApi(apiClient)
2022-10-18 06:20:40 +13:00
this.tables = new TablesApi(apiClient)
2022-10-19 22:35:00 +13:00
this.rows = new RowApi(apiClient)
2022-09-27 04:54:14 +13:00
this.auth = new AuthApi(apiClient)
this.screen = new ScreenApi(apiClient)
2022-09-27 04:54:14 +13:00
this.context = <T>{}
}
2022-10-01 14:54:51 +13:00
async beforeAll() {
await this.auth.login()
}
2022-09-27 04:54:14 +13:00
async afterAll() {
this.context = <T>{}
2022-10-01 14:54:51 +13:00
await this.auth.logout()
2022-09-27 04:54:14 +13:00
}
}