diff --git a/apps/dragon-foods/pages/orderHistory.tsx b/apps/dragon-foods/pages/orderHistory.tsx index bb8e40832..6480aeb74 100644 --- a/apps/dragon-foods/pages/orderHistory.tsx +++ b/apps/dragon-foods/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/earth-support-initiative/pages/orderHistory.tsx b/apps/earth-support-initiative/pages/orderHistory.tsx index faa65f1d1..c36dcf363 100644 --- a/apps/earth-support-initiative/pages/orderHistory.tsx +++ b/apps/earth-support-initiative/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/envirogrowth/pages/orderHistory.tsx b/apps/envirogrowth/pages/orderHistory.tsx index faa65f1d1..c36dcf363 100644 --- a/apps/envirogrowth/pages/orderHistory.tsx +++ b/apps/envirogrowth/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/harmoni-aids/pages/orderHistory.tsx b/apps/harmoni-aids/pages/orderHistory.tsx index faa65f1d1..c36dcf363 100644 --- a/apps/harmoni-aids/pages/orderHistory.tsx +++ b/apps/harmoni-aids/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/sky-analytics/pages/orderHistory.tsx b/apps/sky-analytics/pages/orderHistory.tsx index faa65f1d1..c36dcf363 100644 --- a/apps/sky-analytics/pages/orderHistory.tsx +++ b/apps/sky-analytics/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/state-forest-department/pages/orderHistory.tsx b/apps/state-forest-department/pages/orderHistory.tsx index faa65f1d1..c36dcf363 100644 --- a/apps/state-forest-department/pages/orderHistory.tsx +++ b/apps/state-forest-department/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/cypress/e2e/Tourism/NegativeTCTourism.cy.ts b/cypress/e2e/Tourism/NegativeTCTourism.cy.ts new file mode 100644 index 000000000..275c9867c --- /dev/null +++ b/cypress/e2e/Tourism/NegativeTCTourism.cy.ts @@ -0,0 +1,234 @@ +import { testIds } from '../../../shared/dataTestIds' +import { billingDetails, shippingDetails } from '../../fixtures/checkoutPage/userDetails' +import { initResponse } from '../../fixtures/checkoutPage/initResponse' +import { orderResponse } from '../../fixtures/INDUSTRY4.0/orderConfirmation/orderResponse' +describe('Negative TC for Tourism App', () => { + before(() => { + cy.visit(testIds.deployed_tourism_url_base) + }) + context('Authentication Scenarios', () => { + // Sign In Page + it('should display the sign-in form elements and handle form submission states', () => { + cy.getByData(testIds.auth_inputEmail).should('exist').and('be.visible') + cy.getByData(testIds.auth_inputPassword).should('exist').and('be.visible') + // Check if the sign-in and sign-up buttons exist and are visible + cy.getByData(testIds.auth_loginButton).should('exist').and('be.visible') + cy.getByData(testIds.auth_registerButton).should('exist').and('be.visible') + // Check if the sign-in button is disabled when form is submitted with empty fields + cy.getByData(testIds.auth_loginButton).should('be.disabled') + // Check if the sign-up button is enabled + cy.getByData(testIds.auth_registerButton).should('be.enabled') + }) + // Invalid login scenarios + it('should handle various invalid login scenarios', () => { + const invalidEmail = 'invalid.com' + const invalidPassword = 'password' + const unregisteredEmail = 'unregistered@example.com' + const unregisteredPassword = 'unreg@Pass123' + + // Scenario 1: Invalid email and password + cy.getByData(testIds.auth_inputEmail).clear().type(invalidEmail) + cy.getByData(testIds.auth_inputPassword).clear().type(invalidPassword) + cy.getByData(testIds.auth_loginButton).should('be.disabled') + + // Scenario 2: Invalid password with valid email + cy.getByData(testIds.auth_inputEmail).clear().type(testIds.user_validEmail) + cy.getByData(testIds.auth_inputPassword).clear().type(testIds.user_invalidPassword) + cy.getByData(testIds.auth_loginButton).should('not.be.disabled').click() + cy.getByData(testIds.feedback).should('contain.text', 'Error!') + + // Scenario 3: Unregistered email and password + cy.getByData(testIds.auth_inputEmail).clear().type(unregisteredEmail) + cy.getByData(testIds.auth_inputPassword).clear().type(unregisteredPassword) + cy.getByData(testIds.auth_loginButton).should('not.be.disabled').click() + cy.getByData(testIds.feedback).should('contain.text', 'Error!') + }) + }) + context('Valid Login and Home page', () => { + // Valid login scenarios + it('should enable the Sign In button when both fields are filled', () => { + cy.getByData(testIds.auth_inputEmail).clear().type('sanket@gmail.com') + cy.getByData(testIds.auth_inputPassword).clear().type('P@ssw0rd') + cy.getByData(testIds.auth_loginButton).should('not.be.disabled').click() + cy.wait(2000) + }) + }) + context('search with wrong keyword', () => { + it('search with wrong keyword', () => { + cy.getByData(testIds.homepage_searchInput).click() + cy.getByData(testIds.loaction_list).type('Pune') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + cy.getByData(testIds.homepage_searchInput).should('have.value', 'Pune, Maharashtra, India') + cy.getByData(testIds.homepage_search_button).click() + cy.wait(17000) + }) + it('should render the message if no product to display', () => { + cy.getByData(testIds.noDataAvailable).should('be.visible') + cy.getByData(testIds.noDataAvailable).should( + 'contain.text', + 'There are no products in this category yet! New products will be added soon.' + ) + }) + }) + context('search with valid keyword', () => { + it('should perform search and navigate to search results', () => { + cy.getByData(testIds.home_icon).click() + cy.getByData(testIds.homepage_searchInput).click() + cy.getByData(testIds.loaction_list).type('Manali') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + cy.getByData(testIds.homepage_searchInput).should('have.value', 'Manali, Himachal Pradesh, India') + cy.getByData(testIds.homepage_search_button).click() + cy.wait(17000) + }) + }) + context('Clear filters should reset all applied filters and show all results', () => { + it('should handle reset applied filter', () => { + cy.getByData(testIds.searchpage_sortByPrice).select(2) + cy.getByData(testIds.searchpage_filterByRating).select(2) + cy.getByData(testIds.searchpage_applyFilter).click() + cy.getByData(testIds.searchpage_products).eq(0).should('contain.text', 'Hampta Pass Trek - Manali - EACH') + cy.getByData(testIds.searchpage_resetBtn).click() + cy.getByData(testIds.searchpage_products).eq(0).should('contain.text', 'Chandra Tal Trek - Manali') + }) + }) + context('Should validate Billing & Shipping details', () => { + it('should select and add Billing & Shipping details', () => { + cy.selectProduct(0) + }) + it('should not able to decrement the count when total count is 1', () => { + cy.getByData(testIds.productpage_decrementCounter).click() + cy.getByData(testIds.productpage_counterValue).should('contain.text', '1') + cy.getByData(testIds.productpage_addTocartButton).click() + cy.wait(2000) + }) + it('should validate shipping form fields', () => { + cy.getByData(testIds.checkoutpage_shippingDetails).getByData(testIds.checkoutpage_openForm).first().click() + + cy.getByData(testIds.checkoutpage_shippingDetails) + .getByData(testIds.checkoutpage_form) + .within(() => { + cy.getByData(testIds.checkoutpage_name).clear().blur() + cy.contains('Name is required').should('be.visible') + cy.getByData(testIds.checkoutpage_mobileNumber).clear().type('12345').blur() + cy.contains('Invalid Mobile Number').should('be.visible') + cy.getByData(testIds.checkoutpage_email).clear().type('invalid-email').blur() + cy.contains('Invalid email format').should('be.visible') + cy.getByData(testIds.checkoutpage_address).clear().blur() + cy.contains('Complete Address is required').should('be.visible') + cy.getByData(testIds.checkoutpage_pinCode).clear().type('123').blur() + cy.contains('Invalid Zip code').should('be.visible') + cy.getByData('submit').should('be.disabled') + }) + cy.getByData(testIds.checkoutpage_shippingDetails).getByData(testIds.checkoutpage_form).type('{esc}') + }) + + it('should fill and save the shipping form data', () => { + cy.getByData(testIds.checkoutpage_shippingDetails).getByData(testIds.checkoutpage_openForm).click() + cy.getByData(testIds.checkoutpage_form).should('be.visible') + cy.getByData(testIds.checkoutpage_shippingDetails) + .getByData(testIds.checkoutpage_form) + .within(() => { + cy.getByData(testIds.checkoutpage_name).clear().type(shippingDetails.name) + cy.getByData(testIds.checkoutpage_mobileNumber).clear().type(shippingDetails.mobileNumber) + cy.getByData(testIds.checkoutpage_email).clear().type(shippingDetails.email) + cy.getByData(testIds.checkoutpage_address).clear().type(shippingDetails.address) + cy.getByData(testIds.checkoutpage_pinCode).clear().type(shippingDetails.pinCode) + cy.getByData('submit').click() + }) + }) + + it('should handle the "same as shipping" checkbox for billing form data', () => { + cy.getByData(testIds.checkoutpage_billingDetails).within(() => { + cy.getByData(testIds.checkoutpage_checkbox).get('input').check() + cy.getByData(testIds.checkoutpage_checkbox).click() + cy.getByData(testIds.checkoutpage_changeFormDetails).click() + }) + cy.getByData(testIds.checkoutpage_billingDetails) + .getByData(testIds.checkoutpage_form) + .within(() => { + cy.getByData(testIds.checkoutpage_name).should('contain.value', shippingDetails.name) + cy.getByData(testIds.checkoutpage_mobileNumber).should('contain.value', shippingDetails.mobileNumber) + cy.getByData(testIds.checkoutpage_email).should('contain.value', shippingDetails.email) + cy.getByData(testIds.checkoutpage_address).should('contain.value', shippingDetails.address) + cy.getByData(testIds.checkoutpage_pinCode).should('contain.value', shippingDetails.pinCode) + }) + cy.getByData(testIds.checkoutpage_billingDetails).getByData(testIds.checkoutpage_form).type('{esc}') + }) + it('should validate billing form fields', () => { + cy.getByData(testIds.checkoutpage_billingDetails).within(() => { + cy.getByData(testIds.checkoutpage_changeFormDetails).click() + }) + cy.getByData(testIds.checkoutpage_billingDetails) + .getByData(testIds.checkoutpage_form) + .within(() => { + cy.getByData(testIds.checkoutpage_name).clear().blur() + cy.contains('Name is required').should('be.visible') + + cy.getByData(testIds.checkoutpage_mobileNumber).clear().type('12345').blur() + cy.contains('Invalid Mobile Number').should('be.visible') + + cy.getByData(testIds.checkoutpage_email).clear().type('invalid-email').blur() + cy.contains('Invalid email format').should('be.visible') + + cy.getByData(testIds.checkoutpage_address).clear().blur() + cy.contains('Complete Address is required').should('be.visible') + + cy.getByData(testIds.checkoutpage_pinCode).clear().type('123').blur() + cy.contains('Invalid Zip code').should('be.visible') + + cy.getByData('submit').should('be.disabled') + }) + cy.getByData(testIds.checkoutpage_billingDetails).getByData(testIds.checkoutpage_form).type('{esc}') + }) + + it('should fill and save the billing form data', () => { + cy.getByData(testIds.checkoutpage_billingDetails).within(() => { + cy.getByData(testIds.checkoutpage_changeFormDetails).click() + }) + + cy.getByData(testIds.checkoutpage_billingDetails) + .getByData(testIds.checkoutpage_form) + .within(() => { + cy.getByData(testIds.checkoutpage_name).clear().type(billingDetails.name) + cy.getByData(testIds.checkoutpage_mobileNumber).clear().type(billingDetails.mobileNumber) + cy.getByData(testIds.checkoutpage_email).clear().type(billingDetails.email) + cy.getByData(testIds.checkoutpage_address).clear().type(billingDetails.address) + cy.getByData(testIds.checkoutpage_pinCode).clear().type(billingDetails.pinCode) + cy.getByData('submit').click() + }) + }) + }) + context('Should checkout product', () => { + it('should checkout product', () => { + cy.getByData(testIds.checkoutpage_proceedToCheckout).click() + cy.getByData(testIds.paymentpage_radioButton).eq(2).check().should('be.checked') + cy.getByData(testIds.paymentpage_confirmButton).click() + cy.wait(300) + cy.getByData(testIds.orderConfirmation_viewOrderButton).click() + cy.getByData(testIds.orderDetailspage_otherOptions).click() + cy.get(':nth-child(2) > [data-test="menuItemName"]').click() + cy.wait(1000) + }) + it('should validate update order details', () => { + cy.getByData(testIds.checkoutpage_name).clear().type('12345').blur() + cy.contains('Name can only contain letters and spaces').should('be.visible') + cy.getByData(testIds.checkoutpage_mobileNumber).clear().type('12345').blur() + cy.contains('Invalid mobile number').should('be.visible') + cy.getByData(testIds.checkoutpage_email).clear().type('invalid-email').blur() + cy.contains('Invalid email format').should('be.visible') + // cy.getByData(testIds.checkoutpage_address).clear().blur() + // cy.contains('Complete Address is required').should('be.visible') + cy.getByData(testIds.checkoutpage_pinCode).clear().type('123').blur() + cy.contains('Invalid Zip Code').should('be.visible') + cy.getByData('submit').should('be.disabled') + }) + it('should update order', () => { + cy.getByData(testIds.checkoutpage_name).clear().type(shippingDetails.name) + cy.getByData(testIds.checkoutpage_mobileNumber).clear().type(shippingDetails.mobileNumber) + cy.getByData(testIds.checkoutpage_email).clear().type(shippingDetails.email) + cy.getByData(testIds.checkoutpage_address).clear().type(shippingDetails.address) + cy.getByData(testIds.checkoutpage_pinCode).clear().type(shippingDetails.pinCode) + cy.getByData('submit').click() + }) + }) +}) diff --git a/cypress/e2e/Tourism/endToEndCity.cy.ts b/cypress/e2e/Tourism/endToEndCity.cy.ts index 32f1b6a06..1c38b245a 100644 --- a/cypress/e2e/Tourism/endToEndCity.cy.ts +++ b/cypress/e2e/Tourism/endToEndCity.cy.ts @@ -12,7 +12,8 @@ describe('end to end testing', () => { }) } before(() => { - cy.visit(testIds.deployed_tourism_url_base) + //cy.visit(testIds.deployed_tourism_url_base) + cy.visit('https://tourism-staging.becknprotocol.io') }) context('Sign in With Valid ID and Password', () => { // Valid login scenarios diff --git a/cypress/e2e/mobility-bap/endToEndAfrica.cy.ts b/cypress/e2e/mobility-bap/endToEndAfrica.cy.ts index 68a5ea257..906945a1f 100644 --- a/cypress/e2e/mobility-bap/endToEndAfrica.cy.ts +++ b/cypress/e2e/mobility-bap/endToEndAfrica.cy.ts @@ -1,10 +1,8 @@ import { testIds } from '../../../shared/dataTestIds' describe('Home Page Tests', () => { - before(() => {}) it('should open driver app', () => { cy.visit('https://driverapp-dev.becknprotocol.io/') - //cy.go('back'); }) // Valid login scenarios it('should Login in into driver app', () => { @@ -28,7 +26,6 @@ describe('Home Page Tests', () => { cy.get('body').type(' Serekunda Market') cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() }) - //------------------------------- it('should visit to BAP', () => { cy.visit(testIds.deployed_mob_url_base) }) @@ -70,19 +67,6 @@ describe('Home Page Tests', () => { cy.getByData(testIds.mobility_cancel_search).should('contain.text', 'Cancel Search') cy.wait(17000) }) - // For empty results - // it('should re-render the pickup-dropoff page', () => { - // cy.getByData(testIds.mobility_pickup_dropoff).should('be.visible') - // }) - // it('should render the toast when no result found', () => { - // cy.getByData(testIds.feedback).should('contain.text', 'No ride available, please try again!') - // }) - // it('should render the available provider rides category page', () => { - // cy.getByData(testIds.mobility_searchpage_container).should('be.visible') - // }) - // it('should render the count of result found', () => { - // cy.getByData(testIds.mobility_total_cabs).should('contain.text', 'results found') - // }) it('should render the provider wise catalogue', () => { cy.getByData(testIds.mobility_catalog_container).should('be.visible') cy.getByData(testIds.mobility_catalog_container).within(() => { @@ -112,12 +96,10 @@ describe('Home Page Tests', () => { cy.getByData(testIds.mobility_provider_item_select_button).first().click() cy.getByData(testIds.mobility_search_ride_details_form).should('be.visible') }) - it('should render the cab details like name and fare', () => { cy.getByData(testIds.mobility_ride_name).should('be.visible') cy.getByData(testIds.mobility_ride_fare).should('be.visible') }) - it('should render the ride details like pickup dropoff address', () => { cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') cy.getByData(testIds.mobility_pickup_address).should('contain.text', 'Serekunda Market, Serrekunda, The Gambia') @@ -131,27 +113,21 @@ describe('Home Page Tests', () => { cy.getByData(testIds.mobility_rider_name).should('be.empty', '') cy.getByData(testIds.mobility_rider_mobileNo).should('be.empty', '') }) - it('confirm button text shoudl be `Confirm & Proceed`', () => { cy.getByData(testIds.mobility_rider_confirm_button).should('have.text', 'Confirm & Proceed') }) - it('Confirm & proceed button should be disbaled if name and phone number is empty', () => { cy.getByData(testIds.mobility_rider_confirm_button).should('be.disabled') }) - it('should able to type name value', () => { cy.getByData(testIds.mobility_rider_name).type('Omkar') }) - it('should able to type mobile number value', () => { cy.getByData(testIds.mobility_rider_mobileNo).type('9090878888') }) - it('Confirm & proceed button should be not be disbaled if name and phone number is not empty', () => { cy.getByData(testIds.mobility_rider_confirm_button).should('not.be.disabled') }) - it('when click on Confirm & proceed button should navigate to payment page', () => { cy.getByData(testIds.mobility_rider_confirm_button).click() cy.getByData(testIds.pageName).should('have.text', 'Select Payment Method') @@ -299,7 +275,6 @@ describe('Home Page Tests', () => { // Additional assertions can be added based on response data }) }) - it('should check "New Ride Request" popup component', () => { cy.wait(6000) cy.getByData(testIds.taxi_BPP_pickup_location_text).should('be.visible') diff --git a/cypress/e2e/mobility-bap/endToEndCities.cy.ts b/cypress/e2e/mobility-bap/endToEndCities.cy.ts index ff5247c92..ed42a5417 100644 --- a/cypress/e2e/mobility-bap/endToEndCities.cy.ts +++ b/cypress/e2e/mobility-bap/endToEndCities.cy.ts @@ -1,7 +1,6 @@ import { testIds } from '../../../shared/dataTestIds' describe('Home Page Tests', () => { - before(() => {}) it('should open driver app', () => { cy.visit('https://driverapp-dev.becknprotocol.io/') //cy.go('back'); @@ -28,7 +27,6 @@ describe('Home Page Tests', () => { cy.get('body').type(' conrad hotel, bengaluru') cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() }) - //------------------------------- it('should visit to BAP', () => { cy.visit(testIds.deployed_mob_url_base) }) @@ -70,19 +68,6 @@ describe('Home Page Tests', () => { cy.getByData(testIds.mobility_cancel_search).should('contain.text', 'Cancel Search') cy.wait(17000) }) - // For empty results - // it('should re-render the pickup-dropoff page', () => { - // cy.getByData(testIds.mobility_pickup_dropoff).should('be.visible') - // }) - // it('should render the toast when no result found', () => { - // cy.getByData(testIds.feedback).should('contain.text', 'No ride available, please try again!') - // }) - // it('should render the available provider rides category page', () => { - // cy.getByData(testIds.mobility_searchpage_container).should('be.visible') - // }) - // it('should render the count of result found', () => { - // cy.getByData(testIds.mobility_total_cabs).should('contain.text', 'results found') - // }) it('should render the provider wise catalogue', () => { cy.getByData(testIds.mobility_catalog_container).should('be.visible') cy.getByData(testIds.mobility_catalog_container).within(() => { @@ -112,12 +97,10 @@ describe('Home Page Tests', () => { cy.getByData(testIds.mobility_provider_item_select_button).first().click() cy.getByData(testIds.mobility_search_ride_details_form).should('be.visible') }) - it('should render the cab details like name and fare', () => { cy.getByData(testIds.mobility_ride_name).should('be.visible') cy.getByData(testIds.mobility_ride_fare).should('be.visible') }) - it('should render the ride details like pickup dropoff address', () => { cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') cy.getByData(testIds.mobility_pickup_address).should( @@ -134,27 +117,21 @@ describe('Home Page Tests', () => { cy.getByData(testIds.mobility_rider_name).should('be.empty', '') cy.getByData(testIds.mobility_rider_mobileNo).should('be.empty', '') }) - it('confirm button text shoudl be `Confirm & Proceed`', () => { cy.getByData(testIds.mobility_rider_confirm_button).should('have.text', 'Confirm & Proceed') }) - it('Confirm & proceed button should be disbaled if name and phone number is empty', () => { cy.getByData(testIds.mobility_rider_confirm_button).should('be.disabled') }) - it('should able to type name value', () => { cy.getByData(testIds.mobility_rider_name).type('Omkar') }) - it('should able to type mobile number value', () => { cy.getByData(testIds.mobility_rider_mobileNo).type('9090878888') }) - it('Confirm & proceed button should be not be disbaled if name and phone number is not empty', () => { cy.getByData(testIds.mobility_rider_confirm_button).should('not.be.disabled') }) - it('when click on Confirm & proceed button should navigate to payment page', () => { cy.getByData(testIds.mobility_rider_confirm_button).click() cy.getByData(testIds.pageName).should('have.text', 'Select Payment Method') diff --git a/cypress/e2e/mobility-bap/happyFlowCityOfAfrica.cy.ts b/cypress/e2e/mobility-bap/happyFlowCityOfAfrica.cy.ts new file mode 100644 index 000000000..dcaf83c71 --- /dev/null +++ b/cypress/e2e/mobility-bap/happyFlowCityOfAfrica.cy.ts @@ -0,0 +1,176 @@ +import { testIds } from '../../../shared/dataTestIds' + +describe('Happy flow of City Of Africa app', () => { + //Make sure to log in with the Driver app, and + //set the location to Banjul,Serkekunda + it('should visit to BAP', () => { + cy.visit(testIds.deployed_mob_url_base) + }) + it('should render homepage with google map', () => { + cy.getByData(testIds.mobility_map_container).should('be.visible') + cy.getByData(testIds.mobility_map).should('be.visible') + }) + it('should render the pickup-dropoff modal', () => { + cy.getByData(testIds.mobility_pickup_dropoff).should('be.visible') + cy.getByData(testIds.mobility_pickup_dropoff).should('contain.text', 'Where Would You Like To Go?') + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + }) + it('should contain empty pickup and dropoff address on load', () => { + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_pickup_address).should('contain.text', '') + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + cy.getByData(testIds.mobility_dropoff_address).should('contain.text', '') + }) + it('The search button should render as disabled on initial load', () => { + cy.getByData(testIds.mobility_search_btn).should('be.disabled') + }) + it('should enter pickup address', () => { + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_pickup_address).type('Serekunda Market') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + }) + it('should enter dropoff address', () => { + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + cy.getByData(testIds.mobility_dropoff_address).type('Banjul International Airport') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + }) + it('search button should be enabled when both drop-off and pickup addresses are set', () => { + cy.getByData(testIds.mobility_search_btn).should('not.be.disabled') + }) + it('should search for ride when both drop-off and pickup location are filled', () => { + cy.getByData(testIds.mobility_search_btn).click() + cy.getByData(testIds.mobility_cancel_search).should('be.visible') + cy.getByData(testIds.mobility_cancel_search).should('contain.text', 'Cancel Search') + cy.wait(17000) + }) + it('should render the provider wise catalogue', () => { + cy.getByData(testIds.mobility_catalog_container).should('be.visible') + cy.getByData(testIds.mobility_catalog_container).within(() => { + cy.getByData(testIds.mobility_catalog_item).eq(0).should('be.visible') + cy.getByData(testIds.mobility_catalog_item) + .eq(0) + .within(() => { + cy.getByData(testIds.mobility_provider_details).should('be.visible') + cy.getByData(testIds.mobility_provider_details) + .eq(0) + .within(() => { + cy.getByData(testIds.mobility_provider_name).should('be.visible') + //cy.getByData(testIds.mobility_provider_rating).should('contain.text', '4.3') + }) + + cy.getByData(testIds.mobility_provider_item).should('be.visible') + cy.getByData(testIds.mobility_provider_item) + .eq(0) + .within(() => { + cy.getByData(testIds.mobility_provider_item_name).should('be.visible') + //cy.getByData(testIds.mobility_provider_item_fare).should('contain.text', 'D221.01') + }) + }) + }) + }) + it('should render the search ride form page', () => { + cy.getByData(testIds.mobility_provider_item_select_button).first().click() + cy.getByData(testIds.mobility_search_ride_details_form).should('be.visible') + }) + it('should render the cab details like name and fare', () => { + cy.getByData(testIds.mobility_ride_name).should('be.visible') + cy.getByData(testIds.mobility_ride_fare).should('be.visible') + }) + it('should render the ride details like pickup dropoff address', () => { + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_pickup_address).should('contain.text', 'Serekunda Market, Serrekunda, The Gambia') + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + cy.getByData(testIds.mobility_dropoff_address).should( + 'contain.text', + 'Banjul International Airport, Yundum, The Gambia' + ) + }) + it('should render the rider details like name and phone number', () => { + cy.getByData(testIds.mobility_rider_name).should('be.empty', '') + cy.getByData(testIds.mobility_rider_mobileNo).should('be.empty', '') + }) + it('confirm button text shoudl be `Confirm & Proceed`', () => { + cy.getByData(testIds.mobility_rider_confirm_button).should('have.text', 'Confirm & Proceed') + }) + it('Confirm & proceed button should be disbaled if name and phone number is empty', () => { + cy.getByData(testIds.mobility_rider_confirm_button).should('be.disabled') + }) + it('should able to type name value', () => { + cy.getByData(testIds.mobility_rider_name).type('kebba') + }) + it('should able to type mobile number value', () => { + cy.getByData(testIds.mobility_rider_mobileNo).type('9090878888') + }) + it('Confirm & proceed button should be not be disbaled if name and phone number is not empty', () => { + cy.getByData(testIds.mobility_rider_confirm_button).should('not.be.disabled') + }) + it('when click on Confirm & proceed button should navigate to payment page', () => { + cy.getByData(testIds.mobility_rider_confirm_button).click() + cy.getByData(testIds.pageName).should('have.text', 'Select Payment Method') + }) + it('should render the Payment page', () => { + cy.url().should('include', '/paymentMode') + cy.getByData(testIds.paymentpage_visa).should('be.visible') + cy.getByData(testIds.paymentpage_masterCard).should('be.visible') + cy.getByData(testIds.paymentpage_CashOnDelivery).should('be.visible') + }) + it('should render the Payment page and Check all element should be contain text', () => { + cy.url().should('include', '/paymentMode') + cy.getByData(testIds.paymentpage_visa).should('contain.text', '**** **** **** 1234') + cy.getByData(testIds.paymentpage_masterCard).should('contain.text', '**** **** **** 1234') + cy.getByData(testIds.paymentpage_CashOnDelivery).should('contain.text', 'Cash') + }) + it('should disable the confirm button when no radio button is selected', () => { + cy.getByData(testIds.paymentpage_radioButton).should('not.be.checked') + cy.getByData(testIds.paymentpage_confirmButton).contains('Continue').should('be.disabled') + }) + it('should Click on Confirm Button', () => { + cy.getByData(testIds.paymentpage_radioButton).eq(2).check().should('be.checked') + cy.getByData(testIds.paymentpage_confirmButton).click() + cy.wait(3000) + }) + + //Open driver app and Accept the ride,Start ride,Reached Pick up location,End ride + + it('should render the Ride Stared Modal', () => { + cy.wait(5000) + cy.getByData(testIds.mobility_car_registrationNumber).should('be.visible') + cy.getByData(testIds.mobility_car_details).should('be.visible') + cy.getByData('driverImage').should('be.visible') + cy.getByData('driverName').should('be.visible') + cy.getByData('driverRating').should('be.visible') + cy.getByData('drivercallIcon').should('be.visible') + cy.getByData(testIds.mobility_totalFare).should('be.visible') + cy.getByData(testIds.mobility_Payment_text).should('be.visible') + cy.getByData(testIds.mobility_cashText).should('be.visible') + cy.getByData(testIds.mobility_Payment_image).should('be.visible') + cy.getByData(testIds.mobility_pickup_label).should('be.visible') + cy.getByData(testIds.mobility_dropoff_label).should('be.visible') + cy.getByData(testIds.mobility_cashText_Contact_Support).should('be.visible') + }) + it('should render Cab Details', () => { + cy.getByData('registrationNumber').should('be.visible') + cy.getByData('carDetails').should('be.visible') + cy.getByData('driverName').should('be.visible') + cy.getByData('driverRating').should('be.visible') + }) + it('Should Render Cab Payment Details ', () => { + cy.getByData(testIds.mobility_totalFare).should('contain.text', 'Total Fare') + cy.getByData(testIds.mobility_Payment_text).should('contain.text', 'Payment') + cy.getByData(testIds.mobility_cashText).should('contain.text', 'Cash') + cy.getByData(testIds.mobility_Payment_image).should('have.attr', 'src') + }) + it('should Click On Contact Support Button and Navigate to Contact Support Handle Page and Show All Element', () => { + cy.getByData(testIds.mobility_cashText_Contact_Support).click() + cy.getByData('Contact_Support').should('be.visible') + cy.getByData(testIds.loadingIndicator).should('be.visible') + cy.getByData('contactSupprtText').should('be.visible') + cy.getByData('call_us').should('be.visible') + cy.getByData(' email_us').should('be.visible') + }) + it('should Click On Skip For Now Button', () => { + cy.getByData(testIds.feedback_skip_forNow).should('contain.text', 'Skip for Now') + cy.getByData(testIds.feedback_skip_forNow).should('contain.text', 'Skip for Now').click() + }) +}) diff --git a/cypress/e2e/mobility-bap/happyFlowSmartCity.cy.ts b/cypress/e2e/mobility-bap/happyFlowSmartCity.cy.ts new file mode 100644 index 000000000..f225afd32 --- /dev/null +++ b/cypress/e2e/mobility-bap/happyFlowSmartCity.cy.ts @@ -0,0 +1,179 @@ +import { testIds } from '../../../shared/dataTestIds' + +describe('Happy flow of Smart City app', () => { + //Make sure to log in with the Driver app, and + //set the location to Conrad Hotel, Bangalore. + + it('should open driver app', () => { + cy.visit(testIds.deployed_mob_url_base) + //cy.go('back'); + }) + it('should render homepage with google map', () => { + cy.getByData(testIds.mobility_map_container).should('be.visible') + cy.getByData(testIds.mobility_map).should('be.visible') + }) + it('should render the pickup-dropoff modal', () => { + cy.getByData(testIds.mobility_pickup_dropoff).should('be.visible') + cy.getByData(testIds.mobility_pickup_dropoff).should('contain.text', 'Where Would You Like To Go?') + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + }) + it('should contain empty pickup and dropoff address on load', () => { + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_pickup_address).should('contain.text', '') + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + cy.getByData(testIds.mobility_dropoff_address).should('contain.text', '') + }) + it('The search button should render as disabled on initial load', () => { + cy.getByData(testIds.mobility_search_btn).should('be.disabled') + }) + it('should enter pickup address', () => { + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_pickup_address).type('conrad hotel, bengaluru') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + }) + it('should enter dropoff address', () => { + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + cy.getByData(testIds.mobility_dropoff_address).type('kempegowda international airport, karnataka') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + }) + it('search button should be enabled when both drop-off and pickup addresses are set', () => { + cy.getByData(testIds.mobility_search_btn).should('not.be.disabled') + }) + it('should search for ride when both drop-off and pickup location are filled', () => { + cy.getByData(testIds.mobility_search_btn).click() + cy.getByData(testIds.mobility_cancel_search).should('be.visible') + cy.getByData(testIds.mobility_cancel_search).should('contain.text', 'Cancel Search') + cy.wait(17000) + }) + it('should render the provider wise catalogue', () => { + cy.getByData(testIds.mobility_catalog_container).should('be.visible') + cy.getByData(testIds.mobility_catalog_container).within(() => { + cy.getByData(testIds.mobility_catalog_item).eq(0).should('be.visible') + cy.getByData(testIds.mobility_catalog_item) + .eq(0) + .within(() => { + cy.getByData(testIds.mobility_provider_details).should('be.visible') + cy.getByData(testIds.mobility_provider_details) + .eq(0) + .within(() => { + cy.getByData(testIds.mobility_provider_name).should('be.visible') + //cy.getByData(testIds.mobility_provider_rating).should('contain.text', '4.3') + }) + + cy.getByData(testIds.mobility_provider_item).should('be.visible') + cy.getByData(testIds.mobility_provider_item) + .eq(0) + .within(() => { + cy.getByData(testIds.mobility_provider_item_name).should('be.visible') + //cy.getByData(testIds.mobility_provider_item_fare).should('contain.text', 'D221.01') + }) + }) + }) + }) + it('should render the search ride form page', () => { + cy.getByData(testIds.mobility_provider_item_select_button).first().click() + cy.getByData(testIds.mobility_search_ride_details_form).should('be.visible') + }) + it('should render the cab details like name and fare', () => { + cy.getByData(testIds.mobility_ride_name).should('be.visible') + cy.getByData(testIds.mobility_ride_fare).should('be.visible') + }) + it('should render the ride details like pickup dropoff address', () => { + cy.getByData(testIds.mobility_pickup_label).should('contain.text', 'Pickup') + cy.getByData(testIds.mobility_pickup_address).should( + 'contain.text', + 'Conrad Bengaluru, Kensington Road, Halasuru, Someshwarpura, Bengaluru, Karnataka, India' + ) + cy.getByData(testIds.mobility_dropoff_label).should('contain.text', 'Dropoff') + cy.getByData(testIds.mobility_dropoff_address).should( + 'contain.text', + 'Kempegowda International Airport (BLR), Karnataka, India' + ) + }) + it('should render the rider details like name and phone number', () => { + cy.getByData(testIds.mobility_rider_name).should('be.empty', '') + cy.getByData(testIds.mobility_rider_mobileNo).should('be.empty', '') + }) + it('confirm button text shoudl be `Confirm & Proceed`', () => { + cy.getByData(testIds.mobility_rider_confirm_button).should('have.text', 'Confirm & Proceed') + }) + it('Confirm & proceed button should be disbaled if name and phone number is empty', () => { + cy.getByData(testIds.mobility_rider_confirm_button).should('be.disabled') + }) + it('should able to type name value', () => { + cy.getByData(testIds.mobility_rider_name).type('Omkar') + }) + it('should able to type mobile number value', () => { + cy.getByData(testIds.mobility_rider_mobileNo).type('9090878888') + }) + it('Confirm & proceed button should be not be disbaled if name and phone number is not empty', () => { + cy.getByData(testIds.mobility_rider_confirm_button).should('not.be.disabled') + }) + it('when click on Confirm & proceed button should navigate to payment page', () => { + cy.getByData(testIds.mobility_rider_confirm_button).click() + cy.getByData(testIds.pageName).should('have.text', 'Select Payment Method') + }) + it('should render the Payment page', () => { + cy.url().should('include', '/paymentMode') + cy.getByData(testIds.paymentpage_visa).should('be.visible') + cy.getByData(testIds.paymentpage_masterCard).should('be.visible') + cy.getByData(testIds.paymentpage_CashOnDelivery).should('be.visible') + }) + it('should render the Payment page and Check all element should be contain text', () => { + cy.url().should('include', '/paymentMode') + cy.getByData(testIds.paymentpage_visa).should('contain.text', '**** **** **** 1234') + cy.getByData(testIds.paymentpage_masterCard).should('contain.text', '**** **** **** 1234') + cy.getByData(testIds.paymentpage_CashOnDelivery).should('contain.text', 'Cash') + }) + it('should disable the confirm button when no radio button is selected', () => { + cy.getByData(testIds.paymentpage_radioButton).should('not.be.checked') + cy.getByData(testIds.paymentpage_confirmButton).contains('Continue').should('be.disabled') + }) + it('should Click on Confirm Button', () => { + cy.getByData(testIds.paymentpage_radioButton).eq(2).check().should('be.checked') + cy.getByData(testIds.paymentpage_confirmButton).click() + cy.wait(3000) + }) + //Open driver app and accept the ride request + it('should render the Ride Stared Modal', () => { + cy.wait(5000) + cy.getByData(testIds.mobility_car_registrationNumber).should('be.visible') + cy.getByData(testIds.mobility_car_details).should('be.visible') + cy.getByData('driverImage').should('be.visible') + cy.getByData('driverName').should('be.visible') + cy.getByData('driverRating').should('be.visible') + cy.getByData('drivercallIcon').should('be.visible') + cy.getByData(testIds.mobility_totalFare).should('be.visible') + cy.getByData(testIds.mobility_Payment_text).should('be.visible') + cy.getByData(testIds.mobility_cashText).should('be.visible') + cy.getByData(testIds.mobility_Payment_image).should('be.visible') + cy.getByData(testIds.mobility_pickup_label).should('be.visible') + cy.getByData(testIds.mobility_dropoff_label).should('be.visible') + cy.getByData(testIds.mobility_cashText_Contact_Support).should('be.visible') + }) + it('should render Cab Details', () => { + cy.getByData('registrationNumber').should('be.visible') + cy.getByData('carDetails').should('be.visible') + cy.getByData('driverName').should('be.visible') + cy.getByData('driverRating').should('be.visible') + }) + it('Should Render Cab Payment Details ', () => { + cy.getByData(testIds.mobility_totalFare).should('contain.text', 'Total Fare') + cy.getByData(testIds.mobility_Payment_text).should('contain.text', 'Payment') + cy.getByData(testIds.mobility_cashText).should('contain.text', 'Cash') + cy.getByData(testIds.mobility_Payment_image).should('have.attr', 'src') + }) + it('should Click On Contact Support Button and Navigate to Contact Support Handle Page and Show All Element', () => { + cy.getByData(testIds.mobility_cashText_Contact_Support).click() + cy.getByData('Contact_Support').should('be.visible') + cy.getByData(testIds.loadingIndicator).should('be.visible') + cy.getByData('contactSupprtText').should('be.visible') + cy.getByData('call_us').should('be.visible') + cy.getByData(' email_us').should('be.visible') + }) + it('should Click On Skip For Now Button', () => { + cy.getByData(testIds.feedback_skip_forNow).should('contain.text', 'Skip for Now') + cy.getByData(testIds.feedback_skip_forNow).should('contain.text', 'Skip for Now').click() + }) +}) diff --git a/cypress/e2e/policy-admin/endToEndPolicy.cy.ts b/cypress/e2e/policy-admin/endToEndPolicy.cy.ts index 7370d7fe2..cede8aa38 100644 --- a/cypress/e2e/policy-admin/endToEndPolicy.cy.ts +++ b/cypress/e2e/policy-admin/endToEndPolicy.cy.ts @@ -40,16 +40,12 @@ describe('End to End Flow of Policy Admin', () => { cy.getByData(testIds.data_table_title).should('be.visible', 'Title') cy.getByData(testIds.data_table_description).should('be.visible', 'Description') cy.getByData(testIds.data_table_status).should('be.visible', 'Status') - cy.getByData(testIds.data_table_startDate).should('be.visible', 'Start Date') - cy.getByData(testIds.data_table_endDate).should('be.visible', 'End Date') }) it('should Render all Table Item on Homepage', () => { cy.getByData(testIds.table_item_name).should('be.visible') cy.getByData(testIds.table_item_description).should('be.visible') cy.getByData(testIds.status_data).should('be.visible', 'Status') - cy.getByData(testIds.table_item_startDate).should('be.visible') - cy.getByData(testIds.table_item_endDate).should('be.visible') }) it('Should render By default All tab ', () => { cy.getByData(`tablist_name${'All'}`).eq(0).click() @@ -110,58 +106,57 @@ describe('End to End Flow of Policy Admin', () => { }) }) //Information Category is "Privacy" - // context('Should create Policy', () => { - // it('should allow user to fill the form and submit with select privacy', () => { - // cy.getByData(testIds.policy_title_input).type('Sample Policy Title one') - // cy.getByData(testIds.policy_info_category_dropdown).click() - // cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') - // cy.getByData('menu-list').should('be.visible').contains('Privacy').click() - // cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') - // cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') - // cy.getByData(testIds.country_dropdown).click() - // cy.getByData('menu-list').should('be.visible') - // cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() - // cy.wait(5000) - // cy.getByData(testIds.city_dropdown).click() - // cy.get('[data-test="menu-list"]').should('be.visible') - // cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() - // cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') - // cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') - // cy.getByData(testIds.policy_source_input).clear().type('https://www.google.com/') - // cy.getByData(testIds.policy_applicable_to_select).click() - // cy.getByData('policy-applicable-list') - // .should('be.visible') - // .first() - // .within(() => { - // cy.contains('label', 'BAP').click() - // }) - // cy.getByData(testIds.policy_rules_code).should('not.be.empty') - // cy.getByData(testIds.save_policy).click() - // cy.getByData(testIds.feedback).should('contain.text', 'Policy saved successfully!') - - // }) - // // it('should allow user to fill the form and submit with select alcohol', () => { - // // cy.getByData(testIds.policy_title_input).type('Sample Policy Title') - // // cy.getByData(testIds.policy_info_category_dropdown).click() - // // cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') - // // cy.getByData('menu-list').should('be.visible').contains('Alcohol').click() - // // cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') - // // cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') - // // cy.getByData(testIds.country_dropdown).click() - // // cy.getByData('menu-list').should('be.visible') - // // cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() - // // cy.wait(5000) - // // cy.getByData(testIds.city_dropdown).click() - // // cy.get('[data-test="menu-list"]').should('be.visible') - // // cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() - // // cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') - // // cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') - // // cy.getByData(testIds.policy_source_input).clear().type('https://www.google.com/') - // // cy.getByData(testIds.policy_applicable_to_select).click() - // // cy.getByData(testIds.save_policy).click() - // // cy.getByData(testIds.feedback).should('contain.text', 'Policy saved successfully!') - // // }) - // }) + context('Should create Policy', () => { + it('should allow user to fill the form and submit with select privacy', () => { + cy.getByData(testIds.policy_title_input).type('Sample Policy Title one') + cy.getByData(testIds.policy_info_category_dropdown).click() + cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') + cy.getByData('menu-list').should('be.visible').contains('Privacy').click() + cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') + cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') + cy.getByData(testIds.country_dropdown).click() + cy.getByData('menu-list').should('be.visible') + cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() + cy.wait(5000) + cy.getByData(testIds.city_dropdown).click() + cy.get('[data-test="menu-list"]').should('be.visible') + cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() + cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') + cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') + cy.getByData(testIds.policy_source_input).clear().type('https://www.google.com/') + cy.getByData(testIds.policy_applicable_to_select).click() + cy.getByData('policy-applicable-list') + .should('be.visible') + .first() + .within(() => { + cy.contains('label', 'BAP').click() + }) + cy.getByData(testIds.policy_rules_code).should('not.be.empty') + cy.getByData(testIds.save_policy).click() + cy.getByData(testIds.feedback).should('contain.text', 'Policy saved successfully!') + }) + // it('should allow user to fill the form and submit with select alcohol', () => { + // cy.getByData(testIds.policy_title_input).type('Sample Policy Title') + // cy.getByData(testIds.policy_info_category_dropdown).click() + // cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') + // cy.getByData('menu-list').should('be.visible').contains('Alcohol').click() + // cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') + // cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') + // cy.getByData(testIds.country_dropdown).click() + // cy.getByData('menu-list').should('be.visible') + // cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() + // cy.wait(5000) + // cy.getByData(testIds.city_dropdown).click() + // cy.get('[data-test="menu-list"]').should('be.visible') + // cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() + // cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') + // cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') + // cy.getByData(testIds.policy_source_input).clear().type('https://www.google.com/') + // cy.getByData(testIds.policy_applicable_to_select).click() + // cy.getByData(testIds.save_policy).click() + // cy.getByData(testIds.feedback).should('contain.text', 'Policy saved successfully!') + // }) + }) //Information Category is "Alcohol" // context('Should create Policy', () => { // it('should allow user to fill the form and submit with select alcohol', () => { @@ -191,211 +186,121 @@ describe('End to End Flow of Policy Admin', () => { // cy.getByData(testIds.policy_rules_code).should('not.be.empty') // cy.getByData(testIds.save_policy).click() // cy.getByData(testIds.feedback).should('contain.text', 'Policy saved successfully!') + // cy.wait(3000) // }) // }) //Information Category is "Geofence" - context('Should create Policy', () => { - // it('should allow user to fill the form and submit with geofence', () => { - // cy.getByData(testIds.policy_title_input).type('Sample Policy Title') - // cy.getByData(testIds.policy_info_category_dropdown).click() - // cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') - // cy.getByData('menu-list').should('be.visible').contains('Geofence').click() - // cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') - // cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') - // cy.getByData(testIds.country_dropdown).click() - // cy.getByData('menu-list').should('be.visible') - // cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() - // cy.wait(500) - // cy.getByData(testIds.city_dropdown).click() - // cy.get('[data-test="menu-list"]').should('be.visible') - // cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() - // cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') - // cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') - // cy.getByData(testIds.policy_source_input).type('https://www.google.com/') - // cy.getByData(testIds.policy_applicable_to_select).click() - // cy.getByData('policy-applicable-list') - // .should('be.visible') - // .first() - // .within(() => { - // cy.contains('label', 'BAP').click() - // }) - // cy.getByData(testIds.geofence).should('be.visible') - // cy.getByData(testIds.geofence_icon).should('be.visible') - // cy.getByData(testIds.geofence_text).should('be.visible') - // cy.getByData(testIds.create_geofence).click() - // cy.getByData(testIds.draw_geofence_text).should('be.visible') - // cy.getByData(testIds.clear_geofence_text).should('be.visible') - // // const polygonPoints = [ - // // { lat: 13.21900280058148, lng: 77.70856870822249 }, - // // { lat: 13.191761880316314, lng: 77.69191755465803 }, - // // { lat: 13.20195669095579, lng: 77.73569120578108 } - // // ] - // const polygonPoints = [ - // { lat: 12.954423066538682, lng: 77.52976174501953 }, - // { lat: 12.94739668785578, lng: 77.70794625429687 }, - // { lat: 12.853692748106544, lng: 77.6052927508789 } - // ] - // cy.intercept( - // 'POST', - // 'https://maps.googleapis.com/$rpc/google.internal.maps.mapsjs.v1.MapsJsInternalService/GetViewportInfo', - // { - // statusCode: 200, - // body: { - // viewport: { - // // Mock any relevant data your application uses - // northeast: { - // lat: 13.1, - // lng: 78.0 - // }, - // southwest: { - // lat: 12.8, - // lng: 77.0 - // } - // } - // } - // } - // ).as('getViewportInfo') + // context('Should create Policy', () => { + // // it('should allow user to fill the form and submit with geofence', () => { + // // cy.getByData(testIds.policy_title_input).type('Sample Policy Title') + // // cy.getByData(testIds.policy_info_category_dropdown).click() + // // cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') + // // cy.getByData('menu-list').should('be.visible').contains('Geofence').click() + // // cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') + // // cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') + // // cy.getByData(testIds.country_dropdown).click() + // // cy.getByData('menu-list').should('be.visible') + // // cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() + // // cy.wait(500) + // // cy.getByData(testIds.city_dropdown).click() + // // cy.get('[data-test="menu-list"]').should('be.visible') + // // cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() + // // cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') + // // cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') + // // cy.getByData(testIds.policy_source_input).type('https://www.google.com/') + // // cy.getByData(testIds.policy_applicable_to_select).click() + // // cy.getByData('policy-applicable-list') + // // .should('be.visible') + // // .first() + // // .within(() => { + // // cy.contains('label', 'BAP').click() + // // }) + // // cy.getByData(testIds.geofence).should('be.visible') + // // cy.getByData(testIds.geofence_icon).should('be.visible') + // // cy.getByData(testIds.geofence_text).should('be.visible') + // // cy.getByData(testIds.create_geofence).click() + // // cy.getByData(testIds.draw_geofence_text).should('be.visible') + // // cy.getByData(testIds.clear_geofence_text).should('be.visible') + // // // const polygonPoints = [ + // // // { lat: 13.21900280058148, lng: 77.70856870822249 }, + // // // { lat: 13.191761880316314, lng: 77.69191755465803 }, + // // // { lat: 13.20195669095579, lng: 77.73569120578108 } + // // // ] + // // const polygonPoints = [ + // // { lat: 12.954423066538682, lng: 77.52976174501953 }, + // // { lat: 12.94739668785578, lng: 77.70794625429687 }, + // // { lat: 12.853692748106544, lng: 77.6052927508789 } + // // ] + // // cy.intercept( + // // 'POST', + // // 'https://maps.googleapis.com/$rpc/google.internal.maps.mapsjs.v1.MapsJsInternalService/GetViewportInfo', + // // { + // // statusCode: 200, + // // body: { + // // viewport: { + // // // Mock any relevant data your application uses + // // northeast: { + // // lat: 13.1, + // // lng: 78.0 + // // }, + // // southwest: { + // // lat: 12.8, + // // lng: 77.0 + // // } + // // } + // // } + // // } + // // ).as('getViewportInfo') - // cy.wait(500) - // cy.get('.gm-style', { timeout: 10000 }) - // .should('be.visible') - // .then(mapElement => { - // cy.window().then(win => { - // const htmlMapElement = mapElement[0] as HTMLElement - // // const map = new win.google.maps.Map(htmlMapElement, { - // // center: { lat: 13.21900280058148, lng: 77.70856870822249 }, - // // zoom: 12 - // // }) - // const map = new win.google.maps.Map(htmlMapElement, { - // center: { lat: 12.954423066538682, lng: 77.52976174501953 }, - // zoom: 12 - // }) - // // Create a polygon and add it to the map - // const geofencePolygon = new win.google.maps.Polygon({ - // paths: polygonPoints, - // strokeColor: '#01326A', - // strokeOpacity: 0.8, - // strokeWeight: 2, - // fillColor: '#01326A', - // fillOpacity: 0.35 - // }) - // geofencePolygon.setMap(map) - // }) - // }) + // // cy.wait(500) + // // cy.get('.gm-style', { timeout: 10000 }) + // // .should('be.visible') + // // .then(mapElement => { + // // cy.window().then(win => { + // // const htmlMapElement = mapElement[0] as HTMLElement + // // // const map = new win.google.maps.Map(htmlMapElement, { + // // // center: { lat: 13.21900280058148, lng: 77.70856870822249 }, + // // // zoom: 12 + // // // }) + // // const map = new win.google.maps.Map(htmlMapElement, { + // // center: { lat: 12.954423066538682, lng: 77.52976174501953 }, + // // zoom: 12 + // // }) + // // // Create a polygon and add it to the map + // // const geofencePolygon = new win.google.maps.Polygon({ + // // paths: polygonPoints, + // // strokeColor: '#01326A', + // // strokeOpacity: 0.8, + // // strokeWeight: 2, + // // fillColor: '#01326A', + // // fillOpacity: 0.35 + // // }) + // // geofencePolygon.setMap(map) + // // }) + // // }) - // const coordinatesForForm: any = polygonPoints.map(point => `${point.lat}, ${point.lng}`) - // cy.wait(3000) - // cy.updatePolygon(coordinatesForForm) - // cy.getByData(testIds.cancel_geofence_btn).should('be.visible') - // cy.getByData(testIds.save_geofence_btn).should('be.visible') - // cy.wait(5000) - // cy.getByData(testIds.save_geofence_btn).click() - // cy.updatePolygon(coordinatesForForm) - // cy.getByData(testIds.policy_rules_code).should('not.be.empty') - // cy.wait(3000) - // cy.getByData(testIds.save_policy).click() - // }) + // // const coordinatesForForm: any = polygonPoints.map(point => `${point.lat}, ${point.lng}`) + // // cy.wait(3000) + // // cy.updatePolygon(coordinatesForForm) + // // cy.getByData(testIds.cancel_geofence_btn).should('be.visible') + // // cy.getByData(testIds.save_geofence_btn).should('be.visible') + // // cy.wait(5000) + // // cy.getByData(testIds.save_geofence_btn).click() + // // cy.updatePolygon(coordinatesForForm) + // // cy.getByData(testIds.policy_rules_code).should('not.be.empty') + // // cy.wait(3000) + // // cy.getByData(testIds.save_policy).click() + // // }) + // }) + context('Should change status of Policy', () => { it('should allow user to fill the form and submit with geofence', () => { - cy.getByData(testIds.policy_title_input).type('Sample Policy Title') - cy.getByData(testIds.policy_info_category_dropdown).click() - cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') - cy.getByData('menu-list').should('be.visible').contains('Geofence').click() - cy.getByData(testIds.info_source_owner_input).type('Policy Owner Name') - cy.getByData(testIds.policy_description_textArea).type('This is a sample policy description.') - cy.getByData(testIds.country_dropdown).click() - cy.getByData('menu-list').should('be.visible') - cy.get('[data-test="menu-list"][data-index="0"]').should('be.visible').eq(1).click() - cy.wait(500) - cy.getByData(testIds.city_dropdown).click() - cy.get('[data-test="menu-list"]').should('be.visible') - cy.getByData('menu-list').should('be.visible').contains('Bangalore').click() - cy.getByData(testIds.date_pick_from).find('input').clear().type('12-12-2025') - cy.getByData(testIds.date_pick_to).find('input').clear().type('31-12-2025') - cy.getByData(testIds.policy_source_input).type('https://www.google.com/') - cy.getByData(testIds.policy_applicable_to_select).click() - cy.getByData('policy-applicable-list') - .should('be.visible') - .first() - .within(() => { - cy.contains('label', 'BAP').click() - }) - cy.getByData(testIds.geofence).should('be.visible') - cy.getByData(testIds.geofence_icon).should('be.visible') - cy.getByData(testIds.geofence_text).should('be.visible') - cy.getByData(testIds.create_geofence).click() - cy.url().should('include', '/createGeofence') - - cy.getByData(testIds.draw_geofence_text).should('be.visible') - cy.getByData(testIds.clear_geofence_text).should('be.visible') - - const polygonPoints = [ - { lat: 12.954423066538682, lng: 77.52976174501953 }, - { lat: 12.94739668785578, lng: 77.70794625429687 }, - { lat: 12.853692748106544, lng: 77.6052927508789 } - ] - - // Intercept the Google Maps API call and mock the response - cy.intercept( - 'POST', - 'https://maps.googleapis.com/$rpc/google.internal.maps.mapsjs.v1.MapsJsInternalService/GetViewportInfo', - { - statusCode: 200, - body: { - viewport: { - // Mock any relevant data your application uses - northeast: { - lat: 13.1, - lng: 78.0 - }, - southwest: { - lat: 12.8, - lng: 77.0 - } - } - } - } - ).as('getViewportInfo') - - cy.wait(500) - cy.get('.gm-style', { timeout: 10000 }) - .should('be.visible') - .then(mapElement => { - cy.window().then(win => { - const htmlMapElement = mapElement[0] as HTMLElement - - const map = new win.google.maps.Map(htmlMapElement, { - center: { lat: 12.954423066538682, lng: 77.52976174501953 }, - zoom: 12 - }) - - // Create a polygon and add it to the map - const geofencePolygon = new win.google.maps.Polygon({ - paths: polygonPoints, - strokeColor: '#01326A', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#01326A', - fillOpacity: 0.35 - }) - geofencePolygon.setMap(map) - }) - }) - const coordinatesForForm: any = polygonPoints.map(point => `${point.lat}, ${point.lng}`) - cy.updatePolygon(coordinatesForForm) - cy.getByData(testIds.cancel_geofence_btn).should('be.visible') - cy.getByData(testIds.save_geofence_btn).should('be.visible') - cy.wait(5000) - cy.getByData(testIds.save_geofence_btn).click() - cy.updatePolygon(coordinatesForForm) - cy.getByData(testIds.policy_rules_code).should('not.be.empty') - cy.getByData(testIds.save_policy).click() - cy.url().should('include', '/') + cy.visit(testIds.deployed_policy_url_base) + cy.getByData(testIds.table_item_name).should('be.visible').eq(0).click() + }) + }) + context('Should logout from app', () => { + it('Should logout from app', () => { + cy.visit('https://policyadmin-dev.becknprotocol.io/signIn') }) }) - // context('Should change status of Policy', () => { - // it('should allow user to fill the form and submit with geofence', () => { - // cy.visit(testIds.deployed_policy_url_base) - // cy.getByData(testIds.table_item_name).should('be.visible').eq(0).click() - // }) - // }) }) diff --git a/cypress/e2e/policy-admin/negativeTc.cy.ts b/cypress/e2e/policy-admin/negativeTc.cy.ts new file mode 100644 index 000000000..bf6d51f76 --- /dev/null +++ b/cypress/e2e/policy-admin/negativeTc.cy.ts @@ -0,0 +1,137 @@ +import { testIds } from '../../../shared/dataTestIds' + +describe('Negative TC for Policy Admin', () => { + context('Signin flow and validation', () => { + beforeEach(() => { + cy.visit(testIds.deployed_policy_url_base) + }) + it('should display the sign-in form with email and password fields', () => { + cy.getByData('input-email').should('exist').and('be.visible') + cy.getByData('input-password').should('exist').and('be.visible') + }) + + it('should disable the signin button when form is submitted with empty fields', () => { + cy.getByData('login-button').should('be.disabled') + }) + + it('should update email and password fields when typed into', () => { + cy.getByData('input-email').type(testIds.user_validEmail) + cy.getByData('input-email').should('have.value', testIds.user_validEmail) + cy.getByData('input-password').type(testIds.user_validPassword) + cy.getByData('input-password').should('have.value', testIds.user_validPassword) + }) + + it('should enable the Sign In button when both fields are filled', () => { + cy.getByData('input-email').type(testIds.user_validEmail) + cy.getByData('input-password').type(testIds.user_validPassword) + cy.getByData('login-button').should('not.be.disabled') + }) + + it('should show error toast on unsuccessful login', () => { + cy.getByData('input-email').type(testIds.user_validEmail) + cy.getByData('input-password').type(testIds.user_invalidPassword) + cy.getByData('login-button').click() + cy.getByData(testIds.feedback).should('contain.text', 'Error!Wrong Password') + }) + + it('should open the forgot password modal', () => { + cy.getByData('forgot-button').click() + cy.getByData('forgot-password').should('exist').and('be.visible') + }) + + it('should show an error for an invalid email in forgot password modal', () => { + cy.getByData('forgot-button').click() + cy.getByData('enter-email').type('invalid-email') + cy.getByData('forgot-password-email-error').should('contain', 'Please enter a valid email address') + }) + + it('should allow valid email input in forgot password modal', () => { + cy.getByData('forgot-button').click() + cy.getByData('enter-email').type(testIds.user_validEmail) + cy.getByData('forgot-password-email-error').should('not.exist') + }) + + it('should send reset link and show success toast', () => { + cy.getByData('forgot-button').click() + cy.getByData('enter-email').type(testIds.user_validEmail) + cy.getByData('send-link').click() + + cy.getByData(testIds.feedback).should( + 'contain.text', + 'SuccessPlease check your email for the password reset link.' + ) + }) + it('should enable the Sign In button when both fields are filled', () => { + cy.getByData('input-email').type(testIds.user_validEmail) + cy.getByData('input-password').type(testIds.user_validPassword) + cy.getByData('login-button').should('not.be.disabled') + cy.getByData('login-button').click() + }) + }) + context('Create policy and validation ', () => { + it('should Render CreateNewPolicy page when click on Create New Button', () => { + cy.getByData(testIds.create_new_policy).click() + cy.url().should('include', '/createPolicy') + }) + it('should render the homepage components', () => { + cy.getByData(testIds.add_info_metadata).should('be.visible') + cy.getByData(testIds.switch_btn).should('be.visible') + cy.getByData(testIds.switch_btn_text).should('be.visible') + cy.getByData(testIds.policy_title).should('be.visible') + cy.getByData(testIds.policy_title_input).should('be.visible') + cy.getByData(testIds.policy_info_category).should('be.visible') + cy.getByData(testIds.policy_info_category_dropdown).should('be.visible') + cy.getByData(testIds.info_source_owner).should('be.visible') + cy.getByData(testIds.info_source_owner_input).should('be.visible') + cy.getByData(testIds.policy_description).should('be.visible') + cy.getByData(testIds.policy_description_textArea).should('be.visible') + cy.getByData(testIds.country).scrollIntoView().should('be.visible') + cy.getByData(testIds.country_dropdown).should('be.visible') + cy.getByData(testIds.city).scrollIntoView().should('be.visible') + cy.getByData(testIds.city_dropdown).should('be.visible') + cy.getByData(testIds.policy_from_date).should('be.visible') + cy.getByData(testIds.date_pick_from).find('input').should('be.visible') + cy.getByData(testIds.policy_to_date).should('be.visible') + cy.getByData(testIds.date_pick_to).find('input').should('be.visible') + cy.getByData(testIds.policy_source).should('be.visible') + cy.getByData(testIds.policy_source_input).should('be.visible') + cy.getByData(testIds.policy_applicable_to).should('be.visible') + cy.getByData(testIds.policy_rules).should('be.visible') + cy.getByData(testIds.policy_rules_code).should('be.visible') + cy.getByData(testIds.go_back_home).scrollIntoView().should('be.visible') + cy.getByData(testIds.save_policy).should('be.visible') + }) + it('should display validation errors for empty required fields on submit', () => { + cy.getByData(testIds.save_policy).click() + cy.getByData(testIds.title_error).should('contain', 'Title is required') + cy.getByData(testIds.policy_info_category_error).should('contain', 'Information category is required') + cy.getByData(testIds.info_source_owner_input_error).should('contain', 'Owner name is required') + cy.getByData(testIds.policy_description_textArea_error).should('contain', 'Description is required') + cy.getByData(testIds.city_error).should('contain', 'City is required') + cy.getByData(testIds.policy_source_error).should('contain', 'Source url is required') + cy.getByData(testIds.policy_applicable_to_error).should('contain', 'Applicable To is required') + }) + it('should display validation errors with invalid value', () => { + cy.getByData(testIds.policy_title_input).clear().type('policy') + + cy.getByData(testIds.info_source_owner_input).clear() + cy.getByData(testIds.policy_description_textArea).clear().type('policy') + cy.getByData(testIds.date_pick_from).find('input').clear() + cy.getByData(testIds.date_pick_to).find('input').clear() + cy.getByData(testIds.policy_source_input).clear().type('policy') + cy.getByData(testIds.save_policy).click() + cy.getByData(testIds.title_error).should('contain', 'The title must be between 10 and 100 characters long.') + cy.getByData(testIds.policy_from_date_error).should('contain', 'Start date is required') + cy.getByData(testIds.policy_to_date_error).should('contain', 'End date is required') + cy.getByData(testIds.info_source_owner_input_error).should('contain', 'Owner name is required') + cy.getByData(testIds.policy_description_textArea_error).should( + 'contain', + 'The description must be between 20 and 500 characters long.' + ) + cy.getByData(testIds.policy_source_error).should( + 'contain', + "Please enter a valid URL, starting with 'http://' or 'https://'." + ) + }) + }) +}) diff --git a/cypress/e2e/taxi-bpp/driverEndToEndAfrica.cy.ts b/cypress/e2e/taxi-bpp/driverEndToEndAfrica.cy.ts new file mode 100644 index 000000000..956f68626 --- /dev/null +++ b/cypress/e2e/taxi-bpp/driverEndToEndAfrica.cy.ts @@ -0,0 +1,128 @@ +import { testIds } from '../../../shared/dataTestIds' + +describe('Driver app end to end Testing', () => { + it('should open driver app', () => { + cy.visit('https://driverapp-dev.becknprotocol.io/') + }) + // Valid login scenario + it('should Login in into driver app', () => { + cy.getByData(testIds.auth_inputEmail).clear().type('kebba@gambiaride.com') + cy.getByData(testIds.auth_inputPassword).clear().type('Abcd@1234') + cy.getByData(testIds.auth_loginButton).should('not.be.disabled').click() + cy.wait(100) + }) + it('should check and validate toggle', () => { + cy.getByData(testIds.taxi_BPP_offlineMode_image).should('be.visible') + cy.getByData(testIds.taxi_BPP_switch_toggle_button).should('be.visible') + cy.getByData(testIds.taxi_BPP_offlineMode_offlineTitle).should('be.visible') + cy.getByData(testIds.taxi_BPP_offlineMode_offlineDescription).should('be.visible') + cy.getByData(testIds.taxi_BPP_switch_toggle_button).click() + }) + it('should set driver location', () => { + cy.getByData(testIds.location).should('be.visible') + cy.getByData(testIds.downArrow).click() + cy.wait(1000) + cy.get('body').type(' serekunda') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + }) + //Open Mobility app, and set Pickup location as Serekunda,Market + // and Drop off location as Banjul. + //Click on button 'Search ride' + //Select available ride and enter details, confir and Proceed + + it('should validate New Ride Request', () => { + cy.wait(30000) + 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('Accept button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_decline_button).should('be.visible') + cy.getByData(testIds.taxi_BPP_accept_button).click() + }) + it('Reached Pick up Location_button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_Reached_Pick_up_Location_button).click() + }) + it('should display the top header with start ride details visible', () => { + cy.getByData('ride-summary-header-img').should('exist').and('be.visible') + cy.getByData('GOING_FOR_PICK_UP').should('exist').and('be.visible') + cy.getByData('header-sub-title').should('exist').and('be.visible') + cy.getByData('driver-img').should('exist').and('be.visible') + cy.getByData('driver-call-img').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_away_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_distance_text).should('exist').and('be.visible') + cy.getByData(testIds.driver_navigate).should('exist').and('be.visible') + cy.getByData(testIds.navigate_img).should('exist').and('be.visible') + cy.getByData('source-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_pickup_location_text).should('exist').and('be.visible') + cy.getByData('destination-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_drop_location_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_Start_ride_button).should('exist').and('be.visible') + }) + it('Driver end call button should be clickable', () => { + cy.getByData('driver-call-click').should('be.visible') + }) + it('Navigate button should be clickable', () => { + cy.getByData('driver-call-click').should('be.visible') + }) + it('Start ride button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_Start_ride_button).click() + }) + it('End ride button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_end_ride_button).click() + }) + it('should display the top header with looking for new ride details visible', () => { + cy.getByData('ride-summary-header-img').should('exist').and('be.visible') + cy.getByData('COMPLETED').should('exist').and('be.visible') + cy.getByData('header-sub-title').should('exist').and('be.visible') + cy.getByData('driver-img').should('exist').and('be.visible') + cy.getByData('driver-call-img').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_away_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_distance_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_bpp_complete_ride_date).should('exist').and('be.visible') + cy.getByData('source-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_pickup_location_text).should('exist').and('be.visible') + cy.getByData('destination-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_drop_location_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_fare_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_cost_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_Look_for_New_Ride_Request_button).should('exist').and('be.visible') + }) + it('Driver end call button should be clickable', () => { + cy.getByData('driver-call-click').should('be.visible') + }) + it('Start ride button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_Look_for_New_Ride_Request_button).click() + }) + it('Should Display My Rides Details ', () => { + cy.getByData(testIds.threeDots).click() + cy.getByData(testIds.taxi_BPP_rideHistory).click() + cy.url().should('include', '/myRides') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_All"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_On-going"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_Completed"]').should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_carImage).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_riderName).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_date).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_time).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_status).should('be.visible') + }) + it('Should Display by default All Tabs', () => { + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_All"]').should('be.visible') + }) + it('Should Display Ongoing tabs when click on Ongoing tabs', () => { + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_On-going"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_On-going"]').click() + }) + it('Should Display Completed tabs when click on Completed tabs', () => { + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_Completed"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_Completed"]').click() + }) + it('Should Logout from app ', () => { + cy.getByData(testIds.threeDots).click() + cy.getByData(testIds.Logout_text).click() + }) +}) diff --git a/cypress/e2e/taxi-bpp/driverEndToEndCities.cy.ts b/cypress/e2e/taxi-bpp/driverEndToEndCities.cy.ts new file mode 100644 index 000000000..f185eecce --- /dev/null +++ b/cypress/e2e/taxi-bpp/driverEndToEndCities.cy.ts @@ -0,0 +1,128 @@ +import { testIds } from '../../../shared/dataTestIds' + +describe('Driver app end to end Testing', () => { + it('should open driver app', () => { + cy.visit('https://driverapp-dev.becknprotocol.io/') + }) + // Valid login scenario + it('should Login in into driver app', () => { + cy.getByData(testIds.auth_inputEmail).clear().type('ramesh@xyzcab.com') + cy.getByData(testIds.auth_inputPassword).clear().type('Abcd@1234') + cy.getByData(testIds.auth_loginButton).should('not.be.disabled').click() + cy.wait(100) + }) + it('should check and validate toggle', () => { + cy.getByData(testIds.taxi_BPP_offlineMode_image).should('be.visible') + cy.getByData(testIds.taxi_BPP_switch_toggle_button).should('be.visible') + cy.getByData(testIds.taxi_BPP_offlineMode_offlineTitle).should('be.visible') + cy.getByData(testIds.taxi_BPP_offlineMode_offlineDescription).should('be.visible') + cy.getByData(testIds.taxi_BPP_switch_toggle_button).click() + }) + it('should set driver location', () => { + cy.getByData(testIds.location).should('be.visible') + cy.getByData(testIds.downArrow).click() + cy.wait(1000) + cy.get('body').type(' conrad hotel, bengaluru') + cy.getByData(testIds.location_list_item).should('be.visible').eq(0).click() + }) + //Open Mobility app, and set Pickup location as Conrad hotel,bangaluru + // and Drop off location as kempegowda international airport, karnataka + //Click on button 'Search ride' + //Select available ride and enter details, confir and Proceed + + it('should validate New Ride Request', () => { + cy.wait(30000) + 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('Accept button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_decline_button).should('be.visible') + cy.getByData(testIds.taxi_BPP_accept_button).click() + }) + it('Reached Pick up Location_button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_Reached_Pick_up_Location_button).click() + }) + it('should display the top header with start ride details visible', () => { + cy.getByData('ride-summary-header-img').should('exist').and('be.visible') + cy.getByData('GOING_FOR_PICK_UP').should('exist').and('be.visible') + cy.getByData('header-sub-title').should('exist').and('be.visible') + cy.getByData('driver-img').should('exist').and('be.visible') + cy.getByData('driver-call-img').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_away_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_distance_text).should('exist').and('be.visible') + cy.getByData(testIds.driver_navigate).should('exist').and('be.visible') + cy.getByData(testIds.navigate_img).should('exist').and('be.visible') + cy.getByData('source-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_pickup_location_text).should('exist').and('be.visible') + cy.getByData('destination-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_drop_location_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_Start_ride_button).should('exist').and('be.visible') + }) + it('Driver end call button should be clickable', () => { + cy.getByData('driver-call-click').should('be.visible') + }) + it('Navigate button should be clickable', () => { + cy.getByData('driver-call-click').should('be.visible') + }) + it('Start ride button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_Start_ride_button).click() + }) + it('End ride button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_end_ride_button).click() + }) + it('should display the top header with looking for new ride details visible', () => { + cy.getByData('ride-summary-header-img').should('exist').and('be.visible') + cy.getByData('COMPLETED').should('exist').and('be.visible') + cy.getByData('header-sub-title').should('exist').and('be.visible') + cy.getByData('driver-img').should('exist').and('be.visible') + cy.getByData('driver-call-img').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_away_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_km_distance_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_bpp_complete_ride_date).should('exist').and('be.visible') + cy.getByData('source-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_pickup_location_text).should('exist').and('be.visible') + cy.getByData('destination-icon').should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_drop_location_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_fare_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_cost_text).should('exist').and('be.visible') + cy.getByData(testIds.taxi_BPP_Look_for_New_Ride_Request_button).should('exist').and('be.visible') + }) + it('Driver end call button should be clickable', () => { + cy.getByData('driver-call-click').should('be.visible') + }) + it('Start ride button should be clickable', () => { + cy.getByData(testIds.taxi_BPP_Look_for_New_Ride_Request_button).click() + }) + it('Should Display My Rides Details ', () => { + cy.getByData(testIds.threeDots).click() + cy.getByData(testIds.taxi_BPP_rideHistory).click() + cy.url().should('include', '/myRides') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_All"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_On-going"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_Completed"]').should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_carImage).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_riderName).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_date).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_time).should('be.visible') + cy.getByData(testIds.taxi_BPP_myRides_status).should('be.visible') + }) + it('Should Display by default All Tabs', () => { + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_All"]').should('be.visible') + }) + it('Should Display Ongoing tabs when click on Ongoing tabs', () => { + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_On-going"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_On-going"]').click() + }) + it('Should Display Completed tabs when click on Completed tabs', () => { + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_Completed"]').should('be.visible') + cy.get('[data-test="testIds.taxi_BPP_my_rides_tablist_name_Completed"]').click() + }) + it('Should Logout from app ', () => { + cy.getByData(testIds.threeDots).click() + cy.getByData(testIds.Logout_text).click() + }) +})