Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
844188a9
Unverified
Commit
844188a9
authored
9 months ago
by
Nemanja Glumac
Committed by
GitHub
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Preemptively fix the E2E flake in alerty types (#44344)
parent
4ab0cfca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
e2e/test/scenarios/sharing/alert/alert-types.cy.spec.js
+18
-46
18 additions, 46 deletions
e2e/test/scenarios/sharing/alert/alert-types.cy.spec.js
frontend/src/metabase/query_builder/components/AlertModals/AlertModals.jsx
+1
-1
1 addition, 1 deletion
...base/query_builder/components/AlertModals/AlertModals.jsx
with
19 additions
and
47 deletions
e2e/test/scenarios/sharing/alert/alert-types.cy.spec.js
+
18
−
46
View file @
844188a9
...
...
@@ -3,12 +3,7 @@ import {
ORDERS_BY_YEAR_QUESTION_ID
,
ORDERS_QUESTION_ID
,
}
from
"
e2e/support/cypress_sample_instance_data
"
;
import
{
restore
,
setupSMTP
,
visitQuestion
,
leftSidebar
,
}
from
"
e2e/support/helpers
"
;
import
{
restore
,
setupSMTP
,
visitQuestion
}
from
"
e2e/support/helpers
"
;
const
{
PEOPLE
,
PEOPLE_ID
}
=
SAMPLE_DATABASE
;
...
...
@@ -73,41 +68,27 @@ describe("scenarios > alert > types", { tags: "@external" }, () => {
describe
(
"
goal based alerts
"
,
()
=>
{
it
(
"
should work for timeseries questions with a set goal
"
,
()
=>
{
// Set goal on timeseries question
visitQuestion
(
timeSeriesQuestionId
);
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Visualization
"
).
click
();
leftSidebar
().
within
(()
=>
{
cy
.
icon
(
"
line
"
).
realHover
();
cy
.
icon
(
"
gear
"
).
click
();
cy
.
request
(
"
PUT
"
,
`/api/card/
${
timeSeriesQuestionId
}
`
,
{
visualization_settings
:
{
"
graph.show_goal
"
:
true
,
"
graph.goal_value
"
:
7000
,
"
graph.dimensions
"
:
[
"
CREATED_AT
"
],
"
graph.metrics
"
:
[
"
count
"
],
},
});
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Line options
"
);
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Display
"
).
click
();
setGoal
(
"
7000
"
);
// Save question
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Save
"
).
click
();
cy
.
findByTestId
(
"
save-question-modal
"
).
within
(
modal
=>
{
cy
.
findByText
(
"
Save
"
).
click
();
});
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Save question
"
).
should
(
"
not.exist
"
);
cy
.
log
(
"
Set the goal on timeseries question
"
);
visitQuestion
(
timeSeriesQuestionId
);
cy
.
findByTestId
(
"
chart-container
"
).
should
(
"
contain
"
,
"
Goal
"
);
openAlertModal
();
cy
.
findByTestId
(
"
alert-create
"
).
within
(()
=>
{
cy
.
findByText
(
"
Reaches the goal line
"
).
click
();
cy
.
findByText
(
"
The first time
"
).
click
();
cy
.
button
(
"
Done
"
).
click
();
});
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
Reaches the goal line
"
).
click
();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy
.
findByText
(
"
The first time
"
).
click
();
cy
.
button
(
"
Done
"
).
click
();
// Check the API response
cy
.
log
(
"
Check the API response
"
);
cy
.
wait
(
"
@savedAlert
"
).
then
(({
response
:
{
body
}
})
=>
{
expect
(
body
.
alert_condition
).
to
.
equal
(
"
goal
"
);
expect
(
body
.
alert_above_goal
).
to
.
equal
(
true
);
...
...
@@ -139,14 +120,5 @@ describe("scenarios > alert > types", { tags: "@external" }, () => {
function
openAlertModal
()
{
cy
.
icon
(
"
bell
"
).
click
();
cy
.
findByText
(
"
Set up an alert
"
).
click
();
}
function
setGoal
(
goal
)
{
// Enable the toggle
cy
.
findByText
(
"
Goal line
"
).
next
().
click
();
cy
.
findByDisplayValue
(
"
0
"
).
clear
().
type
(
goal
);
cy
.
button
(
"
Done
"
).
click
();
cy
.
findByText
(
"
Set up an alert
"
).
should
(
"
be.visible
"
).
click
();
}
This diff is collapsed.
Click to expand it.
frontend/src/metabase/query_builder/components/AlertModals/AlertModals.jsx
+
1
−
1
View file @
844188a9
...
...
@@ -153,7 +153,7 @@ class CreateAlertModalContentInner extends Component {
// TODO: Remove PulseEdit css hack
return
(
<
ModalContent
onClose
=
{
onCancel
}
>
<
ModalContent
data-testid
=
"alert-create"
onClose
=
{
onCancel
}
>
<
div
className
=
{
cx
(
CS
.
mlAuto
,
CS
.
mrAuto
,
CS
.
mb4
)
}
style
=
{
{
maxWidth
:
"
550px
"
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment