@wix/design-system
Version:
@wix/design-system
30 lines • 1.91 kB
JavaScript
import { baseUniDriverFactory, findByHook, } from '../utils/test-utils/unidriver';
import { dataHooks } from './constants';
import { textUniDriverFactory } from '../Text/Text.uni.driver';
import { headingUniDriverFactory } from '../Heading/Heading.uni.driver';
export const marketingPageLayoutContentDriverFactory = (base) => {
return {
...baseUniDriverFactory(base),
/** Checks whether overline exists */
hasOverline: async () => await findByHook(base, dataHooks.overlineContainer).exists(),
/** Gets the overline text */
getOverlineText: async () => (await textUniDriverFactory(await findByHook(base, dataHooks.overline))).getText(),
/** Checks whether title exists */
hasTitle: async () => await findByHook(base, dataHooks.titleContainer).exists(),
/** Gets the title text */
getTitleText: async () => (await headingUniDriverFactory(await findByHook(base, dataHooks.title))).getText(),
/** Checks whether subtitle exists */
hasSubtitle: async () => await findByHook(base, dataHooks.subtitleContainer).exists(),
/** Gets the subtitle text */
getSubtitleText: async () => (await headingUniDriverFactory(await findByHook(base, dataHooks.subtitle))).getText(),
/** Checks whether content exists */
hasContent: async () => await findByHook(base, dataHooks.contentContainer).exists(),
/** Gets the content text */
getContentText: async () => (await textUniDriverFactory(await findByHook(base, dataHooks.content))).getText(),
/** Checks whether actions exist */
hasActions: async () => await findByHook(base, dataHooks.actions).exists(),
/** Checks whether a node with the provided predicate exists */
childExists: async (predicate) => base.$(predicate).exists(),
};
};
//# sourceMappingURL=MarketingPageLayoutContent.uni.driver.js.map