Testing scripts - GeoscienceAustralia/egeodesy GitHub Wiki
Write test cases that we can work through manually at first and then (eventually) write end-to-end tests for.
From https://gaautobots.atlassian.net/browse/GEOD-499.
Login / User rights
Not logged in
- Log out if in already
- Open a site
- Expected:
- The form is populated
- All headers are either blue indicating everything is pristine or red indicating there are invalid items contained. But none is green indicating something is dirty.
- All fields and buttons are disabled
- Save and revert are disabled
- There is a 'login' link
Logged in as user that has edit rights to site 'A'
- Log in as user that has edit rights to 'ADE1'
- Expected:
- Every field is enabled and can be edited
- 'save' and 'revert' are disabled
- There is a 'logout' link
- Modify a field
- Expected:
- 'save' and 'revert' are enabled
- Save the form
- Reload 'ADE1'
- Expected:
- the field previously changed before has the changed value
Optional Single Item Group
- "OSIG" - (0 to 1 exists)
- Site Owner and Site Data Source are the only instances of a single item group
Create OSIG
- Log in as user that has edit rights to 'ADE1'
- Assumption: A Site Owner DOES NOT EXIST. If one already exists delete it (See Delete existing OSIG)
- Initial State -
- The Group Header Bar with words "Site Owner" is blue to indicate it is pristine
- The Group Header Bar only contains the words "Site Owner"
- The Group Header Bar contains a button titled "New Site Owner"
- The Group box contains the text "No information available for Site Owner"
- Click 'New Site Owner'
- Expect:
- The Group Header Bar is red/yellow to indicate it is invalid
- The parent Site Information Bar is red
- The 'Individual Name' field has a red ring
- Below the 'Individual Name' field is the words "Field Required" in red
- (1) There is a 'Cancel' button (see [Create and Cancel OSIG](#Create and Cancel OSIG))
- Type a name into the 'Individual Name' field
- Expect:
- The Group Header Bar is green to indicate it is dirty
- The parent Site Information Bar is green
- The 'Individual Name' field is green
- The words "Field Required" have disappeared
- The 'Cancel' button still exists
- Click the 'Save' link
- Click the 'YES' button in the save confirmation modal dialog
- Expect:
- The Group Header Bar is blue to indicate it is pristine and valid
- The parent Site Information Bar is blue
- The 'Individual Name' field is white / clear
- A 'Delete' button exists
Create and Cancel OSIG
- Follow [Create OSIG](#Create OSIG)
- Click 'Cancel'
- Expected:
- The Group Header Bar with words "Site Owner" returns to blue to indicate it is pristine
- The Group Header Bar only contains the words "Site Owner" - the text "(marked to delete)" on the bar OR underneath it has disappeared
- The Group Header Bar contains a button titled "New Site Owner"
- The Group box contains the text "No information available for Site Owner"
Delete existing OSIG
- Log in as user that has edit rights to 'ADE1'
- Assumption: A Site Owner EXISTS. If not create a new one (perform test "Single Item group > Create")
- Click the delete button for Site Owner
- Click the YES to confirm the delete
- Expected:
- The Group Header Bar with words "Site Owner" is Green to indicate it is dirty
- The Group Header Bar with words "Site Owner" contains the text "(marked to delete)" - OR this text is underneath the bar. This may or may not change.
- All fields are visible and disabled
- The delete button is visible and disabled
- Click the save link
- Click the 'YES' button in the save confirmation modal dialog
- Expected:
- The Group Header Bar with words "Site Owner" returns to blue to indicate it is pristine
- The Group Header Bar only contains the words "Site Owner" - the text "(marked to delete)" on the bar OR underneath it has disappeared
- The Group Header Bar contains a button titled "New Site Owner"
- The Group box contains the text "No information available for Site Owner"
Create and Delete in same session OSIG
- Follow [Create OSIG](#Create OSIG) to the end
- Follow [Delete existing OSIG](#Delete existing OSIG) to the end
Mandatory Single Item Group
- MSIG
- Site Metadata Custodian is the only instance
Default and only state MSIG
- Log in as user that has edit rights to 'ADE1'
- Expected:
- The Site Metadata Custodian exists (may be blank)
- There is no 'delete' button
Multi-Item Group
- "MIG" - (0, 1 or more exists)
- Almost everything is a multi-item group:
- Site Contacts
- Site Data Centers
- GNSS Receivers
- GNSS Antennas
- ... and everything else
Create first item MIG
- Log in as user that has edit rights to 'ADE1'
- Assumptions:
- We will work with GNSS Antennas
- No GNSS Antennas EXIST. If there are any, delete them (See [Delete first item MIG](#Delete first item MIG))
- Initial State:
- The Group Header Bar contains the words "Group Antennas" (and no others)
- The Group Header Bar is blue to indicate it is pristine
- The Group Header Bar contains a button titled "New Antenna"
- The Group box contains the text "No information available for GNSS Antenna"
- Click 'New Site Antenna'
- Expect:
- The Group Header Bar is red to indicate it is invalid
- The Item Header Bar has appeared (it is new)
- The Item Header Bar is red/yellow to indicate it is invalid
- The 'Antenna Reference Point' field (and maybe others) has a red ring
- Below the 'Antenna Reference Point' field is the words "Field Required" in red
- The 'Date Installed' field is populated with the current date and time
- The 'Date Installed' field is green indicating it is dirty
- (LABEL 1) There is a 'Cancel' button (see Create and Cancel first item)
- Type some text into the 'Antenna Reference Point' field, and any others that are required
- Expect:
- The Item Header Bar is green to indicate it is dirty
- The Group Header Bar is green
- The 'Antenna Reference Point' field and another other modified are green
- The words "Field Required" have disappeared
- The text 'The form is modified' appears at the top of the form
- The 'Cancel' button still exists
- (LABEL 2)
- Click the 'Save' link
- Click the 'YES' button in the save confirmation modal dialog
- Expect:
- The Item Header Bar is blue to indicate it is pristine and valid
- The Group Header Bar is blue
- The 'Antenna Reference Point' field (and any others modified previously) are white / clear
- The 'Antenna Reference Point' field (and any others modified previously) contain the text or numbers they were previously updated with
- A 'Delete' button exists
Create and Cancel first item MIG
- Follow [Create first item MIG](#Create first item MIG) to LABEL 1
- Click "Cancel"
- Expect:
- The Group Header Bar contains the words "Group Antennas" (and no others)
- The Group Header Bar is blue to indicate it is pristine
- The Group Header Bar contains a button titled "New Antenna"
- The Group box contains the text "No information available for GNSS Antenna"
Create and Cancel one of multiple items MIG
- Follow [Create first item MIG](#Create first item MIG) to LABEL 2 (ie. don't save after creating the first)
- Click 'New Site Antenna' to create 2nd item
- Expect:
- There are two Items now - the first is the one just created - all references to an Item are to this
- The Group Header Bar is red to indicate it is invalid
- The Item Header Bar has appeared (it is new)
- The Item Header Bar is red/yellow to indicate it is invalid
- The 'Antenna Reference Point' field (and maybe others) has a red ring
- Below the 'Antenna Reference Point' field is the words "Field Required" in red
- The 'Date Installed' field is populated with the current date and time
- The 'Date Installed' field is green indicating it is dirty
- (LABEL 3) There is a 'Cancel' button (see Create and Cancel first item)
- Type some text into the 'Antenna Reference Point' field, and any others that are required
- Expect:
- The Item Header Bar is green to indicate it is dirty
- The Group Header Bar is green
- The 'Antenna Reference Point' field and another other modified are green
- The words "Field Required" have disappeared
- The text 'The form is modified' appears at the top of the form
- The 'Cancel' button still exists
- Click the 'Save' link
- Click the 'YES' button in the save confirmation modal dialog
- Expect:
- The Item Header Bar is blue to indicate it is pristine and valid. The same for the other Item header.
- The Group Header Bar is blue
- The 'Antenna Reference Point' field (and any others modified previously) are white / clear
- The 'Antenna Reference Point' field (and any others modified previously) contain the text or numbers they were previously updated with
- A 'Delete' button exists
Delete first item MIG
- Follow [Create first item MIG](#Create first item MIG) to LABEL 2 (ie. don't save after creating the first)
- Click 'Delete'
- Enter any text into the 'Deletion Reason' box and click 'OK'
- Expected:
- The Group Header Bar with words "GNSS Antennas" is Green to indicate it is dirty
- The Item Header Bar for the Antenna deleted contains the text "(marked to delete)"
- All fields are visible and disabled
- The delete button is visible and disabled
- The 'New Antenna' button is visible and enabled
- Click the save link
- Click the 'YES' button in the save confirmation modal dialog
- Expected:
- The Group Header Bar with words "GNSS Antennas" returns to blue to indicate it is pristine
- The Group Header Bar with words "GNSS Antennas" only contains the words "Site Owner" - the text "(marked to delete)" on the bar has disappeared
- The Group Header Bar contains a button titled "New Antenna"
- The Group box contains the text "No information available for Site Owner"