@wix/design-system
Version:
@wix/design-system
36 lines • 1.38 kB
JavaScript
import { baseUniDriverFactory, findByHook, } from '../../../utils/test-utils/unidriver';
import { dataHooks } from './constants';
export const sectionDriverFactory = (base) => {
const titleElement = () => findByHook(base, dataHooks.pageSectionTitle);
const subtitleElement = () => findByHook(base, dataHooks.pageSectionSubtitle);
const actionsBarElement = () => findByHook(base, dataHooks.pageSectionActionsBar);
return {
...baseUniDriverFactory(base),
/**
* Gets PageSection title text
* @return {Promise<string>}
*/
getTitleText: () => titleElement().text(),
/**
* Checks whether the PageSection title exists
* @returns {Promise<boolean>}
*/
isTitleExists: () => titleElement().exists(),
/**
* Gets PageSection subtitle text
* @return {Promise<string>}
*/
getSubtitleText: () => subtitleElement().text(),
/**
* Checks whether the PageSection subtitle exists
* @returns {Promise<boolean>}
*/
isSubtitleExists: () => subtitleElement().exists(),
/**
* Checks whether the PageHeader action bar exists
* @returns {Promise<boolean>}
*/
isActionsBarExists: () => actionsBarElement().exists(),
};
};
//# sourceMappingURL=Section.uni.driver.js.map