Skip to content

Commit

Permalink
Merge pull request #66 from DTS-STN/80959_E2E_TCs
Browse files Browse the repository at this point in the history
80959_TestCases
  • Loading branch information
manishasharma5757 authored Oct 17, 2022
2 parents 104b4be + 703a787 commit cad5cea
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cypress/e2e/PageObjects/dashboardPO.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ function MostRequestedSectionLinks() {

}

function Menu() {

return cy.get("#dropdownNavbarLink")

}

function SecuritySettingsMenu() {

return cy.get("#dropdownNavbar > li:nth-child(2) > a")

}


module.exports = {dashboardHeader,
FrenchButton,
Expand All @@ -66,7 +78,10 @@ module.exports = {dashboardHeader,
Cards,
MostRequestedSection,
MostRequestedSectionLinks,
MostRequestedSectionHeading
MostRequestedSectionHeading,
Menu,
SecuritySettingsMenu



}
30 changes: 30 additions & 0 deletions cypress/e2e/PageObjects/securitySettingsPO.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/// <reference types="cypress" />


function securitySettingsHeader(){

return cy.get('#my-dashboard-heading')
}

function breadcrumbs() {

return cy.get("[class='ds-container'] >nav>ul")
}

function breadcrumbsLink1() {

return cy.get("[class='ds-container'] >nav>ul>li:nth-child(1)>a")
}

function breadcrumbsLink2() {

return cy.get("[class='ds-container'] >nav>ul>li:nth-child(2)>a")
}

module.exports = {securitySettingsHeader,
breadcrumbs,
breadcrumbsLink1,
breadcrumbsLink2


}
64 changes: 64 additions & 0 deletions cypress/e2e/SecuritySettings.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/// <reference types="cypress" />
const dashboardPo = require("../e2e/PageObjects/dashboardPO.cy")
const securityPo = require("../e2e/PageObjects/securitySettingsPO.cy")


beforeEach(() => {
cy.visit('/security') })

describe('Validate Security Settings page',() =>{


it('Validate Security Settings Page header in English', () =>{

securityPo.securitySettingsHeader().should('be.visible')
.and('have.text','Security Settings');

})

it('Validate French button click goes to fr/Security page', () =>{

dashboardPo.FrenchButton().click()
cy.url().should("contains", "/fr/security");

})

it('Validate Security Settings Page header in French', () =>{

dashboardPo.FrenchButton().click()
securityPo.securitySettingsHeader().should('be.visible')
.and('have.text','Paramètres de sécurité');

})

it('Validate that user can select "Security settings" from Menu dropdown options', () =>{
cy.visit('/home')
dashboardPo.Menu().click()
dashboardPo.SecuritySettingsMenu().click()
cy.url().should("contains", "/security");
securityPo.securitySettingsHeader().should('be.visible')
.and('have.text','Security Settings');

})

it('validate the breadcrumbs are present on Security settings page', () =>{

securityPo.breadcrumbs().should('be.visible')


})

it('validate that user is navigated to /fr/security page from /fr/dashboard', () =>{

cy.visit('/home')
dashboardPo.FrenchButton().click()
dashboardPo.Menu().click()
dashboardPo.SecuritySettingsMenu().click()
cy.url().should("contains", "/fr/security")
securityPo.securitySettingsHeader().should('be.visible')
.and('have.text','Paramètres de sécurité');


})

})

0 comments on commit cad5cea

Please sign in to comment.