mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Dashboard] Unskip functional test related to webdriver (#154767)
## Summary Fix flaky functional test where clicking a Url formatted link opens a new tab, but the tab isn't available before verifying the url of the new tab.
This commit is contained in:
parent
d3f0ca07f8
commit
61f212f75c
1 changed files with 12 additions and 9 deletions
|
@ -7,7 +7,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import expect from '@kbn/expect';
|
import expect from '@kbn/expect';
|
||||||
import { WebElementWrapper } from '../../../services/lib/web_element_wrapper';
|
|
||||||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||||
|
|
||||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
|
@ -26,9 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
const retry = getService('retry');
|
const retry = getService('retry');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
|
|
||||||
const clickFieldAndCheckUrl = async (fieldLink: WebElementWrapper) => {
|
const checkUrl = async (fieldValue: string) => {
|
||||||
const fieldValue = await fieldLink.getVisibleText();
|
|
||||||
await fieldLink.click();
|
|
||||||
const windowHandlers = await browser.getAllWindowHandles();
|
const windowHandlers = await browser.getAllWindowHandles();
|
||||||
expect(windowHandlers.length).to.equal(2);
|
expect(windowHandlers.length).to.equal(2);
|
||||||
await browser.switchToWindow(windowHandlers[1]);
|
await browser.switchToWindow(windowHandlers[1]);
|
||||||
|
@ -37,8 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
expect(currentUrl).to.equal(fieldUrl);
|
expect(currentUrl).to.equal(fieldUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Failing: See https://github.com/elastic/kibana/issues/154367
|
describe('Changing field formatter to Url', () => {
|
||||||
describe.skip('Changing field formatter to Url', () => {
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']);
|
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']);
|
||||||
await kibanaServer.savedObjects.cleanStandardList();
|
await kibanaServer.savedObjects.cleanStandardList();
|
||||||
|
@ -68,7 +64,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
await dashboard.loadSavedDashboard('dashboard with table');
|
await dashboard.loadSavedDashboard('dashboard with table');
|
||||||
await dashboard.waitForRenderComplete();
|
await dashboard.waitForRenderComplete();
|
||||||
const fieldLink = await visChart.getFieldLinkInVisTable(`${fieldName}: Descending`);
|
const fieldLink = await visChart.getFieldLinkInVisTable(`${fieldName}: Descending`);
|
||||||
await clickFieldAndCheckUrl(fieldLink);
|
const fieldValue = await fieldLink.getVisibleText();
|
||||||
|
await fieldLink.click();
|
||||||
|
await retry.try(async () => {
|
||||||
|
await checkUrl(fieldValue);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('applied on discover', async () => {
|
it('applied on discover', async () => {
|
||||||
|
@ -82,9 +82,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
return await testSubjects.isDisplayed(`tableDocViewRow-${fieldName}-value`);
|
return await testSubjects.isDisplayed(`tableDocViewRow-${fieldName}-value`);
|
||||||
});
|
});
|
||||||
const fieldLink = await testSubjects.find(`tableDocViewRow-${fieldName}-value`);
|
const fieldLink = await testSubjects.find(`tableDocViewRow-${fieldName}-value`);
|
||||||
await clickFieldAndCheckUrl(fieldLink);
|
const fieldValue = await fieldLink.getVisibleText();
|
||||||
|
await fieldLink.click();
|
||||||
|
await retry.try(async () => {
|
||||||
|
await checkUrl(fieldValue);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
const windowHandlers = await browser.getAllWindowHandles();
|
const windowHandlers = await browser.getAllWindowHandles();
|
||||||
if (windowHandlers.length > 1) {
|
if (windowHandlers.length > 1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue