Skip to content

Commit

Permalink
[x-pack/test] convert PO to typescript, improve find/testSubject usage (
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlemeshko authored Sep 15, 2020
1 parent 0574efa commit 1ab229a
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 134 deletions.
9 changes: 4 additions & 5 deletions test/functional/page_objects/vega_chart_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

import { Key } from 'selenium-webdriver';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';

Expand Down Expand Up @@ -94,9 +93,9 @@ export function VegaChartPageProvider({
const aceGutter = await this.getAceGutterContainer();

await aceGutter.doubleClick();
await browser.pressKeys(Key.RIGHT);
await browser.pressKeys(Key.LEFT);
await browser.pressKeys(Key.LEFT);
await browser.pressKeys(browser.keys.RIGHT);
await browser.pressKeys(browser.keys.LEFT);
await browser.pressKeys(browser.keys.LEFT);
await browser.pressKeys(text);
}

Expand All @@ -105,7 +104,7 @@ export function VegaChartPageProvider({

await retry.try(async () => {
await aceGutter.doubleClick();
await browser.pressKeys(Key.BACK_SPACE);
await browser.pressKeys(browser.keys.BACK_SPACE);

expect(await this.getSpec()).to.be('');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/

//import { map as mapAsync } from 'bluebird';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';

export function AccountSettingProvider({ getService }) {
export function AccountSettingProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const userMenu = getService('userMenu');

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

const usernameField = await testSubjects.find('username');
Expand All @@ -25,7 +25,7 @@ export function AccountSettingProvider({ getService }) {
await userMenu.closeMenu();
}

async changePassword(currentPassword, newPassword) {
async changePassword(currentPassword: string, newPassword: string) {
await testSubjects.setValue('currentPassword', currentPassword);
await testSubjects.setValue('newPassword', newPassword);
await testSubjects.setValue('confirmNewPassword', newPassword);
Expand Down
Loading

0 comments on commit 1ab229a

Please sign in to comment.