Skip to content

Commit

Permalink
[ts] migrate xpack/test to ts ref'd project
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Jun 4, 2021
1 parent c79a29a commit cf753ac
Show file tree
Hide file tree
Showing 31 changed files with 2,824 additions and 2,801 deletions.
9 changes: 8 additions & 1 deletion src/plugins/telemetry/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
"declarationMap": true,
"isolatedModules": true
},
"include": ["public/**/**/*", "server/**/**/*", "common/**/*", "../../../typings/**/*"],
"include": [
"public/**/**/*",
"server/**/**/*",
"common/**/*",
"../../../typings/**/*",
"schema/oss_plugins.json",
"schema/oss_root.json",
],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../../plugins/kibana_react/tsconfig.json" },
Expand Down
6 changes: 5 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"include": [
"**/*",
"../typings/**/*",
"../packages/kbn-test/types/ftr_globals/**/*"
"../packages/kbn-test/types/ftr_globals/**/*",
"api_integration/apis/logstash/pipeline/fixtures/*.json",
"api_integration/apis/logstash/pipelines/fixtures/*.json",
"api_integration/apis/telemetry/fixtures/*.json",
"api_integration/apis/telemetry/fixtures/*.json",
],
"exclude": ["target/**/*", "plugin_functional/plugins/**/*", "interpreter_functional/plugins/**/*"],
"references": [
Expand Down
1 change: 1 addition & 0 deletions tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@
{ "path": "./x-pack/plugins/index_lifecycle_management/tsconfig.json" },
{ "path": "./x-pack/plugins/uptime/tsconfig.json" },
{ "path": "./x-pack/plugins/xpack_legacy/tsconfig.json" },
{ "path": "./x-pack/test/tsconfig.json" },
]
}
5 changes: 4 additions & 1 deletion x-pack/plugins/telemetry_collection_xpack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"include": [
"common/**/*",
"server/**/*",
"../../../typings/*"
"../../../typings/*",
"schema/xpack_monitoring.json",
"schema/xpack_plugins.json",
"schema/xpack_root.json",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
Expand Down
43 changes: 20 additions & 23 deletions x-pack/test/functional/page_objects/account_settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,30 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
import { FtrService } from '../ftr_provider_context';

export function AccountSettingProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const userMenu = getService('userMenu');
export class AccountSettingsPageObject extends FtrService {
private readonly testSubjects = this.ctx.getService('testSubjects');
private readonly userMenu = this.ctx.getService('userMenu');

class AccountSettingsPage {
async verifyAccountSettings(expectedEmail: string, expectedUserName: string) {
await userMenu.clickProvileLink();
async verifyAccountSettings(expectedEmail: string, expectedUserName: string) {
await this.userMenu.clickProvileLink();

const usernameField = await testSubjects.find('username');
const userName = await usernameField.getVisibleText();
expect(userName).to.be(expectedUserName);
const usernameField = await this.testSubjects.find('username');
const userName = await usernameField.getVisibleText();
expect(userName).to.be(expectedUserName);

const emailIdField = await testSubjects.find('email');
const emailField = await emailIdField.getVisibleText();
expect(emailField).to.be(expectedEmail);
await userMenu.closeMenu();
}
const emailIdField = await this.testSubjects.find('email');
const emailField = await emailIdField.getVisibleText();
expect(emailField).to.be(expectedEmail);
await this.userMenu.closeMenu();
}

async changePassword(currentPassword: string, newPassword: string) {
await testSubjects.setValue('currentPassword', currentPassword);
await testSubjects.setValue('newPassword', newPassword);
await testSubjects.setValue('confirmNewPassword', newPassword);
await testSubjects.click('changePasswordButton');
await testSubjects.existOrFail('passwordUpdateSuccess');
}
async changePassword(currentPassword: string, newPassword: string) {
await this.testSubjects.setValue('currentPassword', currentPassword);
await this.testSubjects.setValue('newPassword', newPassword);
await this.testSubjects.setValue('confirmNewPassword', newPassword);
await this.testSubjects.click('changePasswordButton');
await this.testSubjects.existOrFail('passwordUpdateSuccess');
}
return new AccountSettingsPage();
}
30 changes: 13 additions & 17 deletions x-pack/test/functional/page_objects/banners_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,22 @@
* 2.0.
*/

import { FtrProviderContext } from '../ftr_provider_context';
import { FtrService } from '../ftr_provider_context';

export function BannersPageProvider({ getService }: FtrProviderContext) {
const find = getService('find');
export class BannersPageObject extends FtrService {
private readonly find = this.ctx.getService('find');

class BannersPage {
isTopBannerVisible() {
return find.existsByCssSelector('.header__topBanner .kbnUserBanner__container');
}
isTopBannerVisible() {
return this.find.existsByCssSelector('.header__topBanner .kbnUserBanner__container');
}

async getTopBannerText() {
if (!(await this.isTopBannerVisible())) {
return '';
}
const bannerContainer = await find.byCssSelector(
'.header__topBanner .kbnUserBanner__container'
);
return bannerContainer.getVisibleText();
async getTopBannerText() {
if (!(await this.isTopBannerVisible())) {
return '';
}
const bannerContainer = await this.find.byCssSelector(
'.header__topBanner .kbnUserBanner__container'
);
return bannerContainer.getVisibleText();
}

return new BannersPage();
}
Loading

0 comments on commit cf753ac

Please sign in to comment.