Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
1c865b5b
Unverified
Commit
1c865b5b
authored
Oct 05, 2020
by
Steven Vachon
Committed by
GitHub
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@grafana/e2e: timing improvements (#27861)
parent
7c299970
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
14 deletions
+28
-14
packages/grafana-e2e/src/flows/configurePanel.ts
+28
-14
No files found.
packages/grafana-e2e/src/flows/configurePanel.ts
View file @
1c865b5b
...
...
@@ -127,23 +127,15 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
});
}
// @todo instead wait for '@pluginModule'
// @todo instead wait for '@pluginModule'
if not already loaded
e2e
().
wait
(
2000
);
// 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)
// @todo this may not be necessary anymore
e2e
()
.
get
(
'.refresh-picker-buttons .btn'
)
.
first
()
.
click
({
force
:
true
});
e2e
().
wait
(
'@chartData'
);
}
if
(
!
isExplore
)
{
if
(
!
isEdit
)
{
// Fields could be covered due to an empty query editor
closeRequestErrors
();
}
// `panelTitle` is needed to edit the panel, and unlikely to have its value changed at that point
const
changeTitle
=
panelTitle
&&
!
isEdit
;
...
...
@@ -164,6 +156,9 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
e2e
.
components
.
PluginVisualization
.
item
(
visualizationName
)
.
scrollIntoView
()
.
click
();
// @todo wait for '@pluginModule' if not a core visualization and not already loaded
e2e
().
wait
(
2000
);
}
// Consistently closed
...
...
@@ -245,6 +240,25 @@ const closeOptionsGroup = (name: string): any =>
}
});
const
closeRequestErrors
=
()
=>
{
e2e
().
wait
(
1000
);
// emulate `cy.get()` for nested errors
e2e
()
.
get
(
'app-notifications-list'
)
.
then
(
$elm
=>
{
// Avoid failing when none are found
const
selector
=
'[aria-label="Alert error"]:contains("Failed to call resource")'
;
const
numErrors
=
$elm
.
find
(
selector
).
length
;
for
(
let
i
=
0
;
i
<
numErrors
;
i
++
)
{
e2e
()
.
get
(
selector
)
.
first
()
.
find
(
'button'
)
.
click
();
}
});
};
const
getOptionsGroup
=
(
name
:
string
)
=>
e2e
().
get
(
`.options-group:has([aria-label="Options group Panel
${
name
}
"])`
);
// @todo this actually returns type `Cypress.Chainable`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment