This repository has been archived by the owner on Oct 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #862 from UserOfficeProject/release-14-04-2022
Release 14 04 2022
- Loading branch information
Showing
103 changed files
with
2,871 additions
and
1,378 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import initialDBData from '../support/initialDBData'; | ||
|
||
context('Experiments tests', () => { | ||
before(() => { | ||
cy.resetDB(true); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.viewport(1920, 1080); | ||
cy.resetDB(true); | ||
cy.updateProposalManagementDecision({ | ||
proposalPk: initialDBData.proposal.id, | ||
statusId: 1, | ||
managementTimeAllocation: 5, | ||
managementDecisionSubmitted: true, | ||
}); | ||
cy.createEsi({ | ||
scheduledEventId: initialDBData.scheduledEvents.upcoming.id, | ||
}); | ||
cy.createVisit({ | ||
scheduledEventId: initialDBData.scheduledEvents.upcoming.id, | ||
team: [initialDBData.users.user1.id], | ||
teamLeadUserId: initialDBData.users.user1.id, | ||
}); | ||
}); | ||
|
||
describe('Experiments tests', () => { | ||
it('Can filter by call and instrument', () => { | ||
cy.login('officer'); | ||
cy.visit('/'); | ||
cy.get('[data-cy=officer-menu-items]').contains('Experiments').click(); | ||
cy.get('[value=NONE]').click(); | ||
|
||
cy.get('[data-cy=call-filter]').click(); | ||
cy.get('[role=presentation]').contains('call 1').click(); | ||
cy.contains('1-4 of 4'); | ||
|
||
cy.get('[data-cy=instrument-filter]').click(); | ||
cy.get('[role=presentation]').contains('Instrument 3').click(); | ||
cy.contains('0-0 of 0'); | ||
|
||
cy.get('[data-cy=instrument-filter]').click(); | ||
cy.get('[role=presentation]').contains('Instrument 2').click(); | ||
cy.contains('0-0 of 0'); | ||
|
||
cy.get('[data-cy=instrument-filter]').click(); | ||
cy.get('[role=presentation]').contains('Instrument 1').click(); | ||
cy.contains('1-4 of 4'); | ||
}); | ||
|
||
it('Can filter by date', () => { | ||
cy.login('officer'); | ||
cy.visit('/'); | ||
cy.get('[data-cy=officer-menu-items]').contains('Experiments').click(); | ||
|
||
cy.get('[value=TODAY]').click(); | ||
cy.contains('0-0 of 0'); | ||
|
||
cy.get('[value=NONE]').click(); | ||
cy.contains('1-4 of 4'); | ||
}); | ||
|
||
it('Can view ESI', () => { | ||
cy.login('officer'); | ||
cy.visit('/'); | ||
cy.get('[data-cy=officer-menu-items]').contains('Experiments').click(); | ||
cy.get('[value=NONE]').click(); | ||
|
||
cy.get('[data-cy=officer-scheduled-events-table]') | ||
.contains('View ESI') | ||
.click(); | ||
cy.get('[role=dialog]').contains(initialDBData.proposal.title); | ||
}); | ||
|
||
it('Can view visits', () => { | ||
cy.login('officer'); | ||
cy.visit('/'); | ||
cy.get('[data-cy=officer-menu-items]').contains('Experiments').click(); | ||
cy.get('[value=NONE]').click(); | ||
|
||
cy.finishedLoading(); | ||
|
||
cy.get('[data-cy=officer-scheduled-events-table] Table button') | ||
.first() | ||
.click(); | ||
cy.get('[data-cy=officer-scheduled-events-table]').contains( | ||
initialDBData.users.user1.lastName | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.