Skip to content

Commit

Permalink
Improve logstash pipeline tests (#32198)
Browse files Browse the repository at this point in the history
* [services/pipeline_list] optimize getRows function

* run ciGroup2 x16 times

* [services/pipeline_list] wait for table body loaded

* Revert "run ciGroup2 x16 times"

This reverts commit 4e45a5e.

* removed unused browser_exec_scripts
  • Loading branch information
dmlemeshko authored Mar 1, 2019
1 parent 46cc846 commit bda704a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.

This file was deleted.

33 changes: 16 additions & 17 deletions x-pack/test/functional/services/pipeline_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { readPipelineListRows } from './browser_exec_scripts/read_pipeline_list_rows';

export function PipelineListProvider({ getService }) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const browser = getService('browser');
const random = getService('random');

// test subject selectors
Expand Down Expand Up @@ -113,17 +110,17 @@ export function PipelineListProvider({ getService }) {
* @return {Promise<Array<Object>>}
*/
async readRows() {
return await browser.execute(
readPipelineListRows,
await testSubjects.find(SUBJ_CONTAINER),
{
ROW: testSubjects.getCssSelector(INNER_SUBJ_ROW),
CELL_ID: testSubjects.getCssSelector(INNER_SUBJ_CELL_ID),
CELL_DESCRIPTION: testSubjects.getCssSelector(INNER_SUBJ_CELL_DESCRIPTION),
CELL_LAST_MODIFIED: testSubjects.getCssSelector(INNER_SUBJ_CELL_LAST_MODIFIED),
CELL_USERNAME: testSubjects.getCssSelector(INNER_SUBJ_CELL_USERNAME),
},
);
const pipelineTable = await testSubjects.find('pipelineTable');
const $ = await pipelineTable.parseDomContent();
return $.findTestSubjects(INNER_SUBJ_ROW).toArray().map(row => {
return {
selected: $(row).hasClass('euiTableRow-isSelected'),
id: $(row).findTestSubjects(INNER_SUBJ_CELL_ID).text(),
description: $(row).findTestSubjects(INNER_SUBJ_CELL_DESCRIPTION).text(),
lastModified: $(row).findTestSubjects(INNER_SUBJ_CELL_LAST_MODIFIED).text(),
username: $(row).findTestSubjects(INNER_SUBJ_CELL_USERNAME).text()
};
});
}

/**
Expand Down Expand Up @@ -163,9 +160,11 @@ export function PipelineListProvider({ getService }) {
* @return {Promise<undefined>}
*/
async assertExists() {
await retry.waitFor('pipline list visible on screen', async () => (
await testSubjects.exists(SUBJ_CONTAINER)
));
await retry.waitFor('pipline list visible on screen', async () => {
const container = await testSubjects.find(SUBJ_CONTAINER);
const found = await container.findAllByCssSelector('table tbody');
return found.length > 0;
});
}

/**
Expand Down

0 comments on commit bda704a

Please sign in to comment.