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
75a714aa
Unverified
Commit
75a714aa
authored
Jun 30, 2020
by
Steven Vachon
Committed by
GitHub
Jun 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added options to customize chart data listening (#25918)
parent
810ec4c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
packages/grafana-e2e/src/flows/addPanel.ts
+10
-2
No files found.
packages/grafana-e2e/src/flows/addPanel.ts
View file @
75a714aa
...
@@ -4,6 +4,10 @@ import { getScenarioContext } from '../support/scenarioContext';
...
@@ -4,6 +4,10 @@ import { getScenarioContext } from '../support/scenarioContext';
import
{
selectOption
}
from
'./selectOption'
;
import
{
selectOption
}
from
'./selectOption'
;
export
interface
AddPanelConfig
{
export
interface
AddPanelConfig
{
chartData
:
{
method
:
string
;
route
:
string
|
RegExp
;
};
dashboardUid
:
string
;
dashboardUid
:
string
;
dataSourceName
:
string
;
dataSourceName
:
string
;
queriesForm
:
(
config
:
AddPanelConfig
)
=>
void
;
queriesForm
:
(
config
:
AddPanelConfig
)
=>
void
;
...
@@ -16,6 +20,10 @@ export interface AddPanelConfig {
...
@@ -16,6 +20,10 @@ export interface AddPanelConfig {
export
const
addPanel
=
(
config
?:
Partial
<
AddPanelConfig
>
):
any
=>
export
const
addPanel
=
(
config
?:
Partial
<
AddPanelConfig
>
):
any
=>
getScenarioContext
().
then
(({
lastAddedDashboardUid
,
lastAddedDataSource
}:
any
)
=>
{
getScenarioContext
().
then
(({
lastAddedDashboardUid
,
lastAddedDataSource
}:
any
)
=>
{
const
fullConfig
=
{
const
fullConfig
=
{
chartData
:
{
method
:
'POST'
,
route
:
'/api/ds/query'
,
},
dashboardUid
:
lastAddedDashboardUid
,
dashboardUid
:
lastAddedDashboardUid
,
dataSourceName
:
lastAddedDataSource
,
dataSourceName
:
lastAddedDataSource
,
panelTitle
:
`e2e-
${
Date
.
now
()}
`
,
panelTitle
:
`e2e-
${
Date
.
now
()}
`
,
...
@@ -25,7 +33,7 @@ export const addPanel = (config?: Partial<AddPanelConfig>): any =>
...
@@ -25,7 +33,7 @@ export const addPanel = (config?: Partial<AddPanelConfig>): any =>
...
config
,
...
config
,
}
as
AddPanelConfig
;
}
as
AddPanelConfig
;
const
{
dashboardUid
,
dataSourceName
,
panelTitle
,
queriesForm
,
visualizationName
}
=
fullConfig
;
const
{
chartData
,
dashboardUid
,
dataSourceName
,
panelTitle
,
queriesForm
,
visualizationName
}
=
fullConfig
;
e2e
.
flows
.
openDashboard
({
uid
:
dashboardUid
});
e2e
.
flows
.
openDashboard
({
uid
:
dashboardUid
});
e2e
.
pages
.
Dashboard
.
Toolbar
.
toolbarItems
(
'Add panel'
).
click
();
e2e
.
pages
.
Dashboard
.
Toolbar
.
toolbarItems
(
'Add panel'
).
click
();
...
@@ -36,7 +44,7 @@ export const addPanel = (config?: Partial<AddPanelConfig>): any =>
...
@@ -36,7 +44,7 @@ export const addPanel = (config?: Partial<AddPanelConfig>): any =>
// @todo alias '/**/*.js*' as '@pluginModule' when possible: https://github.com/cypress-io/cypress/issues/1296
// @todo alias '/**/*.js*' as '@pluginModule' when possible: https://github.com/cypress-io/cypress/issues/1296
e2e
()
e2e
()
.
route
(
'POST'
,
'/api/ds/query'
)
.
route
(
chartData
.
method
,
chartData
.
route
)
.
as
(
'chartData'
);
.
as
(
'chartData'
);
selectOption
(
e2e
.
components
.
DataSourcePicker
.
container
(),
dataSourceName
);
selectOption
(
e2e
.
components
.
DataSourcePicker
.
container
(),
dataSourceName
);
...
...
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