Skip to content

Commit

Permalink
Merge pull request #3075 from beckn/feat/cypress-adminProfile-openSpark
Browse files Browse the repository at this point in the history
feat(open-spark): added admin profile test cases
  • Loading branch information
aniketceminds authored Jan 27, 2025
2 parents f7c9a33 + 350035d commit 4b3f1aa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
35 changes: 35 additions & 0 deletions cypress/e2e/open-spak/adminProfile.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { testIds } from '../../../shared/dataTestIds'

describe('Admin Profile Page ', () => {
context('Admin Profile Page Flow', () => {
before(() => {
cy.clearAllLocalStorage()
cy.clearAllCookies()
cy.visit(testIds.url_base)
cy.getByData('consumer_button').click()
cy.getByData(testIds.auth_inputEmail).type(testIds.user_validEmail_admin_flow)
cy.getByData(testIds.auth_inputPassword).type(testIds.user_validPassword_admin_flow)
cy.getByData(testIds.auth_loginButton).click()
cy.url().should('include', testIds.url_home)
cy.getByData(testIds.topSheet_profile_icon).click()
cy.visit(`${testIds.url_base}${testIds.url_profile}`)
})
it('should display Consumer profile page', () => {
cy.intercept('GET', '/user-profile', {
fixture: 'OpenSpark/profile/adminProfile.json'
}).as('adminProfile')
cy.getByData(testIds.profile_inputName).should('be.disabled')
cy.getByData(testIds.profile_address).should('be.disabled')
})
it('should visible profile page input after click on edit button', () => {
cy.getByData(testIds.edit_icon).click()
cy.getByData(testIds.profile_inputName).should('be.visible')
cy.getByData(testIds.profile_address).should('be.visible')
})
it('should edit Profile page data click on edit button', () => {
cy.getByData(testIds.edit_icon).click()
cy.getByData(testIds.profile_inputName).clear().type('leeza Saheb')
cy.getByData(testIds.profile_address).clear().type('pune pirangut')
})
})
})
8 changes: 8 additions & 0 deletions cypress/fixtures/OpenSpark/profile/adminProfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"fullname": "Consumer Admin",
"address": "Consumer Admin Address",
"customer_id": null,
"phone_number": null,
"email": "[email protected]",
"utility_name": null
}

0 comments on commit 4b3f1aa

Please sign in to comment.