Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/functional/apps/visualize/_vega_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});

it('should render different data in response to filter change', async function () {
await PageObjects.vegaChart.typeInSpec('"config": { "kibana": {"renderer": "svg"} },');
const { spec, isValid } = await PageObjects.vegaChart.getSpecAsJSON();
expect(isValid).to.be(true);
// add SVG renderer to read the Y axis labels
const updatedSpec = { ...spec, config: { kibana: { renderer: 'svg' } } };
await PageObjects.vegaChart.fillSpec(JSON.stringify(updatedSpec, null, 2));
await PageObjects.visEditor.clickGo();
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
const fullDataLabels = await PageObjects.vegaChart.getYAxisLabels();
Expand Down
20 changes: 12 additions & 8 deletions test/functional/page_objects/vega_chart_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

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

const compareSpecs = (first: string, second: string) => {
Expand Down Expand Up @@ -74,14 +75,17 @@ export class VegaChartPageObject extends FtrService {
});
}

public async typeInSpec(text: string) {
const aceGutter = await this.getAceGutterContainer();

await aceGutter.doubleClick();
await this.browser.pressKeys(this.browser.keys.RIGHT);
await this.browser.pressKeys(this.browser.keys.LEFT);
await this.browser.pressKeys(this.browser.keys.LEFT);
await this.browser.pressKeys(text);
public async getSpecAsJSON() {
const text = await this.getSpec();
try {
const spec = hjson.parse(text, { legacyRoot: false, keepWsc: true });
return {
spec,
isValid: true,
};
} catch (err) {
return { spec: text, isValid: false };
}
}

public async cleanSpec() {
Expand Down