[maps] unskip Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps/group4/lens/choropleth_chart·ts (#154474)

Fixes https://github.com/elastic/kibana/issues/154065

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2092

Tests failing because of lack of EMS access. The test requires EMS
access. Fix is to add check for EMS so failure message points to failure
cause. This data can be used to help track faulty CI environments where
EMS is not available.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2023-04-06 09:44:36 -06:00 committed by GitHub
parent 1af1ff1a4d
commit 2a4415f1a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 4 deletions

View file

@ -323,4 +323,12 @@ export class ComboBoxService extends FtrService {
const input = await comboBoxElement.findByTagName('input');
await input.clearValueWithKeyboard();
}
public async isDisabled(comboBoxElement: WebElementWrapper): Promise<boolean> {
this.log.debug(`comboBox.isDisabled`);
const toggleListButton = await comboBoxElement.findByTestSubject('comboBoxToggleListButton');
const isDisabled = await toggleListButton.getAttribute('disabled');
this.log.debug(`isDisabled:${isDisabled}`);
return isDisabled?.toLowerCase() === 'true';
}
}

View file

@ -98,7 +98,7 @@ export class EMSFileSelect extends Component<Props, State> {
isClearable={false}
singleSelection={true}
isDisabled={this.state.emsFileOptions.length === 0}
data-test-subj="emsVectorComboBox"
data-test-subj="emsFileSelect"
/>
);
}

View file

@ -13,9 +13,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const filterBar = getService('filterBar');
// Failing: See https://github.com/elastic/kibana/issues/154065
// Failing: See https://github.com/elastic/kibana/issues/154064
describe.skip('choropleth chart', () => {
// Test requires access to Elastic Maps Service
// Do not skip test if failure is "Test requires access to Elastic Maps Service (EMS). EMS is not available"
describe('choropleth chart', () => {
before('', async () => {
await PageObjects.maps.expectEmsToBeAvailable();
});
it('should allow creation of choropleth chart', async () => {
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVisType('lens');

View file

@ -44,6 +44,26 @@ export class GisPageObject extends FtrService {
this.basePath = basePath;
}
async expectEmsToBeAvailable() {
this.log.debug(`expectEmsToBeAvailable`);
await this.openNewMap();
await this.clickAddLayer();
await this.testSubjects.click('emsBoundaries');
try {
const emsFileElement = await this.testSubjects.find('emsFileSelect', 120000); // large timeout for EMS request
if (!emsFileElement) {
throw new Error('Unable to find EMS file select');
}
const isDisabled = await this.comboBox.isDisabled(emsFileElement);
if (isDisabled) {
throw new Error('EMS file select is disabled');
}
} catch (e) {
this.log.debug(`EMS is not available, error: ${e.message}`);
throw new Error('Test requires access to Elastic Maps Service (EMS). EMS is not available');
}
}
async setAbsoluteRange(start: string, end: string) {
await this.timePicker.setAbsoluteRange(start, end);
await this.waitForLayersToLoad();