mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Discover] Unskip context size tests (#68213)
This commit is contained in:
parent
99a6435daf
commit
a6e9caefe4
2 changed files with 51 additions and 53 deletions
|
@ -17,8 +17,6 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
const TEST_INDEX_PATTERN = 'logstash-*';
|
||||
const TEST_ANCHOR_ID = 'AU_x3_BrGFA8no6QjjaI';
|
||||
const TEST_ANCHOR_FILTER_FIELD = 'geo.src';
|
||||
|
@ -40,20 +38,19 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
it('inclusive filter should be addable via expanded doc table rows', async function () {
|
||||
await docTable.toggleRowExpanded({ isAnchorRow: true });
|
||||
|
||||
await retry.try(async () => {
|
||||
await retry.waitFor(`filter ${TEST_ANCHOR_FILTER_FIELD} in filterbar`, async () => {
|
||||
await docTable.toggleRowExpanded({ isAnchorRow: true });
|
||||
const anchorDetailsRow = await docTable.getAnchorDetailsRow();
|
||||
await docTable.addInclusiveFilter(anchorDetailsRow, TEST_ANCHOR_FILTER_FIELD);
|
||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
||||
expect(
|
||||
await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, true)
|
||||
).to.be(true);
|
||||
|
||||
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, true);
|
||||
});
|
||||
await retry.waitFor(`filter matching docs in docTable`, async () => {
|
||||
const fields = await docTable.getFields();
|
||||
const hasOnlyFilteredRows = fields
|
||||
return fields
|
||||
.map((row) => row[2])
|
||||
.every((fieldContent) => fieldContent === TEST_ANCHOR_FILTER_VALUE);
|
||||
expect(hasOnlyFilteredRows).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -64,26 +61,27 @@ export default function ({ getService, getPageObjects }) {
|
|||
await filterBar.toggleFilterEnabled(TEST_ANCHOR_FILTER_FIELD);
|
||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
||||
|
||||
await retry.try(async () => {
|
||||
expect(
|
||||
await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, false)
|
||||
).to.be(true);
|
||||
await retry.waitFor(`a disabled filter in filterbar`, async () => {
|
||||
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, false);
|
||||
});
|
||||
|
||||
await retry.waitFor('filters are disabled', async () => {
|
||||
const fields = await docTable.getFields();
|
||||
const hasOnlyFilteredRows = fields
|
||||
.map((row) => row[2])
|
||||
.every((fieldContent) => fieldContent === TEST_ANCHOR_FILTER_VALUE);
|
||||
expect(hasOnlyFilteredRows).to.be(false);
|
||||
return hasOnlyFilteredRows === false;
|
||||
});
|
||||
});
|
||||
|
||||
it('filter for presence should be addable via expanded doc table rows', async function () {
|
||||
await docTable.toggleRowExpanded({ isAnchorRow: true });
|
||||
|
||||
await retry.try(async () => {
|
||||
await retry.waitFor('an exists filter in the filterbar', async () => {
|
||||
const anchorDetailsRow = await docTable.getAnchorDetailsRow();
|
||||
await docTable.addExistsFilter(anchorDetailsRow, TEST_ANCHOR_FILTER_FIELD);
|
||||
await PageObjects.context.waitUntilContextLoadingHasFinished();
|
||||
expect(await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, 'exists', true)).to.be(true);
|
||||
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, 'exists', true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -16,69 +16,69 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
const TEST_INDEX_PATTERN = 'logstash-*';
|
||||
const TEST_ANCHOR_ID = 'AU_x3_BrGFA8no6QjjaI';
|
||||
const TEST_DEFAULT_CONTEXT_SIZE = 7;
|
||||
const TEST_STEP_SIZE = 3;
|
||||
const TEST_DEFAULT_CONTEXT_SIZE = 2;
|
||||
const TEST_STEP_SIZE = 2;
|
||||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const retry = getService('retry');
|
||||
const docTable = getService('docTable');
|
||||
const PageObjects = getPageObjects(['context']);
|
||||
let expectedRowLength = 2 * TEST_DEFAULT_CONTEXT_SIZE + 1;
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/53888
|
||||
describe.skip('context size', function contextSize() {
|
||||
describe('context size', function contextSize() {
|
||||
before(async function () {
|
||||
await kibanaServer.uiSettings.update({
|
||||
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
|
||||
'context:step': `${TEST_STEP_SIZE}`,
|
||||
});
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
|
||||
});
|
||||
|
||||
it('should default to the `context:defaultSize` setting', async function () {
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
|
||||
|
||||
await retry.try(async function () {
|
||||
expect(await docTable.getRowsText()).to.have.length(2 * TEST_DEFAULT_CONTEXT_SIZE + 1);
|
||||
});
|
||||
await retry.try(async function () {
|
||||
const predecessorCountPicker = await PageObjects.context.getPredecessorCountPicker();
|
||||
expect(await predecessorCountPicker.getAttribute('value')).to.equal(
|
||||
`${TEST_DEFAULT_CONTEXT_SIZE}`
|
||||
);
|
||||
});
|
||||
await retry.try(async function () {
|
||||
const successorCountPicker = await PageObjects.context.getSuccessorCountPicker();
|
||||
expect(await successorCountPicker.getAttribute('value')).to.equal(
|
||||
`${TEST_DEFAULT_CONTEXT_SIZE}`
|
||||
);
|
||||
});
|
||||
await retry.waitFor(
|
||||
`number of rows displayed initially is ${expectedRowLength}`,
|
||||
async function () {
|
||||
const rows = await docTable.getRowsText();
|
||||
return rows.length === expectedRowLength;
|
||||
}
|
||||
);
|
||||
await retry.waitFor(
|
||||
`predecessor count picker is set to ${TEST_DEFAULT_CONTEXT_SIZE}`,
|
||||
async function () {
|
||||
const predecessorCountPicker = await PageObjects.context.getPredecessorCountPicker();
|
||||
const value = await predecessorCountPicker.getAttribute('value');
|
||||
return value === String(TEST_DEFAULT_CONTEXT_SIZE);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('should increase according to the `context:step` setting when clicking the `load newer` button', async function () {
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
|
||||
await PageObjects.context.clickPredecessorLoadMoreButton();
|
||||
expectedRowLength += TEST_STEP_SIZE;
|
||||
|
||||
await retry.try(async function () {
|
||||
expect(await docTable.getRowsText()).to.have.length(
|
||||
2 * TEST_DEFAULT_CONTEXT_SIZE + TEST_STEP_SIZE + 1
|
||||
);
|
||||
});
|
||||
await retry.waitFor(
|
||||
`number of rows displayed after clicking load more predecessors is ${expectedRowLength}`,
|
||||
async function () {
|
||||
const rows = await docTable.getRowsText();
|
||||
return rows.length === expectedRowLength;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('should increase according to the `context:step` setting when clicking the `load older` button', async function () {
|
||||
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
|
||||
await PageObjects.context.clickSuccessorLoadMoreButton();
|
||||
expectedRowLength += TEST_STEP_SIZE;
|
||||
|
||||
await retry.try(async function () {
|
||||
expect(await docTable.getRowsText()).to.have.length(
|
||||
2 * TEST_DEFAULT_CONTEXT_SIZE + TEST_STEP_SIZE + 1
|
||||
);
|
||||
});
|
||||
await retry.waitFor(
|
||||
`number of rows displayed after clicking load more successors is ${expectedRowLength}`,
|
||||
async function () {
|
||||
const rows = await docTable.getRowsText();
|
||||
return rows.length === expectedRowLength;
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue