Skip to content

Commit edcc4f7

Browse files
committed
Testing eperson and epersongroup creation
1 parent 32c85cd commit edcc4f7

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

cypress/e2e/create-eperson.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,19 @@ describe('Create Eperson', () => {
1515
// Analyze <ds-eperson-form> for accessibility issues
1616
testA11y('ds-eperson-form');
1717
});
18+
19+
it('should create an EPerson', () => {
20+
const email = `cypress-person-${Date.now()}-${Math.random().toString(36).slice(2)}@example.com`;
21+
22+
// Fill the EPerson details
23+
cy.get('#firstName').type('Smith');
24+
cy.get('#lastName').type('Samanta');
25+
cy.get('#email').type(email);
26+
27+
cy.get('ds-eperson-form ds-form button[type="submit"]').should('not.have.class', 'disabled').click();
28+
29+
// Focus the people search field after returning to the registry
30+
cy.url().should('match', /\/access-control\/epeople$/);
31+
cy.get('#query').focus();
32+
});
1833
});

cypress/e2e/create-group.cy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,17 @@ describe('Create Group', () => {
1515
// Analyze <ds-group-form> for accessibility issues
1616
testA11y('ds-group-form');
1717
});
18+
19+
20+
it('should create an EPersonGroup', () => {
21+
const groupName = `cypress-group-${Date.now()}-${Math.random().toString(36).slice(2)}`;
22+
23+
// Fill the GroupName details
24+
cy.get('#groupName').type(groupName);
25+
//cy.get('#groupDescription').type('Some description');
26+
27+
cy.get('ds-group-form ds-form button[type="submit"]').should('not.have.class', 'disabled').click();
28+
29+
cy.url().should('match', /access-control\/groups\/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}\/edit$/);
30+
});
1831
});

0 commit comments

Comments
 (0)