Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional tests - Add test 'Help card' for Monitoring page #18268

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,66 @@
require('module-alias/register');
// Using chai
const {expect} = require('chai');
const helper = require('@utils/helpers');
const loginCommon = require('@commonTests/loginBO');
// Importing pages
const BOBasePage = require('@pages/BO/BObasePage');
const LoginPage = require('@pages/BO/login');
const DashboardPage = require('@pages/BO/dashboard');
const MonitoringPage = require('@pages/BO/catalog/monitoring');
// Test context imports
const testContext = require('@utils/testContext');

const baseContext = 'functional_BO_catalog_monitoring_helpCard';

let browser;
let page;

// Init objects needed
const init = async function () {
return {
boBasePage: new BOBasePage(page),
loginPage: new LoginPage(page),
dashboardPage: new DashboardPage(page),
monitoringPage: new MonitoringPage(page),
};
};
// Check help card language in monitoring page
describe('Help card in monitoring page', async () => {
// before and after functions
before(async function () {
browser = await helper.createBrowser();
page = await helper.newTab(browser);
this.pageObjects = await init();
});
after(async () => {
await helper.closeBrowser(browser);
});

// Login into BO and go to monitoring page
loginCommon.loginBO();

it('should go to \'Catalog > Monitoring\' page', async function () {
await this.pageObjects.boBasePage.goToSubMenu(
this.pageObjects.boBasePage.catalogParentLink,
this.pageObjects.boBasePage.monitoringLink,
);
await this.pageObjects.boBasePage.closeSfToolBar();
const pageTitle = await this.pageObjects.monitoringPage.getPageTitle();
await expect(pageTitle).to.contains(this.pageObjects.monitoringPage.pageTitle);
});

it('should open the help side bar and check the document language', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'openHelpSidebar', baseContext);
const isHelpSidebarVisible = await this.pageObjects.monitoringPage.openHelpSideBar();
await expect(isHelpSidebarVisible).to.be.true;
const documentURL = await this.pageObjects.monitoringPage.getHelpDocumentURL();
await expect(documentURL).to.contains('country=en');
});

it('should close the help side bar', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'closeHelpSidebar', baseContext);
const isHelpSidebarClosed = await this.pageObjects.monitoringPage.closeHelpSideBar();
await expect(isHelpSidebarClosed).to.be.true;
});
});