-
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.
Merge pull request #3075 from beckn/feat/cypress-adminProfile-openSpark
feat(open-spark): added admin profile test cases
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 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
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') | ||
}) | ||
}) | ||
}) |
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,8 @@ | ||
{ | ||
"fullname": "Consumer Admin", | ||
"address": "Consumer Admin Address", | ||
"customer_id": null, | ||
"phone_number": null, | ||
"email": "[email protected]", | ||
"utility_name": null | ||
} |