e2e tests: Make pageObjects mandatory (#18406)

- Lower strictNullChecks: true errors
This commit is contained in:
Tobias Skarhed 2019-08-06 14:29:26 +02:00 committed by GitHub
parent 1c7bf35aa7
commit 760aec7d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -7,9 +7,9 @@ export const login = async (page: Page) => {
await loginPage.init(page);
await loginPage.navigateTo();
await loginPage.pageObjects!.username.enter('admin');
await loginPage.pageObjects!.password.enter('admin');
await loginPage.pageObjects!.submit.click();
await loginPage.pageObjects.username.enter('admin');
await loginPage.pageObjects.password.enter('admin');
await loginPage.pageObjects.submit.click();
await loginPage.waitForResponse();
};

View File

@ -25,11 +25,11 @@ type PageObjects<T> = { [P in keyof T]: T[P] };
export interface TestPageConfig<T> {
url?: string;
pageObjects?: PageObjects<T>;
pageObjects: PageObjects<T>;
}
export class TestPage<T> implements TestPageType<T> {
pageObjects?: PageObjects<T>;
pageObjects: PageObjects<T>;
private page?: Page;
private pageUrl?: string;

View File

@ -4,4 +4,5 @@ export interface DataSourcesPage {}
export const dataSourcesPage = new TestPage<DataSourcesPage>({
url: '/datasources',
pageObjects: {},
});