mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [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 4e45a5eaf1
.
* removed unused browser_exec_scripts
This commit is contained in:
parent
c81ddb5936
commit
4dd288e79c
2 changed files with 16 additions and 37 deletions
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export function readPipelineListRows(container, cssSelectors) {
|
||||
return Array.prototype.map.call(
|
||||
container.querySelectorAll(cssSelectors.ROW),
|
||||
function (row) {
|
||||
return {
|
||||
selected: row.querySelector('input[type=checkbox]').checked,
|
||||
id: row.querySelector(cssSelectors.CELL_ID).innerText.trim(),
|
||||
description: row.querySelector(cssSelectors.CELL_DESCRIPTION).innerText.trim(),
|
||||
lastModified: row.querySelector(cssSelectors.CELL_LAST_MODIFIED).innerText.trim(),
|
||||
username: row.querySelector(cssSelectors.CELL_USERNAME).innerText.trim(),
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
|
@ -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
|
||||
|
@ -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()
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue