Skip to content

Commit

Permalink
Remove delays from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peyman-mohtashami committed Nov 9, 2021
1 parent d1324ea commit 9ac3bd3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/main/webapp/app/shared/subject/subject.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ export class SubjectComponent implements OnInit, OnDestroy, OnChanges {
} else {
this.dateOfBirthError = true;
}
} else {
this.filterTriggerUpdate$.next(field);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ describe('Subject e2e test', () => {
});

it('should load create Subject dialog', () => {
cy.wait(1000);
cy.get('jhi-subjects button.create-subject').click();
cy.get('jhi-subject-dialog h4.modal-title').first().should('have.text', 'Create or edit a Subject');
cy.get('jhi-subject-dialog button.close').click();
});

it('should be able to create new subject', () => {
cy.wait(1000);
cy.get('jhi-subjects button.create-subject').click();
cy.get('jhi-subject-dialog input[name=externalLink]').type('https://radar-base-test.org');
cy.get('jhi-subject-dialog input[name=externalId]').type('test-subject-1');
Expand All @@ -33,15 +31,13 @@ describe('Subject e2e test', () => {
});

it('should be able to edit a subject', () => {
cy.wait(1000);
cy.contains('jhi-subjects .subject-row', 'test-subject-1').contains('button', 'Edit').click();
cy.get('jhi-subject-dialog input[name=externalLink]').clear().type('https://radar-base-test-edited.org');
cy.contains('jhi-subject-dialog button.btn-primary', 'Save').click();
cy.get('jhi-subjects .subject-row').should('have.length', 20);
});

it('should have load subject row with subject-id, external-id, status, project, sources and attributes columns', () => {
cy.wait(1000);
cy.get('jhi-subjects .subject-row').first().find('.subject-row__select-row input')
.invoke('attr', 'type')
.should('eq', 'checkbox')
Expand Down Expand Up @@ -80,23 +76,20 @@ describe('Subject e2e test', () => {
})

it('should be able to filter subjects by subject id', () => {
cy.wait(1000);
cy.get('#field-subject-id').type('b-1');
cy.get('jhi-subjects .subject-row').should('have.length', 11);
cy.get('#field-subject-id').clear();
cy.get('jhi-subjects .subject-row').should('have.length', 20);
});

it('should be able to filter subjects by subject external id', () => {
cy.wait(1000);
cy.get('#field-subject-external-id').type('test-subject-1');
cy.get('jhi-subjects .subject-row').should('have.length', 1);
cy.get('#field-subject-external-id').clear();
cy.get('jhi-subjects .subject-row').should('have.length', 20);
});

it('should be able to filter subjects by human readable id', () => {
cy.wait(1000);
cy.get('#advanced-filter').click();
cy.get('#field-human-readable-id').type('Test');
cy.get('jhi-subjects .subject-row').should('have.length', 1);
Expand All @@ -106,7 +99,6 @@ describe('Subject e2e test', () => {
});

it('should be able to filter subjects by person name', () => {
cy.wait(1000);
cy.get('#advanced-filter').click();
cy.get('#field-person-name').type('Test');
cy.get('jhi-subjects .subject-row').should('have.length', 1);
Expand All @@ -118,7 +110,6 @@ describe('Subject e2e test', () => {
// TODO Filter by group

it('should be able to filter subjects by date of birth', () => {
cy.wait(1000);
cy.get('#advanced-filter').click();
cy.get('#field_date_of_birth').type('1980-01-01');
cy.get('jhi-subjects .subject-row').should('have.length', 1);
Expand All @@ -130,7 +121,6 @@ describe('Subject e2e test', () => {
// TODO Filter by Enrollment Date

it('should be able to sort subjects by subject id in asc/desc order', () => {
cy.wait(1000);
cy.get('jhi-subjects #field-order-by').click();
cy.get('jhi-subjects #order-by-desc').click();
cy.get('jhi-subjects .subject-row').first().should('contain.text', 'sub-9');
Expand All @@ -141,7 +131,6 @@ describe('Subject e2e test', () => {


it('should be able to sort subjects by external id in asc/desc order', () => {
cy.wait(1000);
cy.get('jhi-subjects #field-sort-by').click();
cy.get('jhi-subjects #sort-by-externalId').click();
cy.get('jhi-subjects .subject-row').first().should('contain.text', 'sub-1');
Expand All @@ -151,30 +140,26 @@ describe('Subject e2e test', () => {
});

it('should be able to delete a subject without source', () => {
cy.wait(1000);
cy.contains('jhi-subjects .subject-row', 'test-subject-1').find('a').first().click();
cy.contains('jhi-subject-detail button', 'Delete').click();
cy.contains('jhi-subject-delete-dialog button', 'Delete').click();
cy.get('jhi-subjects .subject-row').should('have.length', 20);
});

it('should be able to delete a group', () => {
cy.wait(1000);
cy.contains('jhi-project-detail ul.nav-tabs .nav-item', 'Groups').click();
cy.contains('jhi-groups .group-row', 'Test Group C').contains('button', 'Delete').click();
cy.contains('jhi-group-delete-dialog button', 'Delete').click();
cy.get('jhi-groups .group-row').should('have.length', 2);
});

it('should show number of loaded subjects and total number of subjects', () => {
cy.wait(1000);
cy.contains('jhi-project-detail ul.nav-tabs .nav-item', 'Subjects').click();
cy.get('jhi-subjects a.subject-pagination__load-more').should('have.text', 'Load more (20/25 shown)');
cy.get('jhi-subjects .subject-row').should('have.length', 20);
});

it('should be able to load subjects on loadMore click', () => {
cy.wait(1000);
cy.get('jhi-subjects a.subject-pagination__load-more').click();
cy.get('jhi-subjects span.subject-pagination__all-loaded').should('have.text', 'All 25 subjects loaded');
cy.get('jhi-subjects .subject-row').should('have.length', 25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ describe('Project view: Generate QR code', () => {
});

it('should open pair app dialog', () => {
cy.wait(1000);
cy.contains('button', 'Pair App').first().click();
cy.get('[name=pairForm]').find('h4').first()
.should('have.text', 'Pair an application');
Expand Down

0 comments on commit 9ac3bd3

Please sign in to comment.