-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dsep): added test cases for dsep
1. added tewst cases for scholarship apply page 2. added test cases for scholarship confirmation page 3. added test cases for scholarship order page
- Loading branch information
1 parent
34b81a8
commit dbc8de6
Showing
13 changed files
with
490 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,59 @@ | ||
import { testIds } from '../../../shared/dataTestIds' | ||
describe('My Scholarship Page', () => { | ||
before(() => { | ||
cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) | ||
cy.visit(`${testIds.url_base}${testIds.url_home}`) | ||
cy.getByData(testIds.threeDots).click() | ||
cy.getByData(testIds.myScholarship_text).click() | ||
cy.intercept('GET', '**/orders?filters[category]=2', { | ||
fixture: 'DSEP/myScholarshipOrder/myScholarshipOrderResponse.json' | ||
}).as('myScholarshipOrderResponse') | ||
context('Show empty page when there is no order response for scholarship page', () => { | ||
before(() => { | ||
cy.login(testIds.url_base, testIds.user_firstTimeLoginvalidEmail, testIds.user_firstTimeLoginvalidPassword) | ||
cy.visit(`${testIds.url_base}${testIds.url_home}`) | ||
cy.getByData(testIds.threeDots).click() | ||
cy.getByData(testIds.myScholarship_text).click() | ||
cy.intercept('GET', '**/orders?filters[category]=2', { | ||
fixture: 'DSEP/myScholarshipOrder/emptyScholarshipOrderResponse.json' | ||
}).as('emptyScholarshipOrderResponse') | ||
}) | ||
it('Should render Empty Scholarship Search Page ', () => { | ||
cy.getByData(testIds.cartpage_emptyImage).should('be.visible') | ||
cy.getByData(testIds.noScholarship).should('be.visible') | ||
cy.getByData(testIds.noScholarshipText1).should('be.visible') | ||
cy.getByData(testIds.noScholarshipText2).should('be.visible') | ||
cy.getByData(testIds.emptyScholarshipButton).should('be.visible') | ||
}) | ||
it('Should Navigate to My Scholarship Page when Click on Button', () => { | ||
cy.getByData(testIds.noScholarship).should('contain.text', 'No Scholarship!') | ||
cy.getByData(testIds.noScholarshipText1).should('contain.text', 'Look like you haven’t applied for any') | ||
cy.getByData(testIds.noScholarshipText2).should('contain.text', 'Scholarship!') | ||
cy.getByData(testIds.emptyScholarshipButton).click() | ||
cy.url().should('include', '/scholarshipSearchPage') | ||
}) | ||
}) | ||
context('Show Search Page when there is order response for scholarship page', () => { | ||
before(() => { | ||
cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) | ||
cy.visit(`${testIds.url_base}${testIds.url_home}`) | ||
cy.getByData(testIds.threeDots).click() | ||
cy.getByData(testIds.myScholarship_text).click() | ||
cy.intercept('GET', '**/orders?filters[category]=2', { | ||
fixture: 'DSEP/myScholarshipOrder/myScholarshipOrderResponse.json' | ||
}).as('myScholarshipOrderResponse') | ||
}) | ||
|
||
it('Should render My Scholarship Page All Elements', () => { | ||
cy.getByData(testIds.scholarshipCardHeading).eq(1).should('be.visible') | ||
cy.getByData(testIds.scholarshipCardTime).eq(1).should('be.visible') | ||
cy.getByData(testIds.scholarshipCardID).eq(1).should('be.visible') | ||
cy.getByData(testIds.scholarshipCardButton).should('be.visible') | ||
}) | ||
it('Should render My Scholarship Page', () => { | ||
cy.getByData(testIds.scholarshipCardHeading).eq(1).should('contain.text', 'MS Ramaiah Memorial Scholarship') | ||
cy.getByData(testIds.scholarshipCardTime).eq(1).should('contain.text', '27th May 2024, 10:36pm') | ||
cy.getByData(testIds.scholarshipCardID).eq(1).should('contain.text', 'ID: 1338') | ||
}) | ||
it('Should Navigate to scholarship Search page', () => { | ||
cy.getByData(testIds.scholarshipCardButton).click() | ||
cy.intercept('POST', '**/search', { | ||
fixture: 'DSEP/myScholarshipOrder/scholarshipSearchResult.json' | ||
}).as('scholarshipSearchResult') | ||
cy.getByData(testIds.loadingIndicator).should('be.visible') | ||
cy.url().should('include', '/scholarshipSearchPage') | ||
it('Should render My Scholarship Page All Elements', () => { | ||
cy.getByData(testIds.scholarshipCardHeading).eq(1).should('be.visible') | ||
cy.getByData(testIds.scholarshipCardTime).eq(1).should('be.visible') | ||
cy.getByData(testIds.scholarshipCardID).eq(1).should('be.visible') | ||
cy.getByData(testIds.scholarshipCardButton).should('be.visible') | ||
}) | ||
it('Should render My Scholarship Page', () => { | ||
cy.getByData(testIds.scholarshipCardHeading).eq(1).should('contain.text', 'MS Ramaiah Memorial Scholarship') | ||
cy.getByData(testIds.scholarshipCardTime).eq(1).should('contain.text', '27th May 2024, 10:36pm') | ||
cy.getByData(testIds.scholarshipCardID).eq(1).should('contain.text', 'ID: 1338') | ||
}) | ||
it('Should Navigate to scholarship Search page', () => { | ||
cy.getByData(testIds.scholarshipCardButton).click() | ||
cy.intercept('POST', '**/search', { | ||
fixture: 'DSEP/myScholarshipOrder/scholarshipSearchResult.json' | ||
}).as('scholarshipSearchResult') | ||
cy.getByData(testIds.loadingIndicator).should('be.visible') | ||
cy.url().should('include', '/scholarshipSearchPage') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { testIds } from '../../../shared/dataTestIds' | ||
import 'cypress-file-upload' | ||
describe('Scholarship search page', () => { | ||
before(() => { | ||
cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) | ||
cy.visit(`${testIds.url_base}${testIds.url_home}`) | ||
cy.getByData(testIds.threeDots).click() | ||
cy.getByData(testIds.myScholarship_text).click() | ||
cy.intercept('GET', '**/orders?filters[category]=2', { | ||
fixture: 'DSEP/myScholarshipOrder/myScholarshipOrderResponse.json' | ||
}).as('myScholarshipOrderResponse') | ||
cy.wait(1000) | ||
cy.getByData(testIds.scholarshipCardButton).click() | ||
cy.intercept('POST', '**/search', { | ||
fixture: 'DSEP/myScholarshipOrder/scholarshipSearchResult.json' | ||
}).as('scholarshipSearchResult') | ||
cy.getByData(testIds.loadingIndicator).should('be.visible') | ||
cy.url().should('include', '/scholarshipSearchPage') | ||
cy.getByData(testIds.search_card_link).eq(0).click() | ||
cy.url().should('include', '/scholarshipDetailsPage') | ||
cy.getByData(testIds.scholarship_details_Button).click() | ||
cy.intercept('POST', '**/api/profiles?populate[0]=documents.attachment', { | ||
fixture: 'DSEP/scholarshipApply/profilePopulate.json' | ||
}).as('profilePopulate') | ||
cy.intercept('POST', '**/select', { | ||
fixture: 'DSEP/scholarshipApply/selectResponse.json' | ||
}).as('selectResponse') | ||
cy.intercept('POST', '**/init', { | ||
fixture: 'DSEP/scholarshipApply/initResponse.json' | ||
}).as('initResponse') | ||
cy.getByData(testIds.loadingIndicator).should('be.visible') | ||
cy.url().should('include', '/applyScholarship') | ||
}) | ||
it('Should Render Scholarship 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') | ||
cy.get('#reasonLabel').should('be.visible') | ||
cy.get('#reasonLabel').should('be.visible') | ||
cy.get('#zipcodeLabel').should('be.visible') | ||
cy.get('#submitButton').should('be.visible') | ||
}) | ||
|
||
it('Should Validate Apply Scholarship page With non Valid data', () => { | ||
cy.get('#name').type('1') | ||
cy.get('#nameError').should('contain.text', 'Please enter a valid name.') | ||
cy.get('#mobile').type('609') | ||
cy.get('#mobileError').should('contain.text', 'Please enter a valid 10-digit mobile number.') | ||
cy.get('#email').type('santosh.k@gmail') | ||
cy.get('#emailError').should('contain.text', 'Please enter a valid email address.') | ||
cy.get('#zipcode').type('123') | ||
cy.get('#zipcodeError').should('contain.text', 'Please enter a valid zip code.') | ||
cy.get('#submitButton').should('be.disabled') | ||
}) | ||
it('Should Render Scholarship Apply page With Valid data and navigate to Scholarship Confirmation page ', () => { | ||
cy.fillDSEP_x_inputScholarshipApplyForm() | ||
cy.intercept('POST', '**/x-input/submit', { | ||
fixture: 'DSEP/scholarshipApply/x-inputSubmitResponse.json' | ||
}).as('x-inputSubmitResponse') | ||
cy.wait(1000) | ||
cy.url().should('include', '/scholarshipConfirmationPage') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { testIds } from '../../../shared/dataTestIds' | ||
import 'cypress-file-upload' | ||
describe('Scholarship search page', () => { | ||
before(() => { | ||
cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) | ||
cy.visit(`${testIds.url_base}${testIds.url_home}`) | ||
cy.getByData(testIds.threeDots).click() | ||
cy.getByData(testIds.myScholarship_text).click() | ||
cy.intercept('GET', '**/orders?filters[category]=2', { | ||
fixture: 'DSEP/myScholarshipOrder/myScholarshipOrderResponse.json' | ||
}).as('myScholarshipOrderResponse') | ||
cy.wait(1000) | ||
cy.getByData(testIds.scholarshipCardButton).click() | ||
cy.intercept('POST', '**/search', { | ||
fixture: 'DSEP/myScholarshipOrder/scholarshipSearchResult.json' | ||
}).as('scholarshipSearchResult') | ||
cy.getByData(testIds.loadingIndicator).should('be.visible') | ||
cy.url().should('include', '/scholarshipSearchPage') | ||
cy.getByData(testIds.search_card_link).eq(0).click() | ||
cy.url().should('include', '/scholarshipDetailsPage') | ||
cy.getByData(testIds.scholarship_details_Button).click() | ||
cy.intercept('POST', '**/api/profiles?populate[0]=documents.attachment', { | ||
fixture: 'DSEP/scholarshipApply/profilePopulate.json' | ||
}).as('profilePopulate') | ||
cy.intercept('POST', '**/select', { | ||
fixture: 'DSEP/scholarshipApply/selectResponse.json' | ||
}).as('selectResponse') | ||
cy.intercept('POST', '**/init', { | ||
fixture: 'DSEP/scholarshipApply/initResponse.json' | ||
}).as('initResponse') | ||
cy.getByData(testIds.loadingIndicator).should('be.visible') | ||
cy.url().should('include', '/applyScholarship') | ||
cy.fillDSEP_x_inputScholarshipApplyForm() | ||
cy.intercept('POST', '**/x-input/submit', { | ||
fixture: 'DSEP/scholarshipApply/x-inputSubmitResponse.json' | ||
}).as('x-inputSubmitResponse') | ||
cy.url().should('include', '/scholarshipConfirmationPage') | ||
}) | ||
it('should display Scholarship Confirmation Page', () => { | ||
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', | ||
'We will evaluate your application ID' | ||
) | ||
}) | ||
it('should navigate to Cart page when clicked On go to cart button', () => { | ||
cy.getByData(testIds.scholarshipConfirmation_cart).click() | ||
cy.url().should('include', '/cart') | ||
}) | ||
}) |
10 changes: 10 additions & 0 deletions
10
cypress/fixtures/DSEP/MyScholarshipOrder/emptyScholarshipOrderResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"meta": { | ||
"pagination": { | ||
"page": 1, | ||
"pageSize": 25, | ||
"pageCount": 1, | ||
"total": 22 | ||
} | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.