@ironsource/shared-ui-e2e 2.1.12-test.52 → 2.1.12-test.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/shared-e2e-commands.js +454 -309
- package/shared-e2e-commands.umd.cjs +1 -1
- package/tests/components/date-range/consts.d.ts +3 -0
- package/tests/components/date-range/date-range-component.d.ts +24 -0
- package/tests/components/date-range/date-range-page.d.ts +17 -0
- package/tests/components/date-range/types.d.ts +23 -0
- package/tests/components/dropdown/base-dropdown.d.ts +1 -1
- package/tests/components/dropdown/types.d.ts +1 -0
- package/tests/index.d.ts +1 -0
- package/tests/testids/index.d.ts +7 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(c=typeof globalThis<"u"?globalThis:c||self,p(c["shared-ui-e2e"]={}))})(this,function(c){"use strict";var yt=Object.defineProperty;var Ct=(c,p,s)=>p in c?yt(c,p,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[p]=s;var l=(c,p,s)=>(Ct(c,typeof p!="symbol"?p+"":p,s),s);var p=(a=>(a.TRIGGER="ie-trigger",a.CONTENT="ie-content",a.SEARCH="ie-search",a.LIST="ie-list",a.LIST_SELECTED="ie-list-selected",a.ACTION_CANCEL="ie-action-cancel",a.ACTION_APPLY="ie-action-apply",a.SELECT_ALL="ie-select-all",a.CLEAR_ALL="ie-clear-all",a))(p||{}),s=(a=>(a.TRIGGER="dd-trigger",a.WRAPPER="dd-wrapper",a.BUTTON="dd-button",a.BUTTON_WRAPPER="dd-button-wrapper",a.BUTTON_CONTENT="dd-button-content",a.BUTTON_CONTENT_SUFFIX="dd-button-content-suffix",a.BUTTON_CLEAR="dd-button-clear",a.LABEL="dd-label",a.LIST_CONTAINER="dd-list-container",a.SEARCH="dd-search",a.TITLE="dd-title",a.ACTION_CANCEL="dd-action-cancel",a.ACTION_APPLY="dd-action-apply",a.ACTION_CLEAR_ALL="dd-action-clear-all",a.HELPER_TEXT="dd-helper-text",a.HELPER_TEXT_ERROR="dd-helper-text-error",a.SELECT_ALL="dd-select-all",a.NO_RESULT="dd-no-result",a))(s||{}),b=(a=>(a.WRAPPER="banner-wrapper",a.CONTENT="banner-content",a))(b||{}),y=(a=>(a.WRAPPER="alert-wrapper",a.TITLE="alert-title",a.MESSAGE="alert-message",a.ACTION_BUTTON="alert-action-button",a.CLOSE_BUTTON="alert-close-button",a))(y||{}),d=(a=>(a.WRAPPER="dialog-wrapper",a.HEADER="dialog-header",a.ACTION_CLOSE="dialog-action-close",a.HEADER_SECONDARY="dialog-header-secondary",a.CONTENT="dialog-content",a.ACTION_BUTTONS_WRAPPER="dialog-action-buttons-wrapper",a.BACKDROP="dialog-backdrop",a.SAVE_BUTTON="dialog-save-button",a.CANCEL_BUTTON="dialog-cancel-button",a))(d||{}),r=(a=>(a.WRAPPER="input-wrapper",a.TOOLTIP="input-tooltip",a.TOOLTIP_WITHOUT_ICON="input-tooltip-without-icon",a.MANDATORY="input-mandatory",a.LABEL_CONTAINER="input-label-container",a.LABEL_TEXT="input-label-text",a.FIELD="input-field",a.EXTRA_TEXT="input-extra-text",a.TOGGLE_PASSWORD="input-toggle-password-icon",a))(r||{}),_=(a=>(a.WRAPPER="swicth-wrapper",a.BUTTON="swicth-button",a.TEXT="swicth-text",a))(_||{}),E=(a=>(a.WRAPPER="ta-wrapper",a.LABEL="ta-label",a.FIELD="ta-field",a.TEXT="ta-text",a))(E||{}),O=(a=>(a.CONTAINER="search-container",a.FIELD="search-field",a.CLOSE="search-close",a.CLEAR="search-clear",a))(O||{}),T=(a=>(a.CONTAINER="tbl-container",a.TABLE="tbl-table",a.HEADER="tbl-header",a.TITLE="tbl-title",a.HEADER_RIGHT="tbl-header-right",a.ACTIONS="tbl-actions",a.SECTIONS="tbl-sections",a.BODY_WRAPPER="tbl-body-wrapper",a.EMPTY_STATE="tbl-empty-state",a.PRE_SEARCH_HEADER="tbl-pre-search-header",a))(T||{}),S=(a=>(a.TEXT="tt-text",a.TRIGGER="tt-trigger",a.HEADER="tt-header",a))(S||{}),I=(a=>(a.WRAPPER="tabs-wrapper",a.TAB="tabs-tab",a))(I||{}),B=(a=>(a.CONTAINER="field-label-container",a.TEXT="field-label-text",a.MANDATORY="field-label-mandatory",a.TOOLTIP="field-label-help-tooltip",a))(B||{}),C=(a=>(a.CONTAINER="field-help-text-container",a.TEXT="field-help-text-text",a.ICON="field-help-text-icon",a))(C||{}),w=(a=>(a.CONTAINER="sb-container",a.TITLE="sb-title",a.MESSAGE="sb-message",a.CLOSE="sb-close",a.ICON="sb-icon",a.ACTION_BUTTON="sb-action-button",a))(w||{}),m=(a=>(a.TITLE="form-card-title",a.CONTENT="form-card-content",a.ACTIONS="form-card-actions",a.SAVE_BUTTON="form-card-save-btn",a.CANCEL_BUTTON="form-card-cancel-btn",a))(m||{}),N=(a=>(a.TITLE="ah-title",a.APP_KEY="ah-app-key",a.APP_PLATFORM="ah-app-platform",a.AB_ICON="ah-ab-icon",a))(N||{}),F=(a=>(a.TEXT="ic-text",a.COPY_BTN="ic-copy-btn",a))(F||{}),A=(a=>(a.WRAPPER="multibar-wrapper",a.CLOSE_BTN="multibar-close-button",a.MENU="multibar-menu",a.ACTION="multibar-action",a))(A||{}),h=(a=>(a.CONTAINER="sortable-list-container",a.DRAGGABLE_LIST="sortable-list-draggable-list",a.LOCKED_LIST="sortable-list-locked-list",a))(h||{});const Y=(a,t)=>{const e=new URLSearchParams(a).toString();return t.includes("?")?`${t}${e}`:`${t}?${e}`},K=(a,t={})=>{const e=[];Object.entries(t).forEach(([g,u])=>{e.push(`${g}:${u}`)});const o={id:a,viewMode:"story",args:e.join(";")};return Y(o,"iframe.html")},n=(a,t)=>`${a}-${t}`;class j{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${b.WRAPPER}']`;await this.page.waitForSelector(e)}getBannerText({testId:t}){return this.page.getByTestId(n(t,b.CONTENT)).textContent()}hasBannerType({testId:t,type:e}){return this.page.getByTestId(n(t,b.WRAPPER)).locator(`.icon.icon-name--${e}`)!==null}}class q{constructor(t){l(this,"page");l(this,"testId");l(this,"componentId");l(this,"loadedPageSelector");this.page=t.page,this.testId=t.testId,this.componentId=t.componentId,this.loadedPageSelector=t.loadedPageSelector}async goto(t={}){const e={testId:this.testId,...t.additionalComponentParams};await this.page.goto(K(t.storyId||this.componentId,e)),await this.page.waitForSelector(this.loadedPageSelector)}}class z{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${d.WRAPPER}']`;await this.page.waitForSelector(e)}getDialogTitle({testId:t}){return this.page.getByTestId(n(t,d.HEADER)).textContent()}getDialogText({testId:t}){return this.page.getByTestId(n(t,d.CONTENT)).textContent()}async closeDialog({testId:t}){await(await this.page.getByTestId(n(t,d.ACTION_CLOSE))).click()}async clickOnPrimaryButton({testId:t}){await this.page.getByTestId(n(t,d.SAVE_BUTTON)).click()}async clickOnDefaultButton({testId:t}){await this.page.getByTestId(n(t,d.CANCEL_BUTTON)).click()}async clickOnDeleteButton({testId:t}){await(await this.page.getByTestId(n(t,d.ACTION_BUTTONS_WRAPPER)).locator(".danger")).click()}getDialogSubtitle({testId:t}){return this.page.getByTestId(n(t,d.HEADER_SECONDARY)).locator(".subtitle").textContent()}async isDialogVisible({testId:t}){return await this.page.waitForTimeout(1e3),(await this.page.getByTestId(n(t,d.WRAPPER))).isVisible()}async waitForDialogToClose(t){await this.page.waitForSelector(n(t,d.WRAPPER),{state:"hidden"})}}class ${constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){await this.page.getByTestId(n(t,s.WRAPPER))}async selectDropdownOptionByIndex({testId:t,index:e}){await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li").nth(e).click()}getDropdownButtonContent(t){return this.page.getByTestId(n(t,s.BUTTON_CONTENT)).textContent()}async openDropdownComponent({testId:t}){await this.page.getByTestId(n(t,s.TRIGGER)).click({position:{x:15,y:15}})}async selectDropdownOptionByName({testId:t,name:e,shouldOpen:o=!0}){o&&await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li div.text-container",{hasText:e}).click()}async clearAllOptions({testId:t}){await this.page.getByTestId(n(t,s.ACTION_CLEAR_ALL)).click()}async selectMultipleItemsByIndex({testId:t,itemsToSelect:e}){await this.openDropdownComponent({testId:t}),await this.clearAllOptions({testId:t});for(const o of e)await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li").nth(o).click()}async selectMultipleItemsByName({testId:t,itemsToSelect:e,shouldClearAll:o}){await this.openDropdownComponent({testId:t}),o&&await this.clearAllOptions({testId:t});for(const i of e)await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li span",{hasText:i}).first().click()}async clickOnApply({testId:t}){await this.page.getByTestId(n(t,s.ACTION_APPLY)).click()}async clickOnCancel({testId:t}){await this.page.getByTestId(n(t,s.ACTION_CANCEL)).click()}async isValidationAppear({testId:t}){return(await this.page.getByTestId(n(t,s.BUTTON_WRAPPER)).getAttribute("class")).includes("state-error")}}class L{constructor(t){l(this,"page");this.page=t}getLabelText({testId:t}){return this.page.getByTestId(n(t,B.TEXT)).textContent()}isMandatory({testId:t}){return this.page.getByTestId(n(t,B.MANDATORY)).isVisible()}async getHelpIconText({testId:t}){const e=await this.page.getByTestId(n(t,B.TOOLTIP));return await e.hover(),e.getAttribute("text")}}class P{constructor(t){l(this,"page");this.page=t}hasExtraText({testId:t}){return this.page.getByTestId(n(t,C.TEXT)).isVisible()}getExtraText({testId:t}){return this.page.getByTestId(n(t,C.TEXT)).textContent()}async hasExtraTextIconType({testId:t,type:e}){return await(await this.page.getByTestId(n(t,C.CONTAINER)).locator(`.icon.icon-name--${e}`)).count()!==0}}class f extends ${constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new L(e),this.fieldHelpTextComponent=new P(e)}getDropdownTitle({testId:e}){return this.fieldLabelComponent.getLabelText({testId:e})}isMandatory({testId:e}){return this.fieldLabelComponent.isMandatory({testId:e})}getHelpIconText({testId:e}){return this.fieldLabelComponent.getHelpIconText({testId:e})}hasExtraText({testId:e}){return this.fieldHelpTextComponent.hasExtraText({testId:e})}getExtraText({testId:e}){return this.fieldHelpTextComponent.getExtraText({testId:e})}hasExtraTextIconType({testId:e,type:o}){return this.fieldHelpTextComponent.hasExtraTextIconType({testId:e,type:o})}async getSelectedLabel({testId:e}){let i=await this.page.getByTestId(n(e,s.BUTTON_CONTENT)).textContent();if(await this.page.getByTestId(n(e,s.BUTTON_CONTENT_SUFFIX)).isVisible({timeout:1e3})){const u=await this.page.getByTestId(n(e,s.BUTTON_CONTENT_SUFFIX)).textContent();i=`${i}${u}`}return i}async searchForItem({testId:e,searchTerm:o}){return await this.openDropdownComponent({testId:e}),await this.page.getByTestId(n(e,r.FIELD)).fill(o),this.page.getByTestId(n(e,s.LIST_CONTAINER)).locator("ul > li span").first().textContent()}async isErrorText({testId:e}){return await this.page.getByTestId(n(e,C.TEXT)).count()>0}async isDisabled({testId:e}){return(await this.page.getByTestId(n(e,s.TRIGGER)).locator(".button__container--disabled")).isVisible()}isSelectAllChecked({testId:e}){return this.page.getByTestId(n(e,s.SELECT_ALL)).locator(".checkbox.input").isChecked()}isSelectAllIndeterminate({testId:e}){return this.page.getByTestId(n(e,s.SELECT_ALL)).locator(".icon.indeterminate").isVisible()}async removeChipSelection({testId:e}){await this.page.getByTestId(n(e,s.BUTTON_CLEAR)).click()}getDropdownOptions({testId:e}){return this.page.getByTestId(n(e,s.LIST_CONTAINER)).locator(".list").allTextContents()}}class J extends ${constructor(t){super(t)}getDropdownTitle({testId:t}){return this.page.getByTestId(n(t,s.WRAPPER)).locator("label > span").textContent()}getSelectedItem({testId:t}){return this.page.getByTestId(n(t,s.TRIGGER)).locator("button > span").textContent()}async searchForItem({testId:t,searchTerm:e}){return await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,O.FIELD)).fill(e),this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li span").first().textContent()}}class Q{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${p.TRIGGER}']`;await this.page.waitForSelector(e)}async clickOnApply(t){await this.page.getByTestId(n(t,p.ACTION_APPLY)).click()}async clickOnCancel(t){await this.page.getByTestId(n(t,p.ACTION_CANCEL)).click()}async openIncludeExcludeComponent(t){await this.page.getByTestId(n(t,p.TRIGGER)).click()}async searchForItem({testId:t,searchTerm:e}){return await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,p.SEARCH)).locator("input.transparent").fill(e),this.page.getByTestId(n(t,p.LIST)).locator("ul > li .v-popper span").first().textContent()}async selectItemByName({testId:t,entityName:e}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,p.LIST)).locator("ul > li .v-popper span",{hasText:e}).first().click(),await this.clickOnApply(t)}async selectItemByIndex({testId:t,index:e,applyChanges:o}){await this.clearAll({testId:t}),await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,p.LIST)).locator(".include-exclude-list ul > li").nth(e).click(),await this.page.waitForSelector("include-exclude-list-header-loading",{state:"hidden"}),o&&await this.clickOnApply(t)}async selectMultipleItems({testId:t,itemsToSelect:e}){await this.clearAll({testId:t}),await this.openIncludeExcludeComponent(t);for(const o of e)await this.page.getByTestId(n(t,p.LIST)).locator(".include-exclude-list ul > li").nth(o).click()}async unselectItemByName({testId:t,entityName:e}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,p.LIST_SELECTED)).locator("ul > li",{hasText:e}).locator(".clear-button").click(),await this.clickOnApply(t)}async unselectByIndex({testId:t,index:e,applyChanges:o}){await this.page.getByTestId(n(t,p.LIST_SELECTED)).locator("ul li button").nth(e).click(),o&&await this.clickOnApply(t)}async getSelectedCounter(t){return await this.page.getByTestId(n(t,p.LIST_SELECTED)).locator(".include-exclude-selected-header-left span").textContent()}async clearAll({testId:t}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,p.CLEAR_ALL)).click(),await this.clickOnApply(t)}getTriggerText({testId:t}){return this.page.getByTestId(n(t,p.TRIGGER)).locator(".include-exclude-trigger-middle-section .container span").first().textContent()}getTriggerDescription({testId:t}){return this.page.getByTestId(n(t,p.TRIGGER)).locator("div span.include-exclude-trigger-description").first().textContent()}async selectAll({testId:t}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,p.SELECT_ALL)).click(),await this.clickOnApply(t)}}class H{constructor(t){l(this,"page");this.page=t}getInputsFieldText({testId:t}){return this.page.getByTestId(n(t,r.FIELD)).inputValue()}getPlaceholderText({testId:t}){return this.page.getByTestId(n(t,r.FIELD)).getAttribute("placeholder")}getInputsType({testId:t}){return this.page.getByTestId(n(t,r.FIELD)).getAttribute("type")}async addInput({testId:t,text:e}){await this.page.getByTestId(n(t,r.FIELD)).type(e)}async clearInput({testId:t}){await this.page.getByTestId(n(t,r.FIELD)).clear()}isDisabled({testId:t}){return this.page.getByTestId(n(t,r.FIELD)).isDisabled()}}class Z extends H{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new L(e),this.fieldHelpTextComponent=new P(e)}getInputsLabelText({testId:e}){return this.fieldLabelComponent.getLabelText({testId:e})}async waitForComponent({testId:e}){const o=`[data-testid='${e}-${r.WRAPPER}']`;await this.page.waitForSelector(o)}isInputMandatory({testId:e}){return this.fieldLabelComponent.isMandatory({testId:e})}hasInputExtraText({testId:e}){return this.fieldHelpTextComponent.hasExtraText({testId:e})}getInputExtraText({testId:e}){return this.fieldHelpTextComponent.getExtraText({testId:e})}async clickOnApplyButton({testId:e}){await(await this.page.getByTestId(n(e,r.WRAPPER)).locator(".icon.icon-name--check")).click()}hasInlineErrorText({testId:e,inputTestId:o}){return this.page.getByTestId(n(e,o)).isVisible()}async getInlineErrorText({testId:e,inputTestId:o}){const i=this.page.getByTestId(n(e,o));return await i.hover(),i.getAttribute("text")}async clickOnShowPassword({testId:e}){await this.isPasswordHidden({testId:e})&&await this.clickOnPasswordIcon({testId:e})}async clickOnPasswordIcon({testId:e}){await this.page.getByTestId(n(e,r.TOGGLE_PASSWORD)).click()}async clickOnHidePassword({testId:e}){await this.isPasswordHidden({testId:e})||await this.clickOnPasswordIcon({testId:e})}isPasswordHidden({testId:e}){return this.page.getByTestId(n(e,r.TOGGLE_PASSWORD)).locator(".icon.icon-name--eye-slash").isVisible()}async clearInput({testId:e}){await(await this.page.getByTestId(n(e,r.FIELD))).clear()}hasExtraTextIconType({testId:e,type:o}){return this.fieldHelpTextComponent.hasExtraTextIconType({testId:e,type:o})}async isDisabled({testId:e}){return(await this.page.getByTestId(n(e,r.FIELD))).isDisabled()}hasApplyButton({testId:e}){return this.page.getByTestId(n(e,r.WRAPPER)).locator(".icon.icon-name--check").isVisible()}async getMaxLengthNumber({testId:e}){return(await this.getFontCaptionText({testId:e}))[1]}async getActualNumberLength({testId:e}){return(await this.getFontCaptionText({testId:e}))[0]}async getFontCaptionText({testId:e}){return(await this.page.getByTestId(n(e,r.WRAPPER)).locator(".font-caption").textContent()).split("/").map(i=>parseInt(i.trim(),10))}getHelpIconText({testId:e}){return this.fieldLabelComponent.getHelpIconText({testId:e})}async isValidationAppear({testId:e}){return(await this.page.getByTestId(n(e,r.WRAPPER)).getAttribute("class")).includes("variant-error")}}class M{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${I.WRAPPER}']`;await this.page.waitForSelector(e)}getSelectedTabText({testId:t}){return this.page.getByTestId(n(t,I.WRAPPER)).locator(".tab-item--active").textContent()}async selectTab({testId:t,tabName:e}){const o=await this.getTabIndex({testId:t,tabName:e});await this.page.getByTestId(n(t,`${I.TAB}-${o+1}`)).click()}async getTabIndex({testId:t,tabName:e}){return(await this.page.getByTestId(n(t,I.WRAPPER)).locator(".tab-item").allTextContents()).indexOf(e)}async isTabDisabled({testId:t,tabName:e}){const o=await this.getTabIndex({testId:t,tabName:e});return this.page.getByTestId(n(t,`${I.TAB}-${o}`)).locator(".tab-item--disabled").isVisible()}}class tt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${S.TRIGGER}']`;await this.page.waitForSelector(e)}getTooltipText({testId:t}){return this.page.getByTestId(`${t}-${S.TRIGGER}`).getAttribute("text")}getTooltipHeaderText({testId:t}){return this.page.getByTestId(`${t}-${S.TRIGGER}`).getAttribute("header")}}const x=".table-row",k=".icon-wrapper",G=".states",D=".table-head-container",v=".table-row.loading",et=1e3;class at{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${T.CONTAINER}']`;await this.page.waitForSelector(e)}getTableRowCount({testId:t}){return this.page.getByTestId(n(t,T.BODY_WRAPPER)).locator(x).count()}async getColumnHeaders({testId:t}){return this.page.getByTestId(n(t,T.TABLE)).locator(D).allTextContents()}getTableLabel({testId:t}){return this.page.getByTestId(n(t,T.HEADER)).innerText()}getTableFooter({testId:t}){return this.page.getByTestId(n(t,T.CONTAINER)).locator(".table-footer").innerText()}async clickOnHeaderByName(t){await this.page.locator(D,{hasText:t}).click()}async searchForItems({testId:t,searchTerm:e}){await this.clearSearchText({testId:t}),await this.page.getByTestId(n(t,r.FIELD)).fill(e)}async clearSearchText({testId:t}){await this.page.getByTestId(n(t,r.FIELD)).clear(),await this.waitForTableToLoad()}isArrowVisible({testId:t,headerName:e}){return this.page.getByTestId(n(t,T.TABLE)).locator(D,{hasText:e}).locator(".table-sort-icon").isVisible()}async scrollDownTableRows({testId:t}){const e=`[data-testid=${n(t,T.TABLE)}]`;await this.page.focus(e),await this.page.evaluate(o=>{const i=document.querySelector(o);i&&(i.scrollTop=i.scrollHeight)},e),await this.page.waitForTimeout(et)}async waitForTableToLoad(){await this.page.waitForSelector(v,{state:"hidden"})}async waitingForTableLoadingToAppear(){await this.page.waitForSelector(v)}async expandRow({testId:t,rowValue:e}){await this.page.getByTestId(n(t,T.BODY_WRAPPER)).locator(x,{hasText:e}).locator(k).click()}isRowExpanded({testId:t,rowValue:e}){return this.page.getByTestId(n(t,T.BODY_WRAPPER)).locator(x,{hasText:e}).locator(k).isVisible()}async getExpandedRowContent({testId:t,rowValue:e}){return await this.isRowExpanded({testId:t,rowValue:e})||await this.expandRow({testId:t,rowValue:e}),this.page.getByTestId(n(t,T.BODY_WRAPPER)).locator(x,{hasText:e}).locator(k).textContent()}isEmptyStateVisible({testId:t}){return this.page.getByTestId(n(t,T.TABLE)).locator(".empty-state").isVisible()}getEmptyStateTitle({testId:t}){return this.page.getByTestId(n(t,T.TABLE)).locator(".font-heading-4.title").textContent()}getEmptyStateSubtitle({testId:t}){return this.page.getByTestId(n(t,T.TABLE)).locator(".font-body-1.subtitle").textContent()}async clickOnRowCheckboxByRowValue({testId:t,rowValue:e}){await this.page.getByTestId(n(t,T.TABLE)).locator(x,{hasText:e}).locator(G).click()}getCheckedRowsNumber({testId:t}){return this.page.getByTestId(n(t,T.TABLE)).locator(x).locator(".icon.checked").count()}async clickOnSelectAllCheckbox({testId:t}){await this.page.getByTestId(n(t,T.TABLE)).locator(G).nth(0).click()}getTableLocator({testId:t}){return this.page.getByTestId(n(t,T.CONTAINER))}getColumnContentByHeaderName({testId:t,headerName:e}){return this.getTableLocator({testId:t}).locator(e).allTextContents()}}class W{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}']`;await this.page.waitForSelector(e)}async clickOnButton({testId:t}){await this.page.click(`[data-testid='${t}']`)}async isButtonLoading({testId:t}){return(await this.page.getByTestId(t).getAttribute("class")).includes("loading")}async getButtonText({testId:t}){return this.page.getByTestId(t).locator(".font-button").textContent()}isButtonDisabled({testId:t}){return this.page.getByTestId(t).isDisabled()}}class nt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${w.CONTAINER}']`;await this.page.waitForSelector(e)}getSnackbarTitle({testId:t}){return this.page.getByTestId(n(t,w.TITLE)).textContent()}async closeSnackbar({testId:t}){await this.page.getByTestId(n(t,w.CLOSE)).locator(".icon-name--x").click()}async waitForSnackbarToBeClosed({testId:t}){const e=`[data-testid='${t}-${w.CONTAINER}']`;await this.page.waitForSelector(e,{state:"detached"})}getSnackbarDescription({testId:t}){return this.page.getByTestId(n(t,w.MESSAGE)).textContent()}async clickOnActionButton({testId:t,buttonName:e}){const o=await this.getActionButtonIndex({testId:t,buttonName:e}),i=`[data-testid='${t}-${w.ACTION_BUTTON}-${o}']`;await this.page.click(i)}async getActionButtonIndex({testId:t,buttonName:e}){return(await this.page.getByTestId(n(t,w.CONTAINER)).locator(".font-button").allTextContents()).indexOf(e)}}class ot{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${A.WRAPPER}']`;await this.page.waitForSelector(e)}async closeMultiBar({testId:t}){await this.page.getByTestId(n(t,A.CLOSE_BTN)).locator(".icon-wrapper").click()}getMultiBarCountText({testId:t}){return this.page.getByTestId(n(t,A.WRAPPER)).locator(".count-text").textContent()}async isMultiBarVisible({testId:t}){return await this.page.waitForTimeout(1e3),this.page.getByTestId(n(t,A.WRAPPER)).locator(".multi-bar-panel").isVisible()}async clickOnActionButton({testId:t,actionButtonId:e}){await this.page.getByTestId(n(t,`${A.ACTION}-${e}`)).locator(".start-icon").click()}}class it{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${B.TEXT}']`;await this.page.waitForSelector(e)}getFormRowTitle({testId:t}){return new L(this.page).getLabelText({testId:t})}isFormRowMandatory({testId:t}){return new L(this.page).isMandatory({testId:t})}getIconText({testId:t}){return new P(this.page).getExtraText({testId:t})}}class st{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${m.CONTENT}']`;await this.page.waitForSelector(e)}getCardTitle({testId:t}){return this.page.getByTestId(n(t,m.TITLE)).textContent()}getCardContentText({testId:t}){return this.page.getByTestId(n(t,m.CONTENT)).textContent()}getCardLabelText({testId:t}){return new L(this.page).getLabelText({testId:t})}async clickOnSaveButton({testId:t}){await this.page.getByTestId(n(t,m.SAVE_BUTTON)).click()}async clickOnCancelButton({testId:t}){await this.page.getByTestId(n(t,m.CANCEL_BUTTON)).click()}isSaveButtonLoading({testId:t}){return new W(this.page).isButtonLoading({testId:t})}async clearForm({testId:t,inputType:e}){(await this.page.getByTestId(n(t,m.CONTENT)).locator(`[data-testid='ad-units-form-card-form-card-content'] input[type='${e}']`).all()).forEach(i=>i.clear())}}class R extends H{constructor(t){super(t)}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${r.WRAPPER}']`;await this.page.waitForSelector(e)}async isViewOnly({testId:t}){return await this.page.getByTestId(n(t,r.WRAPPER)).locator(".view-only.input-type").count()>0}getLabel({testId:t}){return this.page.getByTestId(n(t,r.LABEL_TEXT)).textContent()}isInputMandatory({testId:t}){return this.page.getByTestId(n(t,r.MANDATORY)).isVisible()}hasInputExtraHelpText({testId:t}){return this.page.getByTestId(n(t,r.EXTRA_TEXT)).isVisible()}async getHelpIconText({testId:t}){const e=await this.page.getByTestId(n(t,r.LABEL_CONTAINER)).locator(".v-popper.v-popper--theme-default");return await e.hover(),e.getAttribute("text")}getInputExtraText({testId:t}){return this.page.getByTestId(n(t,r.EXTRA_TEXT)).textContent()}getErrorExtraText({testId:t}){return this.page.getByTestId(n(t,r.EXTRA_TEXT)).locator(".error").textContent()}async showPassword({testId:t}){await this.isPasswordHidden({testId:t})&&await this.clickOnPasswordButton({testId:t})}async isPasswordHidden({testId:t}){return await this.page.getByTestId(n(t,r.WRAPPER)).getAttribute("type")==="password"}async clickOnPasswordButton({testId:t}){await(await this.page.getByTestId(n(t,r.WRAPPER)).locator(".password-visibility")).click()}}class ct{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${O.CONTAINER}']`;await this.page.waitForSelector(e)}async searchInput({testId:t,searchTerm:e}){await new R(this.page).addInput({testId:t,text:e})}async clearInput({testId:t}){await new R(this.page).clearInput({testId:t})}async clickOnXButton({testId:t}){await this.page.getByTestId(n(t,O.CLEAR)).locator(".icon-name--x-circle").click()}isDisabled({testId:t}){return new R(this.page).isDisabled({testId:t})}getSearchPlaceholder({testId:t}){return new R(this.page).getPlaceholderText({testId:t})}getSearchInputValue({testId:t}){return new R(this.page).getInputsFieldText({testId:t})}}class V{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${F.TEXT}']`;await this.page.waitForSelector(e)}getInlineCopyText({testId:t}){return this.page.getByTestId(`${t}-${F.TEXT}`).textContent()}}class rt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${N.TITLE}']`;await this.page.waitForSelector(e)}getHeaderTitle({testId:t}){return this.page.getByTestId(`${t}-${N.TITLE}`).textContent()}getInlineCopyText({testId:t}){return new V(this.page).getInlineCopyText({testId:t})}async isIconPresent({testId:t,iconName:e}){return await this.page.getByTestId(`${t}-${N.APP_PLATFORM}`).getAttribute("data-platform")===e}}class lt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${y.WRAPPER}']`;await this.page.waitForSelector(e)}getAlertText({testId:t}){return this.page.getByTestId(n(t,y.MESSAGE)).textContent()}getAlertTitle({testId:t}){return this.page.getByTestId(n(t,y.TITLE)).textContent()}async clickOnActionButton({testId:t}){await this.page.click(n(t,y.ACTION_BUTTON))}getActionButtonText({testId:t}){return this.page.getByTestId(n(t,y.ACTION_BUTTON)).textContent()}async closeAlert({testId:t}){await this.page.getByTestId(n(t,y.CLOSE_BUTTON)).click()}async isAlertVisible({testId:t}){return await this.page.getByTestId(n(t,y.WRAPPER)).count()>0}getAlertIconType({testId:t}){return this.page.getByTestId(n(t,y.WRAPPER)).getAttribute("class")}}class pt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${E.FIELD}']`;await this.page.waitForSelector(e)}async addInput({testId:t,text:e}){await this.page.getByTestId(n(t,E.FIELD)).type(e)}async clearInput({testId:t}){await this.page.getByTestId(n(t,E.FIELD)).clear()}getInput({testId:t}){return this.page.getByTestId(n(t,E.FIELD)).inputValue()}getPlaceholderText({testId:t}){return this.page.getByTestId(n(t,E.FIELD)).getAttribute("placeholder")}isDisabled({testId:t}){return this.page.getByTestId(n(t,E.FIELD)).isDisabled()}}class gt extends pt{getLabelText({testId:t}){return this.page.getByTestId(n(t,B.TEXT)).textContent()}hasFieldHelpText({testId:t}){return this.page.getByTestId(n(t,C.CONTAINER)).isVisible()}getFieldHelpText({testId:t}){return this.page.getByTestId(n(t,C.CONTAINER)).textContent()}}class Tt extends f{constructor(t){super(t)}getDropdownTitle({testId:t}){return this.fieldLabelComponent.getLabelText({testId:t})}isMandatory({testId:t}){return this.fieldLabelComponent.isMandatory({testId:t})}getHelpIconText({testId:t}){return this.fieldLabelComponent.getHelpIconText({testId:t})}hasExtraText({testId:t}){return this.fieldHelpTextComponent.hasExtraText({testId:t})}getExtraText({testId:t}){return this.fieldHelpTextComponent.getExtraText({testId:t})}hasExtraTextIconType({testId:t,type:e}){return this.fieldHelpTextComponent.hasExtraTextIconType({testId:t,type:e})}getSelectedLabel({testId:t}){return this.page.getByTestId(n(t,s.BUTTON_CONTENT)).textContent()}async searchForItem({testId:t,searchTerm:e}){return await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,r.FIELD)).fill(e),this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li span").first().textContent()}async isErrorText({testId:t}){return await this.page.getByTestId(n(t,C.TEXT)).count()>0}async isDisabled({testId:t}){return(await this.page.getByTestId(n(t,s.TRIGGER)).locator(".button__container--disabled")).isVisible()}async clearAllOptions({testId:t}){await this.page.getByTestId(n(t,s.ACTION_CLEAR_ALL)).click()}isSelectAllChecked({testId:t}){return this.page.getByTestId(n(t,s.SELECT_ALL)).locator(".checkbox.input").isChecked()}isSelectAllIndeterminate({testId:t}){return this.page.getByTestId(n(t,s.SELECT_ALL)).locator(".icon.indeterminate").isVisible()}async removeChipSelection({testId:t}){await this.page.getByTestId(n(t,s.BUTTON_CLEAR)).click()}getDropdownOptions({testId:t}){return this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator(".list").allTextContents()}async expandTreeNode({testId:t,nodeName:e}){const o=this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator(".item--multi",{hasText:e}).locator(".tree-main-arrow-wrapper");if(await o.isVisible())await o.click();else throw new Error(`Node with text "${e}" not found.`)}async selectTreeDropdownOptionByName({testId:t,node:e,item:o,shouldExpand:i=!1}){await this.openDropdownComponent({testId:t}),i&&await this.expandTreeNode({testId:t,nodeName:e});const g=this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator(`text=${o}`);if(await g.isVisible())await g.click();else throw new Error(`Option with text "${o}" not found in the dropdown.`)}async selectMultipleTreeItemsByName({testId:t,itemsToSelect:e,node:o}){await this.openDropdownComponent({testId:t});for(const i of e)await this.selectTreeDropdownOptionByName({testId:t,node:o,item:i,shouldExpand:!0});await this.clickOnApply({testId:t})}}const ht=".sortable-item";class ut{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${h.CONTAINER}']`;await this.page.waitForSelector(e)}async isComponentLoaded(t){const e=`[data-testid='${t}-${h.CONTAINER}']`;return this.page.isVisible(e)}async getItems(t){return this.page.getByTestId(n(t,h.CONTAINER)).locator(".sortable-item").allTextContents()}async sortItem(t,e,o){const i=await this.page.getByTestId(n(t,"sortable-list-item")),g=i.nth(e),u=i.nth(o);await g.dragTo(u)}async verifyOrder(t,e){return(await this.getItems(t)).every((i,g)=>i===e[g])}async getListItemLocator({testId:t,item:e,modifier:o}){return this.page.getByTestId(n(t,o)).locator(ht,{hasText:e})}async selectItem({testId:t,item:e,isLockedItem:o}){const i=o?h.LOCKED_LIST:h.DRAGGABLE_LIST;await(await this.getListItemLocator({testId:t,item:e,modifier:i})).click()}async isItemSelected(t){return await this.page.locator(".sortable-item--selected",{hasText:t}).count()>0}async expandItem({testId:t,item:e,isLockedItem:o}){const i=o?h.LOCKED_LIST:h.DRAGGABLE_LIST;await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".expand-icon").click()}async selectChildItem({testId:t,item:e,childItem:o,isLockedItem:i}){await this.expandItem({testId:t,item:e,isLockedItem:i}),await this.page.locator("ul li span",{hasText:o}).click()}async isListOpened({testId:t,item:e,isLockedItem:o}){const i=o?h.LOCKED_LIST:h.DRAGGABLE_LIST;return await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".child-list ul").count()>0}async isChildItemSelected(t){return await this.page.locator("ul li span",{hasText:t}).count()>0}async openItemMenu({testId:t,item:e,isLockedItem:o}){const i=o?h.LOCKED_LIST:h.DRAGGABLE_LIST;await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".item__menu button").click()}async selectMenuItem({testId:t,item:e,isLockedItem:o,menuItem:i}){await this.openItemMenu({testId:t,item:e,isLockedItem:o});const g=this.page.locator(".dropdown-list-wrapper");await g.locator("ul.list li",{hasText:i}).click(),await g.waitFor({state:"detached"})}async isMenuOpened(){return await this.page.locator(".dropdown-list-wrapper").count()>0}async dragAndDrop({testId:t,item:e,isLockedItem:o}){const i=o?h.LOCKED_LIST:h.DRAGGABLE_LIST,u=await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".item.drag-allowed").first().boundingBox();if(u){const U=u.x,X=u.y;await this.page.mouse.move(U,X),await this.page.mouse.down(),await this.page.mouse.move(U+20,X-20),await this.page.mouse.up()}}async getListOrder(){return(await this.page.locator(".sortable-list-container .item__text span").allInnerTexts()).reduce((e,o,i)=>(e[i+1]=o,e),{})}async searchForItem({testId:t,searchTerm:e}){return await this.page.getByTestId(n(t,r.FIELD)).fill(e),this.page.getByTestId(n(t,h.CONTAINER)).locator("ul > li span").first().textContent()}async verifySearchResultDisplayed({testId:t,item:e}){const o=[],i=await this.page.getByTestId(n(t,h.CONTAINER)).all();let g;for(const u of i)g=await u.locator(".child-list span",{hasText:e}).count(),o.push(g>0);return o}async getSelectedItem(t){return this.page.getByTestId(n(t,h.CONTAINER)).locator(".sortable-item--selected").textContent()}}class dt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=n(t,_.WRAPPER);await this.page.getByTestId(e).waitFor({state:"visible"})}async selectView({view:t,testId:e}){const o=`[text="${t}"]`;console.log(o);const i=n(e,_.WRAPPER);await(await this.page.getByTestId(i).locator(o)).click()}}c.AlertComponent=lt,c.AppHeaderComponent=rt,c.BannerComponent=j,c.ButtonComponent=W,c.ComponentBasePage=q,c.DialogComponent=z,c.DropdownComponent=f,c.DropdownComponentV3=J,c.FieldHelpTextComponent=P,c.FieldLabelComponent=L,c.FormCardComponent=st,c.FormRowComponent=it,c.IncludeExcludeComponent=Q,c.InlineCopyComponent=V,c.InputsComponent=Z,c.MultiBarComponent=ot,c.SearchComponent=ct,c.SnackbarComponent=nt,c.SortableListComponent=ut,c.SwitchComponent=dt,c.TableComponent=at,c.TabsComponent=M,c.TextAreaComponent=gt,c.TooltipComponent=tt,c.TreeDropdownComponent=Tt,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(c,g){typeof exports=="object"&&typeof module<"u"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(c=typeof globalThis<"u"?globalThis:c||self,g(c["shared-ui-e2e"]={}))})(this,function(c){"use strict";var Lt=Object.defineProperty;var xt=(c,g,s)=>g in c?Lt(c,g,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[g]=s;var l=(c,g,s)=>(xt(c,typeof g!="symbol"?g+"":g,s),s);var g=(a=>(a.TRIGGER="ie-trigger",a.CONTENT="ie-content",a.SEARCH="ie-search",a.LIST="ie-list",a.LIST_SELECTED="ie-list-selected",a.ACTION_CANCEL="ie-action-cancel",a.ACTION_APPLY="ie-action-apply",a.SELECT_ALL="ie-select-all",a.CLEAR_ALL="ie-clear-all",a))(g||{}),s=(a=>(a.TRIGGER="dd-trigger",a.WRAPPER="dd-wrapper",a.BUTTON="dd-button",a.BUTTON_WRAPPER="dd-button-wrapper",a.BUTTON_CONTENT="dd-button-content",a.BUTTON_CONTENT_SUFFIX="dd-button-content-suffix",a.BUTTON_CLEAR="dd-button-clear",a.LABEL="dd-label",a.LIST_CONTAINER="dd-list-container",a.SEARCH="dd-search",a.TITLE="dd-title",a.ACTION_CANCEL="dd-action-cancel",a.ACTION_APPLY="dd-action-apply",a.ACTION_CLEAR_ALL="dd-action-clear-all",a.HELPER_TEXT="dd-helper-text",a.HELPER_TEXT_ERROR="dd-helper-text-error",a.SELECT_ALL="dd-select-all",a.NO_RESULT="dd-no-result",a))(s||{}),S=(a=>(a.WRAPPER="banner-wrapper",a.CONTENT="banner-content",a))(S||{}),y=(a=>(a.WRAPPER="alert-wrapper",a.TITLE="alert-title",a.MESSAGE="alert-message",a.ACTION_BUTTON="alert-action-button",a.CLOSE_BUTTON="alert-close-button",a))(y||{}),d=(a=>(a.WRAPPER="dialog-wrapper",a.HEADER="dialog-header",a.ACTION_CLOSE="dialog-action-close",a.HEADER_SECONDARY="dialog-header-secondary",a.CONTENT="dialog-content",a.ACTION_BUTTONS_WRAPPER="dialog-action-buttons-wrapper",a.BACKDROP="dialog-backdrop",a.SAVE_BUTTON="dialog-save-button",a.CANCEL_BUTTON="dialog-cancel-button",a))(d||{}),p=(a=>(a.WRAPPER="input-wrapper",a.TOOLTIP="input-tooltip",a.TOOLTIP_WITHOUT_ICON="input-tooltip-without-icon",a.MANDATORY="input-mandatory",a.LABEL_CONTAINER="input-label-container",a.LABEL_TEXT="input-label-text",a.FIELD="input-field",a.EXTRA_TEXT="input-extra-text",a.TOGGLE_PASSWORD="input-toggle-password-icon",a.CLEAR_BUTTON="input-clear-button",a.LOADING="input-loading",a))(p||{}),$=(a=>(a.WRAPPER="swicth-wrapper",a.BUTTON="swicth-button",a.TEXT="swicth-text",a))($||{}),m=(a=>(a.WRAPPER="ta-wrapper",a.LABEL="ta-label",a.FIELD="ta-field",a.TEXT="ta-text",a))(m||{}),P=(a=>(a.CONTAINER="search-container",a.FIELD="search-field",a.CLOSE="search-close",a.CLEAR="search-clear",a))(P||{}),h=(a=>(a.CONTAINER="tbl-container",a.TABLE="tbl-table",a.HEADER="tbl-header",a.TITLE="tbl-title",a.HEADER_RIGHT="tbl-header-right",a.ACTIONS="tbl-actions",a.SECTIONS="tbl-sections",a.BODY_WRAPPER="tbl-body-wrapper",a.EMPTY_STATE="tbl-empty-state",a.PRE_SEARCH_HEADER="tbl-pre-search-header",a))(h||{}),_=(a=>(a.TEXT="tt-text",a.TRIGGER="tt-trigger",a.HEADER="tt-header",a))(_||{}),I=(a=>(a.WRAPPER="dr-wrapper",a.FIELD="dr-field",a.TRIGGER="dr-trigger",a.CONTAINER="dr-container",a.MENU="dr-menu",a.MESSAGE="dr-message",a.ACTION_APPLY="dr-action-apply",a.ACTION_CANCEL="dr-action-cancel",a))(I||{}),A=(a=>(a.WRAPPER="tabs-wrapper",a.TAB="tabs-tab",a))(A||{}),L=(a=>(a.CONTAINER="field-label-container",a.TEXT="field-label-text",a.MANDATORY="field-label-mandatory",a.TOOLTIP="field-label-help-tooltip",a))(L||{}),w=(a=>(a.CONTAINER="field-help-text-container",a.TEXT="field-help-text-text",a.ICON="field-help-text-icon",a))(w||{}),C=(a=>(a.CONTAINER="sb-container",a.TITLE="sb-title",a.MESSAGE="sb-message",a.CLOSE="sb-close",a.ICON="sb-icon",a.ACTION_BUTTON="sb-action-button",a))(C||{}),B=(a=>(a.TITLE="form-card-title",a.CONTENT="form-card-content",a.ACTIONS="form-card-actions",a.SAVE_BUTTON="form-card-save-btn",a.CANCEL_BUTTON="form-card-cancel-btn",a))(B||{}),D=(a=>(a.TITLE="ah-title",a.APP_KEY="ah-app-key",a.APP_PLATFORM="ah-app-platform",a.AB_ICON="ah-ab-icon",a))(D||{}),f=(a=>(a.TEXT="ic-text",a.COPY_BTN="ic-copy-btn",a))(f||{}),x=(a=>(a.WRAPPER="multibar-wrapper",a.CLOSE_BTN="multibar-close-button",a.MENU="multibar-menu",a.ACTION="multibar-action",a))(x||{}),u=(a=>(a.CONTAINER="sortable-list-container",a.DRAGGABLE_LIST="sortable-list-draggable-list",a.LOCKED_LIST="sortable-list-locked-list",a))(u||{});const Q=(a,t)=>{const e=new URLSearchParams(a).toString();return t.includes("?")?`${t}${e}`:`${t}?${e}`},Z=(a,t={})=>{const e=[];Object.entries(t).forEach(([r,T])=>{e.push(`${r}:${T}`)});const o={id:a,viewMode:"story",args:e.join(";")};return Q(o,"iframe.html")},n=(a,t)=>`${a}-${t}`;class M{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${S.WRAPPER}']`;await this.page.waitForSelector(e)}getBannerText({testId:t}){return this.page.getByTestId(n(t,S.CONTENT)).textContent()}hasBannerType({testId:t,type:e}){return this.page.getByTestId(n(t,S.WRAPPER)).locator(`.icon.icon-name--${e}`)!==null}}class tt{constructor(t){l(this,"page");l(this,"testId");l(this,"componentId");l(this,"loadedPageSelector");this.page=t.page,this.testId=t.testId,this.componentId=t.componentId,this.loadedPageSelector=t.loadedPageSelector}async goto(t={}){const e={testId:this.testId,...t.additionalComponentParams};await this.page.goto(Z(t.storyId||this.componentId,e)),await this.page.waitForSelector(this.loadedPageSelector)}}class et{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${d.WRAPPER}']`;await this.page.waitForSelector(e)}getDialogTitle({testId:t}){return this.page.getByTestId(n(t,d.HEADER)).textContent()}getDialogText({testId:t}){return this.page.getByTestId(n(t,d.CONTENT)).textContent()}async closeDialog({testId:t}){await(await this.page.getByTestId(n(t,d.ACTION_CLOSE))).click()}async clickOnPrimaryButton({testId:t}){await this.page.getByTestId(n(t,d.SAVE_BUTTON)).click()}async clickOnDefaultButton({testId:t}){await this.page.getByTestId(n(t,d.CANCEL_BUTTON)).click()}async clickOnDeleteButton({testId:t}){await(await this.page.getByTestId(n(t,d.ACTION_BUTTONS_WRAPPER)).locator(".danger")).click()}getDialogSubtitle({testId:t}){return this.page.getByTestId(n(t,d.HEADER_SECONDARY)).locator(".subtitle").textContent()}async isDialogVisible({testId:t}){return await this.page.waitForTimeout(1e3),(await this.page.getByTestId(n(t,d.WRAPPER))).isVisible()}async waitForDialogToClose(t){await this.page.waitForSelector(n(t,d.WRAPPER),{state:"hidden"})}}class U{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){await this.page.getByTestId(n(t,s.WRAPPER))}async selectDropdownOptionByIndex({testId:t,index:e}){await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li").nth(e).click()}getDropdownButtonContent(t){return this.page.getByTestId(n(t,s.BUTTON_CONTENT)).textContent()}async openDropdownComponent({testId:t}){await this.page.getByTestId(n(t,s.TRIGGER)).click({position:{x:15,y:15}})}async selectDropdownOptionByName({testId:t,name:e,shouldOpen:o=!0}){o&&await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li div.text-container",{hasText:e}).click()}async clearAllOptions({testId:t}){await this.page.getByTestId(n(t,s.ACTION_CLEAR_ALL)).click()}async selectMultipleItemsByIndex({testId:t,itemsToSelect:e,shouldOpen:o=!0}){o&&await this.openDropdownComponent({testId:t}),await this.clearAllOptions({testId:t});for(const i of e)await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li").nth(i).click()}async selectMultipleItemsByName({testId:t,itemsToSelect:e,shouldClearAll:o}){await this.openDropdownComponent({testId:t}),o&&await this.clearAllOptions({testId:t});for(const i of e)await this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li span",{hasText:i}).first().click()}async clickOnApply({testId:t}){await this.page.getByTestId(n(t,s.ACTION_APPLY)).click()}async clickOnCancel({testId:t}){await this.page.getByTestId(n(t,s.ACTION_CANCEL)).click()}async isValidationAppear({testId:t}){return(await this.page.getByTestId(n(t,s.BUTTON_WRAPPER)).getAttribute("class")).includes("state-error")}}class R{constructor(t){l(this,"page");this.page=t}getLabelText({testId:t}){return this.page.getByTestId(n(t,L.TEXT)).textContent()}isMandatory({testId:t}){return this.page.getByTestId(n(t,L.MANDATORY)).isVisible()}async getHelpIconText({testId:t}){const e=await this.page.getByTestId(n(t,L.TOOLTIP));return await e.hover(),e.getAttribute("text")}}class F{constructor(t){l(this,"page");this.page=t}hasExtraText({testId:t}){return this.page.getByTestId(n(t,w.TEXT)).isVisible()}getExtraText({testId:t}){return this.page.getByTestId(n(t,w.TEXT)).textContent()}async hasExtraTextIconType({testId:t,type:e}){return await(await this.page.getByTestId(n(t,w.CONTAINER)).locator(`.icon.icon-name--${e}`)).count()!==0}}class V extends U{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new R(e),this.fieldHelpTextComponent=new F(e)}getDropdownTitle({testId:e}){return this.fieldLabelComponent.getLabelText({testId:e})}isMandatory({testId:e}){return this.fieldLabelComponent.isMandatory({testId:e})}getHelpIconText({testId:e}){return this.fieldLabelComponent.getHelpIconText({testId:e})}hasExtraText({testId:e}){return this.fieldHelpTextComponent.hasExtraText({testId:e})}getExtraText({testId:e}){return this.fieldHelpTextComponent.getExtraText({testId:e})}hasExtraTextIconType({testId:e,type:o}){return this.fieldHelpTextComponent.hasExtraTextIconType({testId:e,type:o})}async getSelectedLabel({testId:e}){let i=await this.page.getByTestId(n(e,s.BUTTON_CONTENT)).textContent();if(await this.page.getByTestId(n(e,s.BUTTON_CONTENT_SUFFIX)).isVisible({timeout:1e3})){const T=await this.page.getByTestId(n(e,s.BUTTON_CONTENT_SUFFIX)).textContent();i=`${i}${T}`}return i}async searchForItem({testId:e,searchTerm:o}){return await this.openDropdownComponent({testId:e}),await this.page.getByTestId(n(e,p.FIELD)).fill(o),this.page.getByTestId(n(e,s.LIST_CONTAINER)).locator("ul > li span").first().textContent()}async isErrorText({testId:e}){return await this.page.getByTestId(n(e,w.TEXT)).count()>0}async isDisabled({testId:e}){return(await this.page.getByTestId(n(e,s.TRIGGER)).locator(".button__container--disabled")).isVisible()}isSelectAllChecked({testId:e}){return this.page.getByTestId(n(e,s.SELECT_ALL)).locator(".checkbox.input").isChecked()}isSelectAllIndeterminate({testId:e}){return this.page.getByTestId(n(e,s.SELECT_ALL)).locator(".icon.indeterminate").isVisible()}async removeChipSelection({testId:e}){await this.page.getByTestId(n(e,s.BUTTON_CLEAR)).click()}getDropdownOptions({testId:e}){return this.page.getByTestId(n(e,s.LIST_CONTAINER)).locator(".list").allTextContents()}}class at extends U{constructor(t){super(t)}getDropdownTitle({testId:t}){return this.page.getByTestId(n(t,s.WRAPPER)).locator("label > span").textContent()}getSelectedItem({testId:t}){return this.page.getByTestId(n(t,s.TRIGGER)).locator("button > span").textContent()}async searchForItem({testId:t,searchTerm:e}){return await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,P.FIELD)).fill(e),this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li span").first().textContent()}}class nt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${g.TRIGGER}']`;await this.page.waitForSelector(e)}async clickOnApply(t){await this.page.getByTestId(n(t,g.ACTION_APPLY)).click()}async clickOnCancel(t){await this.page.getByTestId(n(t,g.ACTION_CANCEL)).click()}async openIncludeExcludeComponent(t){await this.page.getByTestId(n(t,g.TRIGGER)).click()}async searchForItem({testId:t,searchTerm:e}){return await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,g.SEARCH)).locator("input.transparent").fill(e),this.page.getByTestId(n(t,g.LIST)).locator("ul > li .v-popper span").first().textContent()}async selectItemByName({testId:t,entityName:e}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,g.LIST)).locator("ul > li .v-popper span",{hasText:e}).first().click(),await this.clickOnApply(t)}async selectItemByIndex({testId:t,index:e,applyChanges:o}){await this.clearAll({testId:t}),await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,g.LIST)).locator(".include-exclude-list ul > li").nth(e).click(),await this.page.waitForSelector("include-exclude-list-header-loading",{state:"hidden"}),o&&await this.clickOnApply(t)}async selectMultipleItems({testId:t,itemsToSelect:e}){await this.clearAll({testId:t}),await this.openIncludeExcludeComponent(t);for(const o of e)await this.page.getByTestId(n(t,g.LIST)).locator(".include-exclude-list ul > li").nth(o).click()}async unselectItemByName({testId:t,entityName:e}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,g.LIST_SELECTED)).locator("ul > li",{hasText:e}).locator(".clear-button").click(),await this.clickOnApply(t)}async unselectByIndex({testId:t,index:e,applyChanges:o}){await this.page.getByTestId(n(t,g.LIST_SELECTED)).locator("ul li button").nth(e).click(),o&&await this.clickOnApply(t)}async getSelectedCounter(t){return await this.page.getByTestId(n(t,g.LIST_SELECTED)).locator(".include-exclude-selected-header-left span").textContent()}async clearAll({testId:t}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,g.CLEAR_ALL)).click(),await this.clickOnApply(t)}getTriggerText({testId:t}){return this.page.getByTestId(n(t,g.TRIGGER)).locator(".include-exclude-trigger-middle-section .container span").first().textContent()}getTriggerDescription({testId:t}){return this.page.getByTestId(n(t,g.TRIGGER)).locator("div span.include-exclude-trigger-description").first().textContent()}async selectAll({testId:t}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,g.SELECT_ALL)).click(),await this.clickOnApply(t)}}class X{constructor(t){l(this,"page");this.page=t}getInputsFieldText({testId:t}){return this.page.getByTestId(n(t,p.FIELD)).inputValue()}getPlaceholderText({testId:t}){return this.page.getByTestId(n(t,p.FIELD)).getAttribute("placeholder")}getInputsType({testId:t}){return this.page.getByTestId(n(t,p.FIELD)).getAttribute("type")}async addInput({testId:t,text:e}){await this.page.getByTestId(n(t,p.FIELD)).type(e)}async clearInput({testId:t}){await this.page.getByTestId(n(t,p.FIELD)).clear()}isDisabled({testId:t}){return this.page.getByTestId(n(t,p.FIELD)).isDisabled()}}class ot extends X{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new R(e),this.fieldHelpTextComponent=new F(e)}getInputsLabelText({testId:e}){return this.fieldLabelComponent.getLabelText({testId:e})}async waitForComponent({testId:e}){const o=`[data-testid='${e}-${p.WRAPPER}']`;await this.page.waitForSelector(o)}isInputMandatory({testId:e}){return this.fieldLabelComponent.isMandatory({testId:e})}hasInputExtraText({testId:e}){return this.fieldHelpTextComponent.hasExtraText({testId:e})}getInputExtraText({testId:e}){return this.fieldHelpTextComponent.getExtraText({testId:e})}async clickOnApplyButton({testId:e}){await(await this.page.getByTestId(n(e,p.WRAPPER)).locator(".icon.icon-name--check")).click()}hasInlineErrorText({testId:e,inputTestId:o}){return this.page.getByTestId(n(e,o)).isVisible()}async getInlineErrorText({testId:e,inputTestId:o}){const i=this.page.getByTestId(n(e,o));return await i.hover(),i.getAttribute("text")}async clickOnShowPassword({testId:e}){await this.isPasswordHidden({testId:e})&&await this.clickOnPasswordIcon({testId:e})}async clickOnPasswordIcon({testId:e}){await this.page.getByTestId(n(e,p.TOGGLE_PASSWORD)).click()}async clickOnHidePassword({testId:e}){await this.isPasswordHidden({testId:e})||await this.clickOnPasswordIcon({testId:e})}isPasswordHidden({testId:e}){return this.page.getByTestId(n(e,p.TOGGLE_PASSWORD)).locator(".icon.icon-name--eye-slash").isVisible()}async clearInput({testId:e}){await(await this.page.getByTestId(n(e,p.FIELD))).clear()}hasExtraTextIconType({testId:e,type:o}){return this.fieldHelpTextComponent.hasExtraTextIconType({testId:e,type:o})}async isDisabled({testId:e}){return(await this.page.getByTestId(n(e,p.FIELD))).isDisabled()}hasApplyButton({testId:e}){return this.page.getByTestId(n(e,p.WRAPPER)).locator(".icon.icon-name--check").isVisible()}async getMaxLengthNumber({testId:e}){return(await this.getFontCaptionText({testId:e}))[1]}async getActualNumberLength({testId:e}){return(await this.getFontCaptionText({testId:e}))[0]}async getFontCaptionText({testId:e}){return(await this.page.getByTestId(n(e,p.WRAPPER)).locator(".font-caption").textContent()).split("/").map(i=>parseInt(i.trim(),10))}getHelpIconText({testId:e}){return this.fieldLabelComponent.getHelpIconText({testId:e})}async isValidationAppear({testId:e}){return(await this.page.getByTestId(n(e,p.WRAPPER)).getAttribute("class")).includes("variant-error")}}class it{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${A.WRAPPER}']`;await this.page.waitForSelector(e)}getSelectedTabText({testId:t}){return this.page.getByTestId(n(t,A.WRAPPER)).locator(".tab-item--active").textContent()}async selectTab({testId:t,tabName:e}){const o=await this.getTabIndex({testId:t,tabName:e});await this.page.getByTestId(n(t,`${A.TAB}-${o+1}`)).click()}async getTabIndex({testId:t,tabName:e}){return(await this.page.getByTestId(n(t,A.WRAPPER)).locator(".tab-item").allTextContents()).indexOf(e)}async isTabDisabled({testId:t,tabName:e}){const o=await this.getTabIndex({testId:t,tabName:e});return this.page.getByTestId(n(t,`${A.TAB}-${o}`)).locator(".tab-item--disabled").isVisible()}}class st{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${_.TRIGGER}']`;await this.page.waitForSelector(e)}getTooltipText({testId:t}){return this.page.getByTestId(`${t}-${_.TRIGGER}`).getAttribute("text")}getTooltipHeaderText({testId:t}){return this.page.getByTestId(`${t}-${_.TRIGGER}`).getAttribute("header")}}const b=".table-row",v=".icon-wrapper",Y=".states",G=".table-head-container",J=".table-row.loading",ct=1e3;class rt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${h.CONTAINER}']`;await this.page.waitForSelector(e)}getTableRowCount({testId:t}){return this.page.getByTestId(n(t,h.BODY_WRAPPER)).locator(b).count()}async getColumnHeaders({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(G).allTextContents()}getTableLabel({testId:t}){return this.page.getByTestId(n(t,h.HEADER)).innerText()}getTableFooter({testId:t}){return this.page.getByTestId(n(t,h.CONTAINER)).locator(".table-footer").innerText()}async clickOnHeaderByName(t){await this.page.locator(G,{hasText:t}).click()}async searchForItems({testId:t,searchTerm:e}){await this.clearSearchText({testId:t}),await this.page.getByTestId(n(t,p.FIELD)).fill(e)}async clearSearchText({testId:t}){await this.page.getByTestId(n(t,p.FIELD)).clear(),await this.waitForTableToLoad()}isArrowVisible({testId:t,headerName:e}){return this.page.getByTestId(n(t,h.TABLE)).locator(G,{hasText:e}).locator(".table-sort-icon").isVisible()}async scrollDownTableRows({testId:t}){const e=`[data-testid=${n(t,h.TABLE)}]`;await this.page.focus(e),await this.page.evaluate(o=>{const i=document.querySelector(o);i&&(i.scrollTop=i.scrollHeight)},e),await this.page.waitForTimeout(ct)}async waitForTableToLoad(){await this.page.waitForSelector(J,{state:"hidden"})}async waitingForTableLoadingToAppear(){await this.page.waitForSelector(J)}async expandRow({testId:t,rowValue:e}){await this.page.getByTestId(n(t,h.BODY_WRAPPER)).locator(b,{hasText:e}).locator(v).click()}isRowExpanded({testId:t,rowValue:e}){return this.page.getByTestId(n(t,h.BODY_WRAPPER)).locator(b,{hasText:e}).locator(v).isVisible()}async getExpandedRowContent({testId:t,rowValue:e}){return await this.isRowExpanded({testId:t,rowValue:e})||await this.expandRow({testId:t,rowValue:e}),this.page.getByTestId(n(t,h.BODY_WRAPPER)).locator(b,{hasText:e}).locator(v).textContent()}isEmptyStateVisible({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(".empty-state").isVisible()}getEmptyStateTitle({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(".font-heading-4.title").textContent()}getEmptyStateSubtitle({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(".font-body-1.subtitle").textContent()}async clickOnRowCheckboxByRowValue({testId:t,rowValue:e}){await this.page.getByTestId(n(t,h.TABLE)).locator(b,{hasText:e}).locator(Y).click()}getCheckedRowsNumber({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(b).locator(".icon.checked").count()}async clickOnSelectAllCheckbox({testId:t}){await this.page.getByTestId(n(t,h.TABLE)).locator(Y).nth(0).click()}getTableLocator({testId:t}){return this.page.getByTestId(n(t,h.CONTAINER))}getColumnContentByHeaderName({testId:t,headerName:e}){return this.getTableLocator({testId:t}).locator(e).allTextContents()}}class K{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}']`;await this.page.waitForSelector(e)}async clickOnButton({testId:t}){await this.page.click(`[data-testid='${t}']`)}async isButtonLoading({testId:t}){return(await this.page.getByTestId(t).getAttribute("class")).includes("loading")}async getButtonText({testId:t}){return this.page.getByTestId(t).locator(".font-button").textContent()}isButtonDisabled({testId:t}){return this.page.getByTestId(t).isDisabled()}}class lt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${C.CONTAINER}']`;await this.page.waitForSelector(e)}getSnackbarTitle({testId:t}){return this.page.getByTestId(n(t,C.TITLE)).textContent()}async closeSnackbar({testId:t}){await this.page.getByTestId(n(t,C.CLOSE)).locator(".icon-name--x").click()}async waitForSnackbarToBeClosed({testId:t}){const e=`[data-testid='${t}-${C.CONTAINER}']`;await this.page.waitForSelector(e,{state:"detached"})}getSnackbarDescription({testId:t}){return this.page.getByTestId(n(t,C.MESSAGE)).textContent()}async clickOnActionButton({testId:t,buttonName:e}){const o=await this.getActionButtonIndex({testId:t,buttonName:e}),i=`[data-testid='${t}-${C.ACTION_BUTTON}-${o}']`;await this.page.click(i)}async getActionButtonIndex({testId:t,buttonName:e}){return(await this.page.getByTestId(n(t,C.CONTAINER)).locator(".font-button").allTextContents()).indexOf(e)}}class pt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${x.WRAPPER}']`;await this.page.waitForSelector(e)}async closeMultiBar({testId:t}){await this.page.getByTestId(n(t,x.CLOSE_BTN)).locator(".icon-wrapper").click()}getMultiBarCountText({testId:t}){return this.page.getByTestId(n(t,x.WRAPPER)).locator(".count-text").textContent()}async isMultiBarVisible({testId:t}){return await this.page.waitForTimeout(1e3),this.page.getByTestId(n(t,x.WRAPPER)).locator(".multi-bar-panel").isVisible()}async clickOnActionButton({testId:t,actionButtonId:e}){await this.page.getByTestId(n(t,`${x.ACTION}-${e}`)).locator(".start-icon").click()}}class gt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${L.TEXT}']`;await this.page.waitForSelector(e)}getFormRowTitle({testId:t}){return new R(this.page).getLabelText({testId:t})}isFormRowMandatory({testId:t}){return new R(this.page).isMandatory({testId:t})}getIconText({testId:t}){return new F(this.page).getExtraText({testId:t})}}class Tt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${B.CONTENT}']`;await this.page.waitForSelector(e)}getCardTitle({testId:t}){return this.page.getByTestId(n(t,B.TITLE)).textContent()}getCardContentText({testId:t}){return this.page.getByTestId(n(t,B.CONTENT)).textContent()}getCardLabelText({testId:t}){return new R(this.page).getLabelText({testId:t})}async clickOnSaveButton({testId:t}){await this.page.getByTestId(n(t,B.SAVE_BUTTON)).click()}async clickOnCancelButton({testId:t}){await this.page.getByTestId(n(t,B.CANCEL_BUTTON)).click()}isSaveButtonLoading({testId:t}){return new K(this.page).isButtonLoading({testId:t})}async clearForm({testId:t,inputType:e}){(await this.page.getByTestId(n(t,B.CONTENT)).locator(`[data-testid='ad-units-form-card-form-card-content'] input[type='${e}']`).all()).forEach(i=>i.clear())}}class N extends X{constructor(t){super(t)}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${p.WRAPPER}']`;await this.page.waitForSelector(e)}async isViewOnly({testId:t}){return await this.page.getByTestId(n(t,p.WRAPPER)).locator(".view-only.input-type").count()>0}getLabel({testId:t}){return this.page.getByTestId(n(t,p.LABEL_TEXT)).textContent()}isInputMandatory({testId:t}){return this.page.getByTestId(n(t,p.MANDATORY)).isVisible()}hasInputExtraHelpText({testId:t}){return this.page.getByTestId(n(t,p.EXTRA_TEXT)).isVisible()}async getHelpIconText({testId:t}){const e=await this.page.getByTestId(n(t,p.LABEL_CONTAINER)).locator(".v-popper.v-popper--theme-default");return await e.hover(),e.getAttribute("text")}getInputExtraText({testId:t}){return this.page.getByTestId(n(t,p.EXTRA_TEXT)).textContent()}getErrorExtraText({testId:t}){return this.page.getByTestId(n(t,p.EXTRA_TEXT)).locator(".error").textContent()}async showPassword({testId:t}){await this.isPasswordHidden({testId:t})&&await this.clickOnPasswordButton({testId:t})}async isPasswordHidden({testId:t}){return await this.page.getByTestId(n(t,p.WRAPPER)).getAttribute("type")==="password"}async clickOnPasswordButton({testId:t}){await(await this.page.getByTestId(n(t,p.WRAPPER)).locator(".password-visibility")).click()}}class ht{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${P.CONTAINER}']`;await this.page.waitForSelector(e)}async searchInput({testId:t,searchTerm:e}){await new N(this.page).addInput({testId:t,text:e})}async clearInput({testId:t}){await new N(this.page).clearInput({testId:t})}async clickOnXButton({testId:t}){await this.page.getByTestId(n(t,P.CLEAR)).locator(".icon-name--x-circle").click()}isDisabled({testId:t}){return new N(this.page).isDisabled({testId:t})}getSearchPlaceholder({testId:t}){return new N(this.page).getPlaceholderText({testId:t})}getSearchInputValue({testId:t}){return new N(this.page).getInputsFieldText({testId:t})}}class j{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${f.TEXT}']`;await this.page.waitForSelector(e)}getInlineCopyText({testId:t}){return this.page.getByTestId(`${t}-${f.TEXT}`).textContent()}}class ut{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${D.TITLE}']`;await this.page.waitForSelector(e)}getHeaderTitle({testId:t}){return this.page.getByTestId(`${t}-${D.TITLE}`).textContent()}getInlineCopyText({testId:t}){return new j(this.page).getInlineCopyText({testId:t})}async isIconPresent({testId:t,iconName:e}){return await this.page.getByTestId(`${t}-${D.APP_PLATFORM}`).getAttribute("data-platform")===e}}class dt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${y.WRAPPER}']`;await this.page.waitForSelector(e)}getAlertText({testId:t}){return this.page.getByTestId(n(t,y.MESSAGE)).textContent()}getAlertTitle({testId:t}){return this.page.getByTestId(n(t,y.TITLE)).textContent()}async clickOnActionButton({testId:t}){await this.page.click(n(t,y.ACTION_BUTTON))}getActionButtonText({testId:t}){return this.page.getByTestId(n(t,y.ACTION_BUTTON)).textContent()}async closeAlert({testId:t}){await this.page.getByTestId(n(t,y.CLOSE_BUTTON)).click()}async isAlertVisible({testId:t}){return await this.page.getByTestId(n(t,y.WRAPPER)).count()>0}getAlertIconType({testId:t}){return this.page.getByTestId(n(t,y.WRAPPER)).getAttribute("class")}}class yt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${m.FIELD}']`;await this.page.waitForSelector(e)}async addInput({testId:t,text:e}){await this.page.getByTestId(n(t,m.FIELD)).type(e)}async clearInput({testId:t}){await this.page.getByTestId(n(t,m.FIELD)).clear()}getInput({testId:t}){return this.page.getByTestId(n(t,m.FIELD)).inputValue()}getPlaceholderText({testId:t}){return this.page.getByTestId(n(t,m.FIELD)).getAttribute("placeholder")}isDisabled({testId:t}){return this.page.getByTestId(n(t,m.FIELD)).isDisabled()}}class wt extends yt{getLabelText({testId:t}){return this.page.getByTestId(n(t,L.TEXT)).textContent()}hasFieldHelpText({testId:t}){return this.page.getByTestId(n(t,w.CONTAINER)).isVisible()}getFieldHelpText({testId:t}){return this.page.getByTestId(n(t,w.CONTAINER)).textContent()}}class Ct extends V{constructor(t){super(t)}getDropdownTitle({testId:t}){return this.fieldLabelComponent.getLabelText({testId:t})}isMandatory({testId:t}){return this.fieldLabelComponent.isMandatory({testId:t})}getHelpIconText({testId:t}){return this.fieldLabelComponent.getHelpIconText({testId:t})}hasExtraText({testId:t}){return this.fieldHelpTextComponent.hasExtraText({testId:t})}getExtraText({testId:t}){return this.fieldHelpTextComponent.getExtraText({testId:t})}hasExtraTextIconType({testId:t,type:e}){return this.fieldHelpTextComponent.hasExtraTextIconType({testId:t,type:e})}getSelectedLabel({testId:t}){return this.page.getByTestId(n(t,s.BUTTON_CONTENT)).textContent()}async searchForItem({testId:t,searchTerm:e}){return await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,p.FIELD)).fill(e),this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator("ul > li span").first().textContent()}async isErrorText({testId:t}){return await this.page.getByTestId(n(t,w.TEXT)).count()>0}async isDisabled({testId:t}){return(await this.page.getByTestId(n(t,s.TRIGGER)).locator(".button__container--disabled")).isVisible()}async clearAllOptions({testId:t}){await this.page.getByTestId(n(t,s.ACTION_CLEAR_ALL)).click()}isSelectAllChecked({testId:t}){return this.page.getByTestId(n(t,s.SELECT_ALL)).locator(".checkbox.input").isChecked()}isSelectAllIndeterminate({testId:t}){return this.page.getByTestId(n(t,s.SELECT_ALL)).locator(".icon.indeterminate").isVisible()}async removeChipSelection({testId:t}){await this.page.getByTestId(n(t,s.BUTTON_CLEAR)).click()}getDropdownOptions({testId:t}){return this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator(".list").allTextContents()}async expandTreeNode({testId:t,nodeName:e}){const o=this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator(".item--multi",{hasText:e}).locator(".tree-main-arrow-wrapper");if(await o.isVisible())await o.click();else throw new Error(`Node with text "${e}" not found.`)}async selectTreeDropdownOptionByName({testId:t,node:e,item:o,shouldExpand:i=!1}){await this.openDropdownComponent({testId:t}),i&&await this.expandTreeNode({testId:t,nodeName:e});const r=this.page.getByTestId(n(t,s.LIST_CONTAINER)).locator(`text=${o}`);if(await r.isVisible())await r.click();else throw new Error(`Option with text "${o}" not found in the dropdown.`)}async selectMultipleTreeItemsByName({testId:t,itemsToSelect:e,node:o}){await this.openDropdownComponent({testId:t});for(const i of e)await this.selectTreeDropdownOptionByName({testId:t,node:o,item:i,shouldExpand:!0});await this.clickOnApply({testId:t})}}const Et=".sortable-item";class mt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${u.CONTAINER}']`;await this.page.waitForSelector(e)}async isComponentLoaded(t){const e=`[data-testid='${t}-${u.CONTAINER}']`;return this.page.isVisible(e)}async getItems(t){return this.page.getByTestId(n(t,u.CONTAINER)).locator(".sortable-item").allTextContents()}async sortItem(t,e,o){const i=await this.page.getByTestId(n(t,"sortable-list-item")),r=i.nth(e),T=i.nth(o);await r.dragTo(T)}async verifyOrder(t,e){return(await this.getItems(t)).every((i,r)=>i===e[r])}async getListItemLocator({testId:t,item:e,modifier:o}){return this.page.getByTestId(n(t,o)).locator(Et,{hasText:e})}async selectItem({testId:t,item:e,isLockedItem:o}){const i=o?u.LOCKED_LIST:u.DRAGGABLE_LIST;await(await this.getListItemLocator({testId:t,item:e,modifier:i})).click()}async isItemSelected(t){return await this.page.locator(".sortable-item--selected",{hasText:t}).count()>0}async expandItem({testId:t,item:e,isLockedItem:o}){const i=o?u.LOCKED_LIST:u.DRAGGABLE_LIST;await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".expand-icon").click()}async selectChildItem({testId:t,item:e,childItem:o,isLockedItem:i}){await this.expandItem({testId:t,item:e,isLockedItem:i}),await this.page.locator("ul li span",{hasText:o}).click()}async isListOpened({testId:t,item:e,isLockedItem:o}){const i=o?u.LOCKED_LIST:u.DRAGGABLE_LIST;return await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".child-list ul").count()>0}async isChildItemSelected(t){return await this.page.locator("ul li span",{hasText:t}).count()>0}async openItemMenu({testId:t,item:e,isLockedItem:o}){const i=o?u.LOCKED_LIST:u.DRAGGABLE_LIST;await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".item__menu button").click()}async selectMenuItem({testId:t,item:e,isLockedItem:o,menuItem:i}){await this.openItemMenu({testId:t,item:e,isLockedItem:o});const r=this.page.locator(".dropdown-list-wrapper");await r.locator("ul.list li",{hasText:i}).click(),await r.waitFor({state:"detached"})}async isMenuOpened(){return await this.page.locator(".dropdown-list-wrapper").count()>0}async dragAndDrop({testId:t,item:e,isLockedItem:o}){const i=o?u.LOCKED_LIST:u.DRAGGABLE_LIST,T=await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".item.drag-allowed").first().boundingBox();if(T){const O=T.x,E=T.y;await this.page.mouse.move(O,E),await this.page.mouse.down(),await this.page.mouse.move(O+20,E-20),await this.page.mouse.up()}}async getListOrder(){return(await this.page.locator(".sortable-list-container .item__text span").allInnerTexts()).reduce((e,o,i)=>(e[i+1]=o,e),{})}async searchForItem({testId:t,searchTerm:e}){return await this.page.getByTestId(n(t,p.FIELD)).fill(e),this.page.getByTestId(n(t,u.CONTAINER)).locator("ul > li span").first().textContent()}async verifySearchResultDisplayed({testId:t,item:e}){const o=[],i=await this.page.getByTestId(n(t,u.CONTAINER)).all();let r;for(const T of i)r=await T.locator(".child-list span",{hasText:e}).count(),o.push(r>0);return o}async getSelectedItem(t){return this.page.getByTestId(n(t,u.CONTAINER)).locator(".sortable-item--selected").textContent()}}class It{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=n(t,$.WRAPPER);await this.page.getByTestId(e).waitFor({state:"visible"})}async selectView({view:t,testId:e}){const o=`[text="${t}"]`;console.log(o);const i=n(e,$.WRAPPER);await(await this.page.getByTestId(i).locator(o)).click()}}class Bt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=n(t,I.WRAPPER);await this.page.getByTestId(e).waitFor({state:"visible"})}async openDateRangeComponent(t){const e=n(t,I.TRIGGER);await(await this.page.getByTestId(e)).click()}async selectDateRangeMenu({testId:t,option:e}){await this.openDateRangeComponent(t);const o=n(t,I.MENU);await(await this.page.getByTestId(`${o}-${e}`)).click()}async selectSpecificDates({testId:t,startMonthYear:e,startDate:o,endMonthYear:i,endDate:r}){await this.openDateRangeComponent(t);const T=await this.goToStartMonthYear(e);await(await this.getDayElement(T,o)).click();const E=await this.goToEndMonthYear(i);await(await this.getDayElement(E,r)).click()}async getDayElement(t,e){const o=await t.locator(".date-wrapper").all();for(const i of o)if(await i.textContent()===e)return i;return null}async goToStartMonthYear(t){let o=1;for(;o<24;){const i=await this.page.$$(".month-header span.month-name");for(const T of i)if(await T.textContent()===t)return this.page.locator(".calendar-month",{hasText:t});await(await this.page.locator(".previous")).click(),o++,await this.page.waitForTimeout(500)}}async goToEndMonthYear(t){let o=1;for(;o<24;){const i=await this.page.$$(".month-header span.month-name");for(const T of i)if(await T.textContent()===t)return this.page.locator(".calendar-month",{hasText:t});await(await this.page.locator(".next")).click(),o++,await this.page.waitForTimeout(500)}}async getSelectedDays(){const t=await this.page.locator("span.start-day.today").count(),e=await this.page.locator("span.selected-day-between").count(),o=await this.page.locator("span.end-day").count();return t+e+o-1}async clickOnApply(t){const e=n(t,I.ACTION_APPLY);await(await this.page.getByTestId(e)).click()}async clickOnCancel(t){const e=n(t,I.ACTION_CANCEL);await(await this.page.getByTestId(e)).click()}async getDateRangeLabel(t){const e=n(t,I.TRIGGER);return(await this.page.getByTestId(e)).textContent()}createRangeLabel({startMonthYear:t,startDate:e,endMonthYear:o,endDate:i}){const r={January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},[T,O]=t.split(" "),E=r[T],[k,H]=o.split(" "),W=r[k];return`${E} ${e}, ${O} - ${W} ${i}, ${H}`}calculateDaysBetweenDates(t){const[e,o]=t.split(" - ");function i(k){const[H,W]=k.split(", "),[q,At]=H.split(" "),z={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11}[q];if(z===void 0)throw new Error(`Invalid month: ${q}`);return new Date(parseInt(W),z,parseInt(At))}const r=i(e),E=(i(o).getTime()-r.getTime())/(1e3*60*60*24);return Math.floor(E+1)}}c.AlertComponent=dt,c.AppHeaderComponent=ut,c.BannerComponent=M,c.ButtonComponent=K,c.ComponentBasePage=tt,c.DateRangeComponent=Bt,c.DialogComponent=et,c.DropdownComponent=V,c.DropdownComponentV3=at,c.FieldHelpTextComponent=F,c.FieldLabelComponent=R,c.FormCardComponent=Tt,c.FormRowComponent=gt,c.IncludeExcludeComponent=nt,c.InlineCopyComponent=j,c.InputsComponent=ot,c.MultiBarComponent=pt,c.SearchComponent=ht,c.SnackbarComponent=lt,c.SortableListComponent=mt,c.SwitchComponent=It,c.TableComponent=rt,c.TabsComponent=it,c.TextAreaComponent=wt,c.TooltipComponent=st,c.TreeDropdownComponent=Ct,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
import { DateRangeMenuOptionIds, SpecificDateRangeParams } from './types.ts';
|
|
3
|
+
export declare class DateRangeComponent {
|
|
4
|
+
readonly page: Page;
|
|
5
|
+
constructor(page: Page);
|
|
6
|
+
waitForComponent({ testId }: {
|
|
7
|
+
testId: string;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
openDateRangeComponent(testId: string): Promise<void>;
|
|
10
|
+
selectDateRangeMenu({ testId, option, }: {
|
|
11
|
+
testId: string;
|
|
12
|
+
option: DateRangeMenuOptionIds;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
selectSpecificDates({ testId, startMonthYear, startDate, endMonthYear, endDate, }: SpecificDateRangeParams): Promise<void>;
|
|
15
|
+
getDayElement(element: Locator, day: string): Promise<Locator>;
|
|
16
|
+
goToStartMonthYear(monthYear: any): Promise<Locator>;
|
|
17
|
+
goToEndMonthYear(monthYear: any): Promise<Locator>;
|
|
18
|
+
getSelectedDays(): Promise<number>;
|
|
19
|
+
clickOnApply(testId: string): Promise<void>;
|
|
20
|
+
clickOnCancel(testId: string): Promise<void>;
|
|
21
|
+
getDateRangeLabel(testId: any): Promise<string>;
|
|
22
|
+
createRangeLabel({ startMonthYear, startDate, endMonthYear, endDate, }: SpecificDateRangeParams): string;
|
|
23
|
+
calculateDaysBetweenDates(label: string): number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentBasePage } from '../base-page/component-base-page.ts';
|
|
2
|
+
import { DateRangeComponent } from './date-range-component.ts';
|
|
3
|
+
import { Page } from '@playwright/test';
|
|
4
|
+
import { DateRangeMenuOptionIds, SpecificDateRangeParams } from './types.ts';
|
|
5
|
+
export declare class DateRangePage extends ComponentBasePage {
|
|
6
|
+
readonly component: DateRangeComponent;
|
|
7
|
+
constructor(page: Page);
|
|
8
|
+
waitForComponent(): Promise<void>;
|
|
9
|
+
openDateRange(): Promise<void>;
|
|
10
|
+
selectDateRangeMenuOption(option: DateRangeMenuOptionIds): Promise<void>;
|
|
11
|
+
selectSpecificDates({ startMonthYear, startDate, endMonthYear, endDate, }: SpecificDateRangeParams): Promise<void>;
|
|
12
|
+
clickOnApply(): Promise<void>;
|
|
13
|
+
getDateRangeLabel(): Promise<string>;
|
|
14
|
+
getSelectedDays(): Promise<number>;
|
|
15
|
+
calculateDaysBetweenDates(label: string): number;
|
|
16
|
+
createRangeLabel({ startMonthYear, startDate, endMonthYear, endDate, }: SpecificDateRangeParams): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum DateRangeMenuOption {
|
|
2
|
+
TODAY = "Today",
|
|
3
|
+
YESTERDAY = "Yesterday",
|
|
4
|
+
LAST_7_DAYS = "Last 7 days",
|
|
5
|
+
LAST_14_DAYS = "Last 14 days",
|
|
6
|
+
LAST_30_DAYS = "Last 30 days",
|
|
7
|
+
THIS_MONTH = "This month"
|
|
8
|
+
}
|
|
9
|
+
export declare enum DateRangeMenuOptionIds {
|
|
10
|
+
TODAY = "today",
|
|
11
|
+
YESTERDAY = "yesterday",
|
|
12
|
+
LAST_7_DAYS = "last7days",
|
|
13
|
+
LAST_14_DAYS = "last14days",
|
|
14
|
+
LAST_30_DAYS = "last30days",
|
|
15
|
+
THIS_MONTH = "thisMonth"
|
|
16
|
+
}
|
|
17
|
+
export type SpecificDateRangeParams = {
|
|
18
|
+
testId?: string;
|
|
19
|
+
startDate: string;
|
|
20
|
+
startMonthYear: string;
|
|
21
|
+
endDate: string;
|
|
22
|
+
endMonthYear: string;
|
|
23
|
+
};
|
|
@@ -15,7 +15,7 @@ export declare class BaseDropdownComponent {
|
|
|
15
15
|
clearAllOptions({ testId }: {
|
|
16
16
|
testId: string;
|
|
17
17
|
}): Promise<void>;
|
|
18
|
-
selectMultipleItemsByIndex({ testId, itemsToSelect }: SelectMultiple): Promise<void>;
|
|
18
|
+
selectMultipleItemsByIndex({ testId, itemsToSelect, shouldOpen, }: SelectMultiple): Promise<void>;
|
|
19
19
|
selectMultipleItemsByName({ testId, itemsToSelect, shouldClearAll, }: SelectMultipleByName): Promise<void>;
|
|
20
20
|
clickOnApply({ testId }: {
|
|
21
21
|
testId: string;
|
package/tests/index.d.ts
CHANGED
|
@@ -29,3 +29,4 @@ export * from './components/inputs/inputs-v4/text-area/text-area-component.ts';
|
|
|
29
29
|
export * from './components/dropdown/dropdown-v4/treedropdown-component.ts';
|
|
30
30
|
export * from './components/sortablelist/sortable-list-component.ts';
|
|
31
31
|
export * from './components/switch/switch-component.ts';
|
|
32
|
+
export * from './components/date-range/date-range-component.ts';
|
package/tests/testids/index.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ export declare enum DropdownTestIdModifiers {
|
|
|
29
29
|
SELECT_ALL = "dd-select-all",
|
|
30
30
|
NO_RESULT = "dd-no-result"
|
|
31
31
|
}
|
|
32
|
+
export declare enum ColumnPickerTestIdModifiers {
|
|
33
|
+
TRIGGER = "column-picker-trigger",
|
|
34
|
+
WRAPPER = "column-picker-wrapper"
|
|
35
|
+
}
|
|
32
36
|
export declare enum BannerTestIdModifiers {
|
|
33
37
|
WRAPPER = "banner-wrapper",
|
|
34
38
|
CONTENT = "banner-content"
|
|
@@ -64,7 +68,9 @@ export declare enum InputTestIdModifiers {
|
|
|
64
68
|
LABEL_TEXT = "input-label-text",
|
|
65
69
|
FIELD = "input-field",
|
|
66
70
|
EXTRA_TEXT = "input-extra-text",
|
|
67
|
-
TOGGLE_PASSWORD = "input-toggle-password-icon"
|
|
71
|
+
TOGGLE_PASSWORD = "input-toggle-password-icon",
|
|
72
|
+
CLEAR_BUTTON = "input-clear-button",
|
|
73
|
+
LOADING = "input-loading"
|
|
68
74
|
}
|
|
69
75
|
export declare enum CheckboxTestIdModifiers {
|
|
70
76
|
WRAPPER = "cb-wrapper",
|