Context
As a user I want to be able to end a Trip from the Trip Summary page so that I can record the end time of the trip.
In-scope
ending a trip
saving a logbook entry with the "end time" information
pop-up window to add the "trip miles" information
Scenarios
Scenario 1: End trip button
GIVEN I am on the Trip Summary page for a specific trip,
WHEN I click on the "End Trip" button,
THEN a confirmation window appears for the user to either end the trip or cancel this action
Scenario 2: Canceling ending a trip
GIVEN I am prompted with the confirmation window to end a trip
WHEN I click on the "Stay on this page" button
THEN I am redirected to the Trip Summary page
Scenario 3: Saving the end time on the Firebase database
GIVEN I am prompted with the confirmation window to end a trip
WHEN I click on the "Save & Continue" button
THEN a new logbook entry is created automatically
AND the current time is saved to the this entry
Scenario 4: Trip miles
GIVEN I am prompted with the confirmation window to end a trip
WHEN the pop-up window opens
THEN I can type a positive number with maximum to decimals as the trip miles value
AND clicking on the "Save & Continue" button saves the value to the last logbook entry
AND I am redirected to the "Trip Summary" page
AND the "End Trip" button is not present in the "Trip Summary" page
Scenario 5: Ending a trip on a different day as the start date
GIVEN I want to end a trip on a different day as the start date
WHEN I click the "Save & Continue" button on the confirmation window to end a trip
THEN I am prompted with a pop-up window with a field to manually add the time when the trip is ended
AND this value is saved to the last logbook entry
Acceptance Criteria
Clicking the "End Trip" button triggers the creation of the last logbook entry in the Firebase DB
Clicking the "End trip" button triggers a confirmation window to cancel or confirm the ending of a trip
The confirmation window has an input field to manually introduce the trip miles
The trip miles field is optional
The trip miles field accepts only positive numbers up to 2 decimals
The trip miles value is saved in the last logbook entry in the Firebase DB
The time of the last logbook entry is the current time when the user clicks on the "Save & Continue" button on the confirmation window
If the date of ending a trip differs from the start date, then the user sees a field to input the end time manually on the confirmation window
If the user enters the end time manually on the confirmation window, this value is saved to the last logbook entry on the Firebase database
Upon ending a trip, the status is updated in the Firebase DB as to indicate that the trip has ended
The last logbook entry contains the entries: "time" and “trip miles"
The last logbook entry is added to the comments in the CSV file when exporting the trip
Once the trip status is ended, the "End trip" button is no longer visible in the Trip Summary page of that specific trip
Context As a user I want to be able to end a Trip from the Trip Summary page so that I can record the end time of the trip.
In-scope
Scenarios
Scenario 1: End trip button GIVEN I am on the Trip Summary page for a specific trip, WHEN I click on the "End Trip" button, THEN a confirmation window appears for the user to either end the trip or cancel this action
Scenario 2: Canceling ending a trip GIVEN I am prompted with the confirmation window to end a trip WHEN I click on the "Stay on this page" button THEN I am redirected to the Trip Summary page
Scenario 3: Saving the end time on the Firebase database GIVEN I am prompted with the confirmation window to end a trip WHEN I click on the "Save & Continue" button THEN a new logbook entry is created automatically AND the current time is saved to the this entry
Scenario 4: Trip miles GIVEN I am prompted with the confirmation window to end a trip WHEN the pop-up window opens THEN I can type a positive number with maximum to decimals as the trip miles value AND clicking on the "Save & Continue" button saves the value to the last logbook entry AND I am redirected to the "Trip Summary" page AND the "End Trip" button is not present in the "Trip Summary" page
Scenario 5: Ending a trip on a different day as the start date GIVEN I want to end a trip on a different day as the start date WHEN I click the "Save & Continue" button on the confirmation window to end a trip THEN I am prompted with a pop-up window with a field to manually add the time when the trip is ended AND this value is saved to the last logbook entry
Acceptance Criteria