@grafana/e2e: flaky chart data workaround (#27687)

Don't expect initial chart data when creating a panel that hasn't yet populated its query editor
This commit is contained in:
Steven Vachon 2020-09-21 19:40:23 -04:00 committed by GitHub
parent 98f7a2ace0
commit abb015bad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,15 +127,20 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
// @todo instead wait for '@pluginModule' // @todo instead wait for '@pluginModule'
e2e().wait(2000); e2e().wait(2000);
if (!isExplore) { // There is no usable data when the query is empty,
// and Cypress had an issue with some plugins where the request wasn't noticed, despite occuring in manual tests
if (isEdit) {
// Avoid cache flakiness (where @chartData isn't requested) // Avoid cache flakiness (where @chartData isn't requested)
// @todo this may not be necessary anymore
e2e() e2e()
.get('.refresh-picker-buttons .btn') .get('.refresh-picker-buttons .btn')
.first() .first()
.click({ force: true }); .click({ force: true });
e2e().wait('@chartData'); e2e().wait('@chartData');
}
if (!isExplore) {
// `panelTitle` is needed to edit the panel, and unlikely to have its value changed at that point // `panelTitle` is needed to edit the panel, and unlikely to have its value changed at that point
const changeTitle = panelTitle && !isEdit; const changeTitle = panelTitle && !isEdit;