Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-71794
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 15, 2020
2 parents 43d90a6 + 69eaa54 commit ed08836
Show file tree
Hide file tree
Showing 34 changed files with 3,380 additions and 401 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
};

// Flaky: https://github.com/elastic/kibana/issues/68400
describe('saved objects edition page', () => {
describe.skip('saved objects edition page', () => {
beforeEach(async () => {
await esArchiver.load('saved_objects_management/edit_saved_object');
});
Expand Down
60 changes: 5 additions & 55 deletions test/functional/page_objects/login_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,26 @@
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { delay } from 'bluebird';
import { FtrProviderContext } from '../ftr_provider_context';

export function LoginPageProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const log = getService('log');
const find = getService('find');

const regularLogin = async (user: string, pwd: string) => {
await testSubjects.setValue('loginUsername', user);
await testSubjects.setValue('loginPassword', pwd);
await testSubjects.click('loginSubmit');
await find.waitForDeletedByCssSelector('.kibanaWelcomeLogo');
await find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting
};

const samlLogin = async (user: string, pwd: string) => {
try {
await find.clickByButtonText('Login using SAML');
await find.setValue('input[name="email"]', user);
await find.setValue('input[type="password"]', pwd);
await find.clickByCssSelector('.auth0-label-submit');
await find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting
} catch (err) {
log.debug(`${err} \nFailed to find Auth0 login page, trying the Auth0 last login page`);
await find.clickByCssSelector('.auth0-lock-social-button');
}
};

class LoginPage {
async login(user: string, pwd: string) {
if (
process.env.VM === 'ubuntu18_deb_oidc' ||
process.env.VM === 'ubuntu16_deb_desktop_saml'
) {
await samlLogin(user, pwd);
return;
}

await regularLogin(user, pwd);
}

async logoutLogin(user: string, pwd: string) {
await this.logout();
await this.sleep(3002);
await this.login(user, pwd);
}

async logout() {
await testSubjects.click('userMenuButton');
await this.sleep(500);
await testSubjects.click('logoutLink');
log.debug('### found and clicked log out--------------------------');
await this.sleep(8002);
}

async sleep(sleepMilliseconds: number) {
log.debug(`... sleep(${sleepMilliseconds}) start`);
await delay(sleepMilliseconds);
log.debug(`... sleep(${sleepMilliseconds}) end`);
await testSubjects.setValue('loginUsername', user);
await testSubjects.setValue('loginPassword', pwd);
await testSubjects.click('loginSubmit');
}
}

Expand Down
22 changes: 9 additions & 13 deletions x-pack/plugins/ingest_manager/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ export type PackageInfo = Installable<
>;

export interface Installation extends SavedObjectAttributes {
installed: AssetReference[];
installed_kibana: KibanaAssetReference[];
installed_es: EsAssetReference[];
es_index_patterns: Record<string, string>;
name: string;
version: string;
Expand All @@ -246,19 +247,14 @@ export type NotInstalled<T = {}> = T & {
status: InstallationStatus.notInstalled;
};

export type AssetReference = Pick<SavedObjectReference, 'id'> & {
type: AssetType | IngestAssetType;
};
export type AssetReference = KibanaAssetReference | EsAssetReference;

/**
* Types of assets which can be installed/removed
*/
export enum IngestAssetType {
IlmPolicy = 'ilm_policy',
IndexTemplate = 'index_template',
ComponentTemplate = 'component_template',
IngestPipeline = 'ingest_pipeline',
}
export type KibanaAssetReference = Pick<SavedObjectReference, 'id'> & {
type: KibanaAssetType;
};
export type EsAssetReference = Pick<SavedObjectReference, 'id'> & {
type: ElasticsearchAssetType;
};

export enum DefaultPackages {
system = 'system',
Expand Down
Loading

0 comments on commit ed08836

Please sign in to comment.