Skip to content

Commit a0a7779

Browse files
Added samplecypress test to validate selectAccordianItem cypress command
1 parent be6345b commit a0a7779

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* eslint-disable no-undef */
2+
3+
describe('Validate clickItem', () => {
4+
beforeEach(() => {
5+
cy.login();
6+
cy.menu('Settings', 'Application Settings');
7+
});
8+
9+
it('should fail when an invalid node label is passed', (done) => {
10+
cy.accordion('Access Control');
11+
12+
cy.on('fail', (err) => {
13+
expect(err.message).to.include('not found');
14+
done();
15+
});
16+
17+
cy.selectAccordionItem([
18+
'ManageIQ Region: Region 0 [0]',
19+
'Tenants',
20+
'No Company', // This label does not exist
21+
]);
22+
});
23+
24+
it('should support path arrays containing both exact strings and regex patterns', () => {
25+
cy.accordion('Settings');
26+
cy.selectAccordionItem([
27+
/^ManageIQ Region/,
28+
'Zones',
29+
/^Zone: Default/,
30+
'Server: EVM [1] (current)',
31+
]);
32+
});
33+
34+
it('should not collapse already expanded node', () => {
35+
cy.accordion('Settings');
36+
cy.selectAccordionItem([
37+
/^ManageIQ Region/,
38+
'Zones',
39+
/^Zone: Default/,
40+
'Server: EVM [1] (current)',
41+
]);
42+
// Above path is already expanded, so this should not collapse it
43+
cy.selectAccordionItem([
44+
/^ManageIQ Region/,
45+
'Zones',
46+
/^Zone: Default/,
47+
'Server: EVM [1] (current)',
48+
]);
49+
});
50+
});

0 commit comments

Comments
 (0)