Skip to content

Commit

Permalink
Added the console CCS test. (#133545)
Browse files Browse the repository at this point in the history
* Added the console CCS test.

* Forgot some awaits.
  • Loading branch information
John Dorlus authored Jun 3, 2022
1 parent 3a6cc6e commit 1d348b2
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
49 changes: 49 additions & 0 deletions test/functional/apps/console/_console_ccs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

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

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const log = getService('log');
const PageObjects = getPageObjects(['common', 'console']);
const remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver');

describe('Console App CCS', function describeIndexTests() {
this.tags('includeFirefox');
before(async () => {
await remoteEsArchiver.loadIfNeeded(
'test/functional/fixtures/es_archiver/logstash_functional'
);
log.debug('navigateTo console');
await PageObjects.common.navigateToApp('console');
await retry.try(async () => {
await PageObjects.console.collapseHelp();
});
});

after(async () => {
await remoteEsArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
});

describe('Perform CCS Search in Console', () => {
before(async () => {
await PageObjects.console.clearTextArea();
});
it('it should be able to access remote data', async () => {
await PageObjects.console.enterRequest('\nGET ftr-remote:logstash-*/_search');
await PageObjects.console.clickPlay();
await retry.try(async () => {
const actualResponse = await PageObjects.console.getResponse();
expect(actualResponse).to.contain('"extension": "jpg",');
});
});
});
});
}
12 changes: 8 additions & 4 deletions test/functional/apps/console/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@

export default function ({ getService, loadTestFile }) {
const browser = getService('browser');
const config = getService('config');

describe('console app', function () {
before(async function () {
await browser.setWindowSize(1300, 1100);
});

loadTestFile(require.resolve('./_console'));
loadTestFile(require.resolve('./_autocomplete'));
loadTestFile(require.resolve('./_vector_tile'));
if (config.get('esTestCluster.ccs')) {
loadTestFile(require.resolve('./_console_ccs'));
} else {
loadTestFile(require.resolve('./_console'));
loadTestFile(require.resolve('./_autocomplete'));
loadTestFile(require.resolve('./_vector_tile'));
}
});
}
6 changes: 5 additions & 1 deletion test/functional/config.ccs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...baseConfig.getAll(),

testFiles: [require.resolve('./apps/dashboard/group3'), require.resolve('./apps/discover')],
testFiles: [
require.resolve('./apps/dashboard/group3'),
require.resolve('./apps/discover'),
require.resolve('./apps/console/_console_ccs'),
],

services: {
...baseConfig.get('services'),
Expand Down

0 comments on commit 1d348b2

Please sign in to comment.