-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DRIVER-APP): cypress test cases for landing page with new ride d…
…river app
- Loading branch information
Showing
10 changed files
with
132 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { testIds } from '../../../shared/dataTestIds' | ||
|
||
describe('Landing page of Taxi-Bpp (Driver Application) test cases', () => { | ||
before(() => { | ||
cy.login(testIds.url_base, '[email protected]', 'Abcd@1234') | ||
}) | ||
|
||
it('should display the top header with current location and switch button visible', () => { | ||
cy.getByData(testIds.locationIcon).should('exist').and('be.visible') | ||
cy.getByData(testIds.yourLocation).should('exist').and('be.visible') | ||
cy.wait(10000) | ||
// cy.getByData(testIds.location).should('be.visible') | ||
cy.getByData(testIds.downArrow).should('exist').and('be.visible') | ||
cy.getByData(testIds.taxi_BPP_switch_toggle_button).should('exist').and('be.visible') | ||
}) | ||
it('should display the top header with current location and switch button disabled', () => { | ||
cy.getByData(testIds.taxi_BPP_offlineMode_image).should('exist').and('be.visible') | ||
cy.getByData(testIds.taxi_BPP_offlineMode_offlineTitle).should('exist').and('be.visible') | ||
cy.getByData(testIds.taxi_BPP_offlineMode_offlineDescription).should('exist').and('be.visible') | ||
}) | ||
it('should display the top header with current location and switch button enabled', () => { | ||
cy.intercept('POST', 'https://bpp-unified-strapi1-prod.becknprotocol.io/driver-app/toggle-availability', { | ||
fixture: 'TAXI-BPP/toggleAvailabiltiyResponse.json' | ||
}).as('toggleAvailabiltiyResponse') | ||
cy.getByData(testIds.taxi_BPP_switch_toggle_button).click() | ||
cy.wait('@toggleAvailabiltiyResponse').its('response.statusCode').should('eq', 200) | ||
cy.getByData(testIds.taxi_BPP_switch_toggle_button).should('exist') | ||
cy.wait(10000) | ||
}) | ||
|
||
it('displays a new ride request modal and verifies ride details', () => { | ||
cy.fixture('TAXI-BPP/newRide.json').then(rideRequestData => { | ||
cy.setRideRequestState(rideRequestData) | ||
}) | ||
cy.getByData(testIds.taxi_BPP_pickup_location_text).should('be.visible') | ||
cy.getByData(testIds.taxi_BPP_drop_location_text).should('be.visible') | ||
cy.getByData(testIds.taxi_BPP_km_away_text).should('be.visible') | ||
cy.getByData(testIds.taxi_BPP_km_distance_text).should('be.visible') | ||
cy.getByData(testIds.taxi_BPP_accept_button).should('be.visible') | ||
cy.getByData(testIds.taxi_BPP_decline_button).should('be.visible') | ||
}) | ||
it('Decline button should be clickable', () => { | ||
cy.getByData(testIds.taxi_BPP_decline_button).click() | ||
cy.wait(10000) | ||
cy.fixture('TAXI-BPP/newRide.json').then(rideRequestData => { | ||
cy.setRideRequestState(rideRequestData) | ||
}) | ||
}) | ||
it('Accept button should be clickable', () => { | ||
cy.getByData(testIds.taxi_BPP_accept_button).click() | ||
}) | ||
}) |
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,22 @@ | ||
{ | ||
"id": "REQ_NEW_RIDE", | ||
"title": "New Ride Request", | ||
"subTitle": "", | ||
"rideDetails": { | ||
"orderId": 2130, | ||
"source": "FW2M+WV8, Pandhari Nagar, Handewadi, Pune, Maharashtra 412308, India", | ||
"sourceGeoLocation": { | ||
"latitude": 18.4520848, | ||
"longitude": 73.9339347 | ||
}, | ||
"destinationGeoLocation": { | ||
"latitude": 18.5214945, | ||
"longitude": 73.93047109999999 | ||
}, | ||
"destination": "P1002, MARVEL DIVA, P1002, Kirtane Baugh, Phase 1, Hadapsar, Pune, Maharashtra 411028, India", | ||
"distance": 9.88, | ||
"time": "30", | ||
"driverStatus": "AWAITING_DRIVER_APPROVAL", | ||
"contact": "9999999999" | ||
} | ||
} |
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,28 @@ | ||
{ | ||
"toggleAvailabiltiyResponse": { | ||
"id": 4, | ||
"day_of_week": "Suresh Driver Availability", | ||
"start_time": null, | ||
"end_time": null, | ||
"is_available": true, | ||
"unavailability_reason": null, | ||
"createdAt": "2024-05-15T07:39:47.366Z", | ||
"updatedAt": "2024-10-24T08:48:21.057Z", | ||
"publishedAt": "2024-05-15T07:39:48.455Z" | ||
}, | ||
"updateLocationResponse": { | ||
"id": 55, | ||
"address": "Suresh Cab Driver GPS Location", | ||
"city": "Suresh Cab Driver GPS Location", | ||
"state": null, | ||
"country": null, | ||
"zip": null, | ||
"createdAt": "2024-05-15T07:39:08.851Z", | ||
"updatedAt": "2024-10-24T08:48:21.073Z", | ||
"publishedAt": "2024-05-15T07:39:11.633Z", | ||
"latitude": null, | ||
"longitude": null, | ||
"map_url": null, | ||
"gps": "28.6094734, 77.4570594" | ||
} | ||
} |
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