Skip to content

Commit b2776d8

Browse files
committed
chore: update e2e tests with the new docs structure
1 parent df0796a commit b2776d8

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

cypress/e2e/DataView.spec.cy.ts

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ describe('Test the Data view docs page', () => {
33
it('displays a layout with a table and paginates', () => {
44
const ouiaId = 'LayoutExample';
55

6-
cy.visit('http://localhost:8006/extensions/data-view/layout');
6+
cy.visit('http://localhost:8006/extensions/data-view/data-view');
77

8+
cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).scrollIntoView().contains('Repositories');
89
cy.get(`[data-ouia-component-id="${ouiaId}Header-pagination"]`).should('exist');
910
cy.get(`[data-ouia-component-id="${ouiaId}Header-bulk-select"]`).should('exist');
1011

@@ -27,11 +28,17 @@ describe('Test the Data view docs page', () => {
2728
cy.get(`[data-ouia-component-id="${ouiaId}-td-0-4"]`).contains('Timestamp one');
2829

2930
// test bulk select
30-
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('not.be.checked')});
31+
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
32+
.each(($checkbox) => {
33+
cy.wrap($checkbox).should('not.be.checked');
34+
});
3135

3236
// page checkbox select
3337
cy.get(`[data-ouia-component-id="BulkSelect-checkbox"`).first().click();
34-
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('be.checked')});
38+
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
39+
.each(($checkbox) => {
40+
cy.wrap($checkbox).should('be.checked');
41+
});
3542
cy.contains('5 selected').should('exist');
3643

3744
// select none
@@ -42,18 +49,27 @@ describe('Test the Data view docs page', () => {
4249
// select all
4350
cy.get(`[data-ouia-component-id="BulkSelect-toggle"`).first().click({ force: true });
4451
cy.get(`[data-ouia-component-id="BulkSelect-select-all"`).first().click();
45-
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('be.checked')});
52+
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
53+
.each(($checkbox) => {
54+
cy.wrap($checkbox).should('be.checked');
55+
});
4656
cy.contains('6 selected').should('exist');
4757

4858
// page checkbox deselect
4959
cy.get(`[data-ouia-component-id="BulkSelect-checkbox"`).first().click();
50-
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('not.be.checked')});
60+
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
61+
.each(($checkbox) => {
62+
cy.wrap($checkbox).should('not.be.checked');
63+
});
5164
cy.contains('1 selected').should('exist');
5265

5366
// select page
5467
cy.get(`[data-ouia-component-id="BulkSelect-toggle"`).first().click({ force: true });
5568
cy.get(`[data-ouia-component-id="BulkSelect-select-page"`).first().click();
56-
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('be.checked')});
69+
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
70+
.each(($checkbox) => {
71+
cy.wrap($checkbox).should('be.checked');
72+
});
5773
cy.contains('6 selected').should('exist');
5874
})
5975
});

cypress/e2e/DataViewEvents.spec.cy.ts renamed to cypress/e2e/DataViewEventsContext.spec.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ describe('Test the Data view docs page', () => {
33
it('displays a table and opens detail', () => {
44
const ouiaId = 'ContextExample';
55

6-
cy.visit('http://localhost:8006/extensions/data-view/events-context');
6+
cy.visit('http://localhost:8006/extensions/data-view/data-view');
77

8-
cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).contains('Repositories');
8+
cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).scrollIntoView().contains('Repositories');
99
cy.get(`[data-ouia-component-id="${ouiaId}-th-4"]`).contains('Last commit');
1010

1111
cy.get(`[data-ouia-component-id="${ouiaId}-td-0-0"]`).contains('Repository one');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ describe('Test the Data view docs with tree table', () => {
33
it('displays a a components page with tree table', () => {
44
const ouiaId = 'TreeTableExample';
55

6-
cy.visit('http://localhost:8006/extensions/data-view/components');
6+
cy.visit('http://localhost:8006/extensions/data-view/table');
77

88
cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).scrollIntoView().contains('Repositories');
99
cy.get(`[data-ouia-component-id="${ouiaId}-th-1"]`).contains('Branches');

0 commit comments

Comments
 (0)