mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* perform new markdown tests
This commit is contained in:
parent
c595f4044e
commit
3980dd3809
2 changed files with 44 additions and 10 deletions
|
@ -112,6 +112,23 @@ export default function({ getPageObjects }: FtrProviderContext) {
|
|||
|
||||
await cleanupMarkdownData(VARIABLE, VARIABLE);
|
||||
});
|
||||
|
||||
it('series length should be 2 after cloning', async () => {
|
||||
await visualBuilder.markdownSwitchSubTab('data');
|
||||
await visualBuilder.cloneSeries();
|
||||
const seriesLength = (await visualBuilder.getSeries()).length;
|
||||
|
||||
expect(seriesLength).to.be.equal(2);
|
||||
});
|
||||
|
||||
it('aggregation length should be 2 after cloning', async () => {
|
||||
await visualBuilder.markdownSwitchSubTab('data');
|
||||
|
||||
await visualBuilder.createNewAgg();
|
||||
const aggregationLength = await visualBuilder.getAggregationCount();
|
||||
|
||||
expect(aggregationLength).to.be.equal(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import { WebElementWrapper } from '../services/lib/web_element_wrapper';
|
|||
|
||||
export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const find = getService('find');
|
||||
const retry = getService('retry');
|
||||
const log = getService('log');
|
||||
const browser = getService('browser');
|
||||
const testSubjects = getService('testSubjects');
|
||||
|
@ -289,15 +288,13 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
|
|||
}
|
||||
|
||||
public async createNewAgg(nth = 0) {
|
||||
return await retry.try(async () => {
|
||||
const elements = await testSubjects.findAll('addMetricAddBtn');
|
||||
await elements[nth].click();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const aggs = await testSubjects.findAll('aggSelector');
|
||||
if (aggs.length < 2) {
|
||||
throw new Error('there should be atleast 2 aggSelectors');
|
||||
}
|
||||
});
|
||||
const elements = await testSubjects.findAll('addMetricAddBtn');
|
||||
await elements[nth].click();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const aggs = await testSubjects.findAll('aggSelector');
|
||||
if (aggs.length < 2) {
|
||||
throw new Error('there should be atleast 2 aggSelectors');
|
||||
}
|
||||
}
|
||||
|
||||
public async selectAggType(value: string, nth = 0) {
|
||||
|
@ -438,6 +435,26 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
|
|||
await PageObjects.visualize.waitForRenderingCount(prevRenderingCount + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get aggregation count for the current series
|
||||
*
|
||||
* @param {number} [nth=0] series
|
||||
* @returns {Promise<number>}
|
||||
* @memberof VisualBuilderPage
|
||||
*/
|
||||
public async getAggregationCount(nth: number = 0): Promise<number> {
|
||||
const series = await this.getSeries();
|
||||
const aggregation = await series[nth].findAllByCssSelector('[data-test-subj="draggable"]');
|
||||
return aggregation.length;
|
||||
}
|
||||
|
||||
public async deleteSeries(nth: number = 0): Promise<void> {
|
||||
const prevRenderingCount = await PageObjects.visualize.getVisualizationRenderingCount();
|
||||
const cloneBtnArray = await testSubjects.findAll('AddDeleteBtn');
|
||||
await cloneBtnArray[nth].click();
|
||||
await PageObjects.visualize.waitForRenderingCount(prevRenderingCount + 1);
|
||||
}
|
||||
|
||||
public async getLegentItems(): Promise<WebElementWrapper[]> {
|
||||
return await testSubjects.findAll('tsvbLegendItem');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue