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
f38e4316
Unverified
Commit
f38e4316
authored
Sep 25, 2020
by
Steven Vachon
Committed by
GitHub
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@grafana/e2e: selectOption flow now accepts a config object (#27827)
parent
1dc658f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
+29
-5
packages/grafana-e2e/src/flows/configurePanel.ts
+4
-1
packages/grafana-e2e/src/flows/selectOption.ts
+19
-3
packages/grafana-e2e/src/flows/setTimeRange.ts
+6
-1
No files found.
packages/grafana-e2e/src/flows/configurePanel.ts
View file @
f38e4316
...
@@ -121,7 +121,10 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
...
@@ -121,7 +121,10 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
.
as
(
'chartData'
);
.
as
(
'chartData'
);
if
(
dataSourceName
)
{
if
(
dataSourceName
)
{
selectOption
(
e2e
.
components
.
DataSourcePicker
.
container
(),
dataSourceName
);
selectOption
({
container
:
e2e
.
components
.
DataSourcePicker
.
container
(),
optionText
:
dataSourceName
,
});
}
}
// @todo instead wait for '@pluginModule'
// @todo instead wait for '@pluginModule'
...
...
packages/grafana-e2e/src/flows/selectOption.ts
View file @
f38e4316
import
{
e2e
}
from
'../index'
;
import
{
e2e
}
from
'../index'
;
export
interface
SelectOptionConfig
{
clickToOpen
?:
boolean
;
container
:
any
;
forceClickOption
?:
boolean
;
optionText
:
string
|
RegExp
;
}
// @todo this actually returns type `Cypress.Chainable`
// @todo this actually returns type `Cypress.Chainable`
export
const
selectOption
=
(
select
:
any
,
optionText
:
string
|
RegExp
,
clickToOpen
=
true
):
any
=>
export
const
selectOption
=
(
config
:
SelectOptionConfig
):
any
=>
{
select
.
within
(()
=>
{
const
fullConfig
:
SelectOptionConfig
=
{
clickToOpen
:
true
,
forceClickOption
:
false
,
...
config
,
};
const
{
clickToOpen
,
container
,
forceClickOption
,
optionText
}
=
fullConfig
;
return
container
.
within
(()
=>
{
if
(
clickToOpen
)
{
if
(
clickToOpen
)
{
e2e
()
e2e
()
.
get
(
'[class$="-input-suffix"]'
)
.
get
(
'[class$="-input-suffix"]'
)
...
@@ -20,8 +35,9 @@ export const selectOption = (select: any, optionText: string | RegExp, clickToOp
...
@@ -20,8 +35,9 @@ export const selectOption = (select: any, optionText: string | RegExp, clickToOp
}
}
})
})
.
scrollIntoView
()
.
scrollIntoView
()
.
click
();
.
click
(
{
force
:
forceClickOption
}
);
e2e
()
e2e
()
.
root
()
.
root
()
.
scrollIntoView
();
.
scrollIntoView
();
});
});
};
packages/grafana-e2e/src/flows/setTimeRange.ts
View file @
f38e4316
...
@@ -16,7 +16,12 @@ export const setTimeRange = ({ from, to, zone }: TimeRangeConfig) => {
...
@@ -16,7 +16,12 @@ export const setTimeRange = ({ from, to, zone }: TimeRangeConfig) => {
e2e
()
e2e
()
.
contains
(
'button'
,
'Change time zone'
)
.
contains
(
'button'
,
'Change time zone'
)
.
click
();
.
click
();
selectOption
(
e2e
.
components
.
TimeZonePicker
.
container
(),
zone
,
false
);
selectOption
({
clickToOpen
:
false
,
container
:
e2e
.
components
.
TimeZonePicker
.
container
(),
optionText
:
zone
,
});
}
}
// For smaller screens
// For smaller screens
...
...
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