diff --git a/apps/dsep/pages/applicationSent.tsx b/apps/dsep/pages/applicationSent.tsx index 2b1804148..951acb833 100644 --- a/apps/dsep/pages/applicationSent.tsx +++ b/apps/dsep/pages/applicationSent.tsx @@ -3,6 +3,7 @@ import { useRouter } from 'next/router' import React from 'react' import orderConfirmmark from '../public/images/orderConfirmmark.svg' import { useLanguage } from '../hooks/useLanguage' +import { testIds } from '@shared/dataTestIds' const applicationSent = () => { const { t } = useLanguage() @@ -22,7 +23,8 @@ const applicationSent = () => { }, disabled: false, variant: 'solid', - colorScheme: 'primary' + colorScheme: 'primary', + dataTest: testIds.jobSubmitted_viewNewJob }, { text: t.goBackBtn, @@ -31,7 +33,8 @@ const applicationSent = () => { }, disabled: false, variant: 'outline', - colorScheme: 'primary' + colorScheme: 'primary', + dataTest: testIds.jobSubmitted_viewToHomePage } ] }} diff --git a/apps/dsep/pages/jobApply.tsx b/apps/dsep/pages/jobApply.tsx index 5120184f3..d449ad6c9 100644 --- a/apps/dsep/pages/jobApply.tsx +++ b/apps/dsep/pages/jobApply.tsx @@ -23,6 +23,7 @@ import { ConfirmResponseModel } from '../lib/types/confirm.types' import 'react-toastify/dist/ReactToastify.css' import { InitResponseModel } from '../lib/types/init.types' import axios from '../services/axios' +import { testIds } from '@shared/dataTestIds' const jobApply = () => { const [selectedFiles, setSelectedFiles] = useState([]) @@ -185,6 +186,7 @@ const jobApply = () => { ) @@ -200,6 +202,7 @@ const jobApply = () => { ) diff --git a/cypress/e2e/dsep/jobApply.cy.ts b/cypress/e2e/dsep/jobApply.cy.ts new file mode 100644 index 000000000..8f642f4ae --- /dev/null +++ b/cypress/e2e/dsep/jobApply.cy.ts @@ -0,0 +1,81 @@ +import { testIds } from '../../../shared/dataTestIds' +import { initResponse } from '../../fixtures/DSEP/checkoutPage/initResponse' +import { confirmResponse } from '../../fixtures/DSEP/orderConfirmation/confirmResponse' +import { orderResponse } from '../../fixtures/DSEP/orderConfirmation/orderResponse' +import { statusResponse } from '../../fixtures/DSEP/orderDetails/statusResponse' +import 'cypress-file-upload' + +describe.only('job Apply Page', () => { + const searchTerm = 'Java' + + before(() => { + cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) + cy.visit(`${testIds.url_base}${testIds.url_home}`) + cy.performSearch(searchTerm, { + fixture: 'DSEP/searchPage/searchResults.json' + }) + cy.performSelect({ fixture: 'DSEP/checkoutPage/selectResponse.json' }, 'selectResponse') + cy.selectProduct(0) + cy.getByData(testIds.productpage_addTocartButton).click() + cy.getByData(testIds.cartButton).click() + cy.wait('@selectResponse') + cy.getByData(testIds.cartpage_cartOrderButton).click() + cy.getByData(testIds.feedback).getByData('close').click() + cy.intercept('GET', '**/api/profiles?populate[0]=documents.attachment', { + fixture: 'DSEP/checkoutPage/profilePopulate.json' + }).as('getProfilePopulate') + cy.url().should('include', '/checkoutPage') + cy.fillAndSaveShippingDetails() + cy.performInit(initResponse, 'initResponse') + cy.wait('@initResponse') + cy.getByData(testIds.checkoutpage_proceedToCheckout).click() + cy.performConfirm(confirmResponse, 'confirmResponse') + cy.performOrders(orderResponse, 'orderResponse') + cy.performStatus(statusResponse('PAYMENT_RECEIVED'), 'processStatusResponse') + cy.wait('@confirmResponse') + cy.wait('@orderResponse') + cy.url().should('include', '/orderConfirmation') + cy.getByData(testIds.orderConfirmation_viewOrderButton).click() + cy.wait('@processStatusResponse') + cy.getByData(testIds.job_main_container_job_search_link).click() + cy.intercept('POST', 'https://bap-gcl-prod.becknprotocol.io/search', { + fixture: 'DSEP/jobSearchResponse/jobSearchResponse.json' + }).as('jobSearchResponse') + cy.url().should('include', '/jobSearch') + cy.getByData('job-detail-link').eq(1).click() + cy.url().should('include', '/jobDetails?jobDetails') + cy.getByData(testIds.job_details_apply).click() + cy.intercept('GET', '**/api/profiles?populate[0]=documents.attachment', { + fixture: 'DSEP/jobApply/profilePopulate.json' + }).as('profilePopulate') + cy.intercept('POST', '**/select', { + fixture: 'DSEP/jobApply/selectResponse.json' + }).as('selectResponse') + cy.intercept('POST', '**/init', { + fixture: 'DSEP/jobApply/initResponse.json' + }).as('initResponse') + cy.url().should('include', '/jobApply?jobDetails') + + cy.getByData(testIds.loadingIndicator).should('be.visible') + }) + it('Should render job apply page', () => { + cy.get('#xinputform').should('be.visible') + cy.get('#nameLabel').should('be.visible') + cy.get('#mobileLabel').should('be.visible') + cy.get('#emailLabel').should('be.visible') + }) + + it('Should show error messages for invalid data fields', () => { + cy.get('#name').clear().type('1') + cy.get('#mobile').clear().type('w') + cy.get('#email').clear().type('2') + cy.get('#nameError').should('contain', 'Please enter a valid name.') + cy.get('#mobileError').should('contain', 'Please enter a valid 10-digit mobile number.') + cy.get('#emailError').should('contain', 'Please enter a valid email address.') + cy.get('#submitButton').should('be.disabled') + }) + it('Should render job apply page With valid data', () => { + cy.fillDSEPJobApply() + cy.url().should('include', '/applicationSent') + }) +}) diff --git a/cypress/e2e/dsep/jobDetails.cy.ts b/cypress/e2e/dsep/jobDetails.cy.ts index 88cfb5103..bc92d8fe9 100644 --- a/cypress/e2e/dsep/jobDetails.cy.ts +++ b/cypress/e2e/dsep/jobDetails.cy.ts @@ -37,10 +37,11 @@ describe.only('job Details Page', () => { cy.getByData(testIds.orderConfirmation_viewOrderButton).click() cy.wait('@processStatusResponse') cy.getByData(testIds.job_main_container_job_search_link).click() - cy.intercept('POST', 'https://bap-gcl-prod.becknprotocol.io/search', { + cy.url().should('include', '/jobSearch') + cy.intercept('POST', '**/search', { fixture: 'DSEP/jobSearchResponse/jobSearchResponse.json' }).as('jobSearchResponse') - cy.url().should('include', '/jobSearch') + cy.wait('@jobSearchResponse') cy.getByData('job-detail-link').eq(1).click() cy.url().should('include', '/jobDetails?jobDetails') }) diff --git a/cypress/e2e/dsep/jobSubmittedPage.cy.ts b/cypress/e2e/dsep/jobSubmittedPage.cy.ts new file mode 100644 index 000000000..2be544f12 --- /dev/null +++ b/cypress/e2e/dsep/jobSubmittedPage.cy.ts @@ -0,0 +1,133 @@ +import { testIds } from '../../../shared/dataTestIds' +import { initResponse } from '../../fixtures/DSEP/checkoutPage/initResponse' +import { confirmResponse } from '../../fixtures/DSEP/orderConfirmation/confirmResponse' +import { orderResponse } from '../../fixtures/DSEP/orderConfirmation/orderResponse' +import { statusResponse } from '../../fixtures/DSEP/orderDetails/statusResponse' +import 'cypress-file-upload' + +describe.only('Job Submitted Page', () => { + const searchTerm = 'Java' + context('should render Job Search Page when user click on search more jobs button', () => { + before(() => { + cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) + cy.visit(`${testIds.url_base}${testIds.url_home}`) + cy.performSearch(searchTerm, { + fixture: 'DSEP/searchPage/searchResults.json' + }) + cy.performSelect({ fixture: 'DSEP/checkoutPage/selectResponse.json' }, 'selectResponse') + cy.selectProduct(0) + cy.getByData(testIds.productpage_addTocartButton).click() + cy.getByData(testIds.cartButton).click() + cy.wait('@selectResponse') + cy.getByData(testIds.cartpage_cartOrderButton).click() + cy.getByData(testIds.feedback).getByData('close').click() + cy.intercept('GET', '**/api/profiles?populate[0]=documents.attachment', { + fixture: 'DSEP/checkoutPage/profilePopulate.json' + }).as('getProfilePopulate') + cy.url().should('include', '/checkoutPage') + cy.fillAndSaveShippingDetails() + cy.performInit(initResponse, 'initResponse') + cy.wait('@initResponse') + cy.getByData(testIds.checkoutpage_proceedToCheckout).click() + cy.performConfirm(confirmResponse, 'confirmResponse') + cy.performOrders(orderResponse, 'orderResponse') + cy.performStatus(statusResponse('PAYMENT_RECEIVED'), 'processStatusResponse') + cy.wait('@confirmResponse') + cy.wait('@orderResponse') + cy.url().should('include', '/orderConfirmation') + cy.getByData(testIds.orderConfirmation_viewOrderButton).click() + cy.wait('@processStatusResponse') + cy.getByData(testIds.job_main_container_job_search_link).click() + cy.intercept('POST', 'https://bap-gcl-prod.becknprotocol.io/search', { + fixture: 'DSEP/jobSearchResponse/jobSearchResponse.json' + }).as('jobSearchResponse') + cy.url().should('include', '/jobSearch') + cy.getByData('job-detail-link').eq(1).click() + cy.url().should('include', '/jobDetails?jobDetails') + cy.getByData(testIds.job_details_apply).click() + cy.intercept('GET', '**/api/profiles?populate[0]=documents.attachment', { + fixture: 'DSEP/jobApply/profilePopulate.json' + }).as('profilePopulate') + cy.intercept('POST', '**/select', { + fixture: 'DSEP/jobApply/selectResponse.json' + }).as('selectResponse') + cy.intercept('POST', '**/init', { + fixture: 'DSEP/jobApply/initResponse.json' + }).as('initResponse') + cy.url().should('include', '/jobApply?jobDetails') + cy.getByData(testIds.loadingIndicator).should('be.visible') + cy.fillDSEPJobApply() + cy.url().should('include', '/applicationSent') + }) + it('should display job submitted details after API call', () => { + cy.getByData(testIds.confirmPageImage).should('have.attr', 'src') + cy.getByData(testIds.orderConfirmation_successOrderMessage).should('contain.text', 'Application Submitted!') + cy.getByData(testIds.orderConfirmation_gratefulMessage).should( + 'contain.text', + 'The company will evaluate your application and get back to you soon' + ) + }) + it('should have a button to search more jobs and navigate to job search page when clicked', () => { + cy.getByData(testIds.jobSubmitted_viewNewJob).click() + cy.url().should('include', '/jobSearch') + }) + }) + context('should render Home Page when user click on go back home button', () => { + before(() => { + cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) + cy.visit(`${testIds.url_base}${testIds.url_home}`) + cy.performSearch(searchTerm, { + fixture: 'DSEP/searchPage/searchResults.json' + }) + cy.performSelect({ fixture: 'DSEP/checkoutPage/selectResponse.json' }, 'selectResponse') + cy.selectProduct(0) + cy.getByData(testIds.productpage_addTocartButton).click() + cy.getByData(testIds.cartButton).click() + cy.wait('@selectResponse') + cy.getByData(testIds.cartpage_cartOrderButton).click() + cy.getByData(testIds.feedback).getByData('close').click() + cy.intercept('GET', '**/api/profiles?populate[0]=documents.attachment', { + fixture: 'DSEP/checkoutPage/profilePopulate.json' + }).as('getProfilePopulate') + cy.url().should('include', '/checkoutPage') + cy.fillAndSaveShippingDetails() + cy.performInit(initResponse, 'initResponse') + cy.wait('@initResponse') + cy.getByData(testIds.checkoutpage_proceedToCheckout).click() + cy.performConfirm(confirmResponse, 'confirmResponse') + cy.performOrders(orderResponse, 'orderResponse') + cy.performStatus(statusResponse('PAYMENT_RECEIVED'), 'processStatusResponse') + cy.wait('@confirmResponse') + cy.wait('@orderResponse') + cy.url().should('include', '/orderConfirmation') + cy.getByData(testIds.orderConfirmation_viewOrderButton).click() + cy.wait('@processStatusResponse') + cy.getByData(testIds.job_main_container_job_search_link).click() + cy.intercept('POST', 'https://bap-gcl-prod.becknprotocol.io/search', { + fixture: 'DSEP/jobSearchResponse/jobSearchResponse.json' + }).as('jobSearchResponse') + cy.url().should('include', '/jobSearch') + cy.getByData('job-detail-link').eq(1).click() + cy.url().should('include', '/jobDetails?jobDetails') + cy.getByData(testIds.job_details_apply).click() + cy.intercept('GET', '**/api/profiles?populate[0]=documents.attachment', { + fixture: 'DSEP/jobApply/profilePopulate.json' + }).as('profilePopulate') + cy.intercept('POST', '**/select', { + fixture: 'DSEP/jobApply/selectResponse.json' + }).as('selectResponse') + cy.intercept('POST', '**/init', { + fixture: 'DSEP/jobApply/initResponse.json' + }).as('initResponse') + cy.url().should('include', '/jobApply?jobDetails') + cy.getByData(testIds.loadingIndicator).should('be.visible') + cy.fillDSEPJobApply() + cy.url().should('include', '/applicationSent') + }) + + it('should have a button to go back home and navigate to home page when clicked', () => { + cy.getByData(testIds.jobSubmitted_viewToHomePage).click() + cy.url().should('include', '/') + }) + }) +}) diff --git a/cypress/fixtures/DSEP/jobApply/initResponse.json b/cypress/fixtures/DSEP/jobApply/initResponse.json new file mode 100644 index 000000000..99e2181dc --- /dev/null +++ b/cypress/fixtures/DSEP/jobApply/initResponse.json @@ -0,0 +1,174 @@ +{ + "data": [ + { + "context": { + "domain": "dsep:jobs", + "action": "on_init", + "version": "1.1.0", + "bpp_id": "bpp-ps-network-strapi1-prod.becknprotocol.io", + "bpp_uri": "https://bpp-ps-network-strapi1-prod.becknprotocol.io", + "country": "IND", + "city": "std:080", + "location": { + "country": { + "name": "India", + "code": "IND" + }, + "city": { + "name": "Bangalore", + "code": "std:080" + } + }, + "bap_id": "bap-ps-network-prod.becknprotocol.io", + "bap_uri": "https://bap-ps-network-prod.becknprotocol.io", + "transaction_id": "86420742-920a-4ee3-ae17-1618b4eab59c", + "message_id": "d214edaf-cf1a-4590-979b-0ddbe81dbf9c", + "ttl": "PT10M", + "timestamp": "2024-10-09T07:05:25.556Z" + }, + "message": { + "order": { + "type": "DEFAULT", + "provider": { + "id": "12", + "name": "PWC", + "short_desc": "PriceWaterCoopers", + "fulfillments": [ + { + "id": "10", + "tracking": false + }, + { + "id": "10", + "type": "job-type", + "rating": "4", + "rateable": true, + "tracking": false + }, + { + "id": "10", + "type": "job-type", + "rating": "4", + "rateable": true, + "tracking": false + } + ] + }, + "items": [ + { + "id": "16", + "name": "Data Analyst", + "short_desc": "We are looking for candidates at analyst, associate consultant and consultant roles. Btech/BCA, holding 0-1 years of Post Qualification experience.", + "long_desc": "Job Description:\n\nStrong knowledge of .NET web framework and Front-end frameworks like Angular or react.\nProficient in ASP.NET MVC, .NET CORE , with a good knowledge of their ecosystems\nFamiliarity with the Mono framework\nStrong understanding of object-oriented programming\nSkill for writing reusable libraries\nFamiliar with various design and architectural patterns\nKnowledge of concurrency patterns\nFamiliarity with Microsoft SQL Server and popular web application frameworks\nKnack for writing clean, readable, and easily maintainable code\nUnderstanding of fundamental design principles for building a scalable application\nExperience creating database schemas that represent and support business processes\nExperience implementing automated testing platforms and unit tests\nProficient understanding of code versioning tools\nKnowledge on Azure DevOps is plus.\n\nRole: Risk Advisory Data Analyst\nIndustry Type: Accounting / Auditing\nDepartment: Finance\nEmployment Type: Full Time, Permanent\nEducation: B.Tech/B.E. in Production/Industrial, BCA in Computers, Any Postgraduate\nExperience Required: 0-1 years\nLocation: Bangalore", + "price": { + "value": "1000", + "currency": "INR" + }, + "rating": "null", + "rateable": true, + "quantity": { + "available": { + "measure": { + "value": "0", + "unit": "kWh" + } + } + }, + "categories": [ + { + "id": "13", + "name": "Data Analytics Jobs" + } + ], + "locations": [ + { + "id": "10", + "city": "Bengaluru. ", + "state": "Karnataka", + "country": "India" + } + ], + "tags": [ + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + } + ], + "xinput": { + "url": "https://bpp-unified-strapi1-prod.becknprotocol.io/beckn-bpp-adapter/x-input/form?form_id=dsepJobsApplyForm", + "mime_type": "text/html", + "html": "\n Apply Job Prefilled\n \n \n\n\n\n
\n
\n \n \n
\n \n \n \n
\n \n \n \n
\n \n
\n
\n \n
\n \n \n
\n
\n \n
\n\n" + }, + "fulfillments": [ + { + "id": "10" + }, + { + "id": "10", + "type": "job-type", + "rating": "4" + }, + { + "id": "10", + "type": "job-type", + "rating": "4" + } + ] + } + ], + "fulfillments": [ + { + "id": "10", + "tracking": false + }, + { + "id": "10", + "type": "job-type", + "rating": "4", + "rateable": true, + "tracking": false + } + ], + "quote": { + "price": { + "value": "1000", + "currency": "INR" + } + } + } + } + } + ] +} diff --git a/cypress/fixtures/DSEP/jobApply/jobApply.pdf b/cypress/fixtures/DSEP/jobApply/jobApply.pdf new file mode 100644 index 000000000..e4e9bfbf0 Binary files /dev/null and b/cypress/fixtures/DSEP/jobApply/jobApply.pdf differ diff --git a/cypress/fixtures/DSEP/jobApply/profilePopulate.json b/cypress/fixtures/DSEP/jobApply/profilePopulate.json new file mode 100644 index 000000000..03dca5eca --- /dev/null +++ b/cypress/fixtures/DSEP/jobApply/profilePopulate.json @@ -0,0 +1,15 @@ +{ + "data": { + "id": 65, + "attributes": { + "name": "Antoine Dubois", + "address": ", dd, delhi, delhi, India", + "createdAt": "2024-06-10T10:00:36.000Z", + "updatedAt": "2024-06-26T13:05:43.483Z", + "publishedAt": "2024-06-10T10:00:35.994Z", + "phone": "7991139788", + "zip_code": "201009" + } + }, + "meta": {} +} diff --git a/cypress/fixtures/DSEP/jobApply/selectResponse.json b/cypress/fixtures/DSEP/jobApply/selectResponse.json new file mode 100644 index 000000000..2fb463d6e --- /dev/null +++ b/cypress/fixtures/DSEP/jobApply/selectResponse.json @@ -0,0 +1,174 @@ +{ + "data": [ + { + "context": { + "domain": "dsep:jobs", + "action": "on_select", + "version": "1.1.0", + "bpp_id": "bpp-ps-network-strapi1-prod.becknprotocol.io", + "bpp_uri": "https://bpp-ps-network-strapi1-prod.becknprotocol.io", + "country": "IND", + "city": "std:080", + "location": { + "country": { + "name": "India", + "code": "IND" + }, + "city": { + "name": "Bangalore", + "code": "std:080" + } + }, + "bap_id": "bap-ps-network-prod.becknprotocol.io", + "bap_uri": "https://bap-ps-network-prod.becknprotocol.io", + "transaction_id": "c7045805-17d9-4cf2-b622-f2df49240d18", + "message_id": "c15953a0-0ab5-4c87-9def-0b0766099b3b", + "ttl": "PT10M", + "timestamp": "2024-10-09T06:38:47.490Z" + }, + "message": { + "order": { + "type": "DEFAULT", + "quote": { + "price": { + "value": "1000", + "currency": "INR" + } + }, + "provider": { + "id": "12", + "name": "PWC", + "short_desc": "PriceWaterCoopers", + "fulfillments": [ + { + "id": "6", + "type": "REMOTE JOB", + "rating": "4.5", + "tags": [ + { + "display": true, + "descriptor": { + "description": "DSEP" + }, + "list": [ + { + "descriptor": { + "description": "AWS" + }, + "value": "course-name", + "display": true + } + ] + }, + { + "display": true, + "descriptor": { + "description": "DSEP" + }, + "list": [ + { + "descriptor": { + "description": "Agile" + }, + "display": true + } + ] + } + ], + "tracking": false + }, + { + "id": "10", + "type": "job-type", + "rating": "4", + "rateable": true, + "tracking": false + } + ] + }, + "items": [ + { + "id": "16", + "name": "Data Analyst", + "short_desc": "We are looking for candidates at analyst, associate consultant and consultant roles. Btech/BCA, holding 0-1 years of Post Qualification experience.", + "long_desc": "Job Description:\n\nStrong knowledge of .NET web framework and Front-end frameworks like Angular or react.\nProficient in ASP.NET MVC, .NET CORE , with a good knowledge of their ecosystems\nFamiliarity with the Mono framework\nStrong understanding of object-oriented programming\nSkill for writing reusable libraries\nFamiliar with various design and architectural patterns\nKnowledge of concurrency patterns\nFamiliarity with Microsoft SQL Server and popular web application frameworks\nKnack for writing clean, readable, and easily maintainable code\nUnderstanding of fundamental design principles for building a scalable application\nExperience creating database schemas that represent and support business processes\nExperience implementing automated testing platforms and unit tests\nProficient understanding of code versioning tools\nKnowledge on Azure DevOps is plus.\n\nRole: Risk Advisory Data Analyst\nIndustry Type: Accounting / Auditing\nDepartment: Finance\nEmployment Type: Full Time, Permanent\nEducation: B.Tech/B.E. in Production/Industrial, BCA in Computers, Any Postgraduate\nExperience Required: 0-1 years\nLocation: Bangalore", + "price": { + "value": "1000", + "currency": "INR" + }, + "rating": "null", + "rateable": true, + "quantity": { + "available": { + "measure": { + "value": "0", + "unit": "kWh" + } + } + }, + "categories": [ + { + "id": "13", + "name": "Data Analytics Jobs" + } + ], + "locations": [ + { + "id": "10", + "city": "Bengaluru. ", + "state": "Karnataka", + "country": "India" + } + ], + "tags": [ + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + }, + { + "display": true, + "list": [null] + } + ], + "fulfillments": [ + { + "id": "10", + "type": "job-type", + "rating": "4" + } + ] + } + ] + } + } + } + ] +} diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index e6ab977a1..6d66264e1 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -77,6 +77,7 @@ declare global { fillDisputeDetails(): Chainable fillConsentDetails(): Chainable fillAssemblyDetails(): Chainable + fillDSEPJobApply(): Chainable performXinput_Submit(response: RouteHandler, aliasName: string): Chainable performCheckViolation(response: RouteHandler, aliasName: string): Chainable //Created by omkar @@ -317,3 +318,12 @@ Cypress.Commands.add('fillAssemblyDetails', () => { cy.get(testIds.quantity).should('have.value', '2') cy.get('button[type="submit"]').click() }) +Cypress.Commands.add('fillDSEPJobApply', () => { + cy.get('#name').clear().type('santosh kumar') + cy.get('#mobile').clear().type('6251423251') + cy.get('#email').clear().type('santosh.k@gmail.com') + const fileName = '/DSEP/jobApply/jobApply.pdf' + cy.get('.upload-button').attachFile(fileName) + cy.get('#declaration').check().should('be.checked') + cy.get('#submitButton').click() +}) diff --git a/package.json b/package.json index 6fb0fe7a4..5b4190c15 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "@typescript-eslint/eslint-plugin": "^6.6.0", "@typescript-eslint/parser": "^6.6.0", "cypress": "^13.12.0", + "cypress-file-upload": "^5.0.8", "eslint": "^8.49.0", "eslint-plugin-react": "^7.33.2", "husky": "^8.0.3", diff --git a/shared/dataTestIds.ts b/shared/dataTestIds.ts index 11f257cba..e2d2c8777 100644 --- a/shared/dataTestIds.ts +++ b/shared/dataTestIds.ts @@ -341,6 +341,8 @@ const testIds = { scholarship_details_provider_name: 'scholarship-details-provider-name', scholarship_details_long_desc: 'scholarship-details-long-desc', scholarship_details_Button: 'scholarship-details-Button', + jobSubmitted_viewNewJob: 'job-submitted-view-new-job', + jobSubmitted_viewToHomePage: 'job-submitted-view-to-home-page', // mobility-bap mobility_map_container: 'map-container', diff --git a/yarn.lock b/yarn.lock index 65e73f552..88c85a48a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6556,6 +6556,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^6.6.0 "@typescript-eslint/parser": ^6.6.0 cypress: ^13.12.0 + cypress-file-upload: ^5.0.8 eslint: ^8.49.0 eslint-config-next: latest eslint-plugin-react: ^7.33.2 @@ -7677,6 +7678,15 @@ __metadata: languageName: node linkType: hard +"cypress-file-upload@npm:^5.0.8": + version: 5.0.8 + resolution: "cypress-file-upload@npm:5.0.8" + peerDependencies: + cypress: ">3.0.0" + checksum: 9c70ca7e0bb137d0ec0b8d38987219ce15b26ac3a40e3ed4e78e6ad4690392eab905586848eec6ad8edd42ee480e68ccc63007b2ebd0a02f4b3eca116ff017e3 + languageName: node + linkType: hard + "cypress@npm:^13.12.0": version: 13.12.0 resolution: "cypress@npm:13.12.0"