-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new test to check help card in dashboard page
- Loading branch information
1 parent
2eaba2c
commit e6e846b
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
tests/UI/campaigns/functional/BO/01_dashboard/04_helpCard.ts
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 utils | ||
import helper from '@utils/helpers'; | ||
import testContext from '@utils/testContext'; | ||
|
||
// Import commonTests | ||
import loginCommon from '@commonTests/BO/loginBO'; | ||
|
||
// Import pages | ||
import dashboardPage from '@pages/BO/dashboard'; | ||
|
||
import {expect} from 'chai'; | ||
import type {BrowserContext, Page} from 'playwright'; | ||
|
||
const baseContext: string = 'functional_BO_dashboard_helpCard'; | ||
|
||
// Check help card language in dashboard page | ||
describe('BO - dashboard : Help card in order page', async () => { | ||
let browserContext: BrowserContext; | ||
let page: Page; | ||
|
||
// before and after functions | ||
before(async function () { | ||
browserContext = await helper.createBrowserContext(this.browser); | ||
page = await helper.newTab(browserContext); | ||
}); | ||
|
||
after(async () => { | ||
await helper.closeBrowserContext(browserContext); | ||
}); | ||
|
||
it('should login in BO', async function () { | ||
await loginCommon.loginBO(this, page); | ||
}); | ||
|
||
it('should open the help side bar and check the document title', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'openHelpSidebar', baseContext); | ||
|
||
const isHelpSidebarVisible = await dashboardPage.openHelpCard(page); | ||
expect(isHelpSidebarVisible).to.eq(true); | ||
|
||
const documentURL = await dashboardPage.getHelpDocumentTitle(page); | ||
expect(documentURL).to.contains('Discovering the Administration Area'); | ||
}); | ||
|
||
it('should close the help side bar', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'closeHelpSidebar', baseContext); | ||
|
||
const isHelpSidebarClosed = await dashboardPage.closeHelpCard(page); | ||
expect(isHelpSidebarClosed).to.eq(true); | ||
}); | ||
}); |
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