kibana/test/examples/expressions_explorer/expressions.ts
Stratoula Kalafateli 7377a1c79f
[Expressions] Unskip test (#157962)
## Summary

Closes https://github.com/elastic/kibana/issues/156780

I think that something changed on the chromedriver and now the ssl
parameter is not always added on the google url. I changed it to use
contain instead and unskipped the test


Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2265
2023-05-17 14:51:30 +01:00

60 lines
2.3 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { subj as testSubjSelector } from '@kbn/test-subj-selector';
import { PluginFunctionalProviderContext } from '../../plugin_functional/services';
// eslint-disable-next-line import/no-default-export
export default function ({ getService }: PluginFunctionalProviderContext) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const find = getService('find');
const browser = getService('browser');
describe('', () => {
it('runs expression', async () => {
await retry.try(async () => {
const text = await testSubjects.getVisibleText('expressionResult');
expect(text).to.be(
'{\n "type": "render",\n "as": "markdown_vis",\n "value": {\n "visType": "markdown",\n "visParams": {\n "markdown": "## expressions explorer",\n "openLinksInNewTab": false,\n "fontSize": 12\n }\n }\n}'
);
});
});
it('renders expression', async () => {
await retry.try(async () => {
const text = await testSubjects.getVisibleText('expressionRender');
expect(text).to.be('expressions explorer rendering');
});
});
it('updates the variable', async () => {
const selector = `${testSubjSelector('expressionsVariablesTest')} ${testSubjSelector(
'testExpressionButton'
)}`;
await find.clickByCssSelector(selector);
await retry.try(async () => {
const el = await find.byCssSelector(selector);
const style = await el.getAttribute('style');
expect(style).to.contain('red');
});
});
it('emits an action and navigates', async () => {
const selector = `${testSubjSelector('expressionsActionsTest')} ${testSubjSelector(
'testExpressionButton'
)}`;
await find.clickByCssSelector(selector);
await retry.try(async () => {
const text = await browser.getCurrentUrl();
expect(text).to.contain('https://www.google.com/');
});
});
});
}