How to use the wix-ui-test-utils/unidriver.StylableUnidriverUtil function in wix-ui-test-utils

To help you get started, we’ve selected a few wix-ui-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / wix-ui-tpa / src / components / StatesButton / StatesButton.driver.ts View on Github external
export const statesButtonDriverFactory = (
  base: UniDriver,
): StatesButtonDriver => {
  const stylableUtil = new StylableUnidriverUtil(style);

  return {
    ...buttonNextDriverFactory(base),
    checkIconExists: () => base.$('[data-hook="checkIcon"]').exists(),
  };
};
github wix / wix-ui-backoffice / src / components / Label / Label.uni.driver.ts View on Github external
export const labelUniDriverFactory = (base: UniDriver): LabelDriver => {
  const stylableUnidriverUtil = new StylableUnidriverUtil(styles);

  return {
    ...coreLabelUniDriverFactory(base),
    getSize: () => stylableUnidriverUtil.getStyleState(base, 'size') as Promise
  }
};
github wix / wix-ui-tpa / src / components / OverlappingCard / OverlappingCard.driver.ts View on Github external
export const overlappingCardDriverFactory = (
  base: UniDriver,
): OverlappingCardDriver => {
  const stylableUtil = new StylableUnidriverUtil(style);

  const getMediaContainerElement = () => base.$(`.${style.mediaContainer} > *`);
  const getInfoContainerElement = () => base.$(`.${style.infoContainer} > *`);

  return {
    ...baseUniDriverFactory(base),
    getMediaContent: async () => getMediaContainerElement().getNative(),
    isMediaContentExist: async () => getMediaContainerElement().exists(),
    getInfoContent: async () => getInfoContainerElement().getNative(),
    isInfoContentExist: async () => getInfoContainerElement().exists(),
    getRatio: async () => stylableUtil.getStyleState(base, 'ratio'),
    isFlippedRatio: async () =>
      stylableUtil.hasStyleState(base, 'flippedRatio'),
    isImagePositionInverted: async () =>
      stylableUtil.hasStyleState(base, 'invertInfoPosition'),
  };
github wix / wix-ui-tpa / src / components / TextButton / TextButton.driver.ts View on Github external
export const textButtonDriverFactory = (base: UniDriver): TextButtonDriver => {
  const stylableUtil = new StylableUnidriverUtil(style);

  return {
    ...buttonNextDriverFactory(base),
    isMobile: async () => stylableUtil.hasStyleState(base, 'mobile'),
    hasPriority: async (priority: TEXT_BUTTON_PRIORITY) =>
      (await stylableUtil.getStyleState(base, 'priority')) === priority,
  };
};