Skip to content

Commit 7ebbee1

Browse files
committed
Add more test
Signed-off-by: Lin Wang <[email protected]>
1 parent 7f7dddf commit 7ebbee1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cypress/integration/plugins/dashboards-assistant/mds_query_enhancements_suggest_anomaly_detector_spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,28 @@ const testSuggestAD = (url) => {
122122

123123
// Check main UI elements are present
124124
cy.get('[data-test-subj="detectorNameTextInputFlyout"]').should('exist');
125+
cy.get('#add-anomaly-detector__title').should(
126+
'contain',
127+
'Suggested anomaly detector'
128+
);
129+
cy.get('[data-test-subj="detectionInterval"]').should('exist');
130+
cy.get('[data-test-subj="windowDelay"]').should('exist');
131+
132+
cy.get('[id="detectorDetailsAccordion"]')
133+
.parent()
134+
.find('[data-test-subj="accordionTitleButton"]')
135+
.click();
136+
137+
// Test empty name validation
138+
cy.get('[data-test-subj="detectorNameTextInputFlyout"]').clear();
139+
cy.get('[data-test-subj="detectorNameTextInputFlyout"]').blur();
140+
cy.contains('Detector name cannot be empty').should('be.visible');
141+
142+
// Test valid name
143+
cy.get('[data-test-subj="detectorNameTextInputFlyout"]').type(
144+
'test-detector-name' + Math.floor(Math.random() * 100) + 1
145+
);
146+
cy.contains('Detector name cannot be empty').should('not.exist');
125147
});
126148

127149
it('should create detector successfully', () => {

0 commit comments

Comments
 (0)