mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* The previous retry wouldn't work because 'click' has it's own retry, need to use exists first. * add comment with link to issue * fix wrong function (wish we had typescript!)
This commit is contained in:
parent
e26a77f972
commit
3d7b3973fd
2 changed files with 18 additions and 8 deletions
|
@ -34,11 +34,8 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
await PageObjects.dashboard.clickEdit();
|
||||
|
||||
// Opening legend colors has been flaky.
|
||||
await retry.try(async () => {
|
||||
await PageObjects.visualize.clickLegendOption('Count');
|
||||
await PageObjects.visualize.selectNewLegendColorChoice('#EA6460');
|
||||
});
|
||||
await PageObjects.visualize.openLegendOptionColors('Count');
|
||||
await PageObjects.visualize.selectNewLegendColorChoice('#EA6460');
|
||||
|
||||
await PageObjects.dashboard.saveDashboard('Overridden colors');
|
||||
|
||||
|
@ -194,7 +191,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
describe('for embeddable config color parameters on a visualization', () => {
|
||||
it('updates a pie slice color on a soft refresh', async function () {
|
||||
await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME);
|
||||
await PageObjects.visualize.clickLegendOption('80,000');
|
||||
await PageObjects.visualize.openLegendOptionColors('80,000');
|
||||
await PageObjects.visualize.selectNewLegendColorChoice('#F9D9F9');
|
||||
const currentUrl = await remote.getCurrentUrl();
|
||||
const newUrl = currentUrl.replace('F9D9F9', 'FFFFFF');
|
||||
|
|
|
@ -898,8 +898,21 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
|||
return await Promise.all(legendEntries.map(async chart => await chart.getAttribute('data-label')));
|
||||
}
|
||||
|
||||
async clickLegendOption(name) {
|
||||
await testSubjects.click(`legend-${name}`);
|
||||
async openLegendOptionColors(name) {
|
||||
await retry.try(async () => {
|
||||
// This click has been flaky in opening the legend, hence the retry. See
|
||||
// https://github.com/elastic/kibana/issues/17468
|
||||
await testSubjects.click(`legend-${name}`);
|
||||
// arbitrary color chosen, any available would do
|
||||
const isOpen = await this.doesLegendColorChoiceExist('#EF843C');
|
||||
if (!isOpen) {
|
||||
throw new Error('legend color selector not open');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async doesLegendColorChoiceExist(color) {
|
||||
return await testSubjects.exists(`legendSelectColor-${color}`);
|
||||
}
|
||||
|
||||
async selectNewLegendColorChoice(color) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue