@ironsource/shared-ui-e2e 2.1.12-test.98 → 2.1.12
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 +620 -327
- package/shared-e2e-commands.umd.cjs +1 -1
- package/tests/components/chart/multiChart/consts.d.ts +29 -0
- package/tests/components/chart/multiChart/multi-chart-component.d.ts +29 -0
- package/tests/components/chart/multiChart/multi-chart-page.d.ts +19 -0
- package/tests/components/chart/multiChart/types.d.ts +15 -0
- 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 +2 -1
- package/tests/components/dropdown/dropdown-v4/dropdown-component.d.ts +3 -0
- package/tests/components/dropdown/types.d.ts +1 -0
- package/tests/components/switch/consts.d.ts +3 -0
- package/tests/components/switch/switch-component.d.ts +13 -0
- package/tests/components/switch/switch-page.d.ts +10 -0
- package/tests/components/switch/types.d.ts +4 -0
- package/tests/index.d.ts +3 -0
- package/tests/testids/index.d.ts +47 -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 dt=Object.defineProperty;var ut=(c,p,s)=>p in c?dt(c,p,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[p]=s;var l=(c,p,s)=>(ut(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||{}),u=(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))(u||{}),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||{}),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||{}),m=(a=>(a.WRAPPER="tabs-wrapper",a.TAB="tabs-tab",a))(m||{}),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||{}),I=(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))(I||{}),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||{}),_=(a=>(a.TEXT="ic-text",a.COPY_BTN="ic-copy-btn",a))(_||{}),L=(a=>(a.WRAPPER="multibar-wrapper",a.CLOSE_BTN="multibar-close-button",a.MENU="multibar-menu",a.ACTION="multibar-action",a))(L||{}),h=(a=>(a.CONTAINER="sortable-list-container",a.DRAGGABLE_LIST="sortable-list-draggable-list",a.LOCKED_LIST="sortable-list-locked-list",a))(h||{});const X=(a,t)=>{const e=new URLSearchParams(a).toString();return t.includes("?")?`${t}${e}`:`${t}?${e}`},Y=(a,t={})=>{const e=[];Object.entries(t).forEach(([g,d])=>{e.push(`${g}:${d}`)});const o={id:a,viewMode:"story",args:e.join(";")};return X(o,"iframe.html")},n=(a,t)=>`${a}-${t}`;class K{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 j{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(Y(t.storyId||this.componentId,e)),await this.page.waitForSelector(this.loadedPageSelector)}}class q{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${u.WRAPPER}']`;await this.page.waitForSelector(e)}getDialogTitle({testId:t}){return this.page.getByTestId(n(t,u.HEADER)).textContent()}getDialogText({testId:t}){return this.page.getByTestId(n(t,u.CONTENT)).textContent()}async closeDialog({testId:t}){await(await this.page.getByTestId(n(t,u.ACTION_CLOSE))).click()}async clickOnPrimaryButton({testId:t}){await this.page.getByTestId(n(t,u.SAVE_BUTTON)).click()}async clickOnDefaultButton({testId:t}){await this.page.getByTestId(n(t,u.CANCEL_BUTTON)).click()}async clickOnDeleteButton({testId:t}){await(await this.page.getByTestId(n(t,u.ACTION_BUTTONS_WRAPPER)).locator(".danger")).click()}getDialogSubtitle({testId:t}){return this.page.getByTestId(n(t,u.HEADER_SECONDARY)).locator(".subtitle").textContent()}async isDialogVisible({testId:t}){return await this.page.waitForTimeout(1e3),(await this.page.getByTestId(n(t,u.WRAPPER))).isVisible()}async waitForDialogToClose(t){await this.page.waitForSelector(n(t,u.WRAPPER),{state:"hidden"})}}class D{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 A{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 $ extends D{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new A(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 d=await this.page.getByTestId(n(e,s.BUTTON_CONTENT_SUFFIX)).textContent();i=`${i}${d}`}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 z extends D{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 J{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 f{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 Q extends f{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new A(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 Z{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${m.WRAPPER}']`;await this.page.waitForSelector(e)}getSelectedTabText({testId:t}){return this.page.getByTestId(n(t,m.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,`${m.TAB}-${o+1}`)).click()}async getTabIndex({testId:t,tabName:e}){return(await this.page.getByTestId(n(t,m.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,`${m.TAB}-${o}`)).locator(".tab-item--disabled").isVisible()}}class M{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",F=".icon-wrapper",H=".states",k=".table-head-container",G=".table-row.loading",tt=1e3;class et{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(k).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(k,{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(k,{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(tt)}async waitForTableToLoad(){await this.page.waitForSelector(G,{state:"hidden"})}async waitingForTableLoadingToAppear(){await this.page.waitForSelector(G)}async expandRow({testId:t,rowValue:e}){await this.page.getByTestId(n(t,T.BODY_WRAPPER)).locator(x,{hasText:e}).locator(F).click()}isRowExpanded({testId:t,rowValue:e}){return this.page.getByTestId(n(t,T.BODY_WRAPPER)).locator(x,{hasText:e}).locator(F).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(F).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(H).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(H).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 v{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 at{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 nt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${L.WRAPPER}']`;await this.page.waitForSelector(e)}async closeMultiBar({testId:t}){await this.page.getByTestId(n(t,L.CLOSE_BTN)).locator(".icon-wrapper").click()}getMultiBarCountText({testId:t}){return this.page.getByTestId(n(t,L.WRAPPER)).locator(".count-text").textContent()}async isMultiBarVisible({testId:t}){return await this.page.waitForTimeout(1e3),this.page.getByTestId(n(t,L.WRAPPER)).locator(".multi-bar-panel").isVisible()}async clickOnActionButton({testId:t,actionButtonId:e}){await this.page.getByTestId(n(t,`${L.ACTION}-${e}`)).locator(".start-icon").click()}}class ot{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 A(this.page).getLabelText({testId:t})}isFormRowMandatory({testId:t}){return new A(this.page).isMandatory({testId:t})}getIconText({testId:t}){return new P(this.page).getExtraText({testId:t})}}class it{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${I.CONTENT}']`;await this.page.waitForSelector(e)}getCardTitle({testId:t}){return this.page.getByTestId(n(t,I.TITLE)).textContent()}getCardContentText({testId:t}){return this.page.getByTestId(n(t,I.CONTENT)).textContent()}getCardLabelText({testId:t}){return new A(this.page).getLabelText({testId:t})}async clickOnSaveButton({testId:t}){await this.page.getByTestId(n(t,I.SAVE_BUTTON)).click()}async clickOnCancelButton({testId:t}){await this.page.getByTestId(n(t,I.CANCEL_BUTTON)).click()}isSaveButtonLoading({testId:t}){return new v(this.page).isButtonLoading({testId:t})}async clearForm({testId:t,inputType:e}){(await this.page.getByTestId(n(t,I.CONTENT)).locator(`[data-testid='ad-units-form-card-form-card-content'] input[type='${e}']`).all()).forEach(i=>i.clear())}}class R extends f{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 st{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 W{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${_.TEXT}']`;await this.page.waitForSelector(e)}getInlineCopyText({testId:t}){return this.page.getByTestId(`${t}-${_.TEXT}`).textContent()}}class ct{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 W(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 rt{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 lt{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 pt extends lt{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 gt extends ${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 Tt=".sortable-item";class ht{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),d=i.nth(o);await g.dragTo(d)}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(Tt,{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,d=await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".item.drag-allowed").first().boundingBox();if(d){const V=d.x,U=d.y;await this.page.mouse.move(V,U),await this.page.mouse.down(),await this.page.mouse.move(V+20,U-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 d of i)g=await d.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()}}c.AlertComponent=rt,c.AppHeaderComponent=ct,c.BannerComponent=K,c.ButtonComponent=v,c.ComponentBasePage=j,c.DialogComponent=q,c.DropdownComponent=$,c.DropdownComponentV3=z,c.FieldHelpTextComponent=P,c.FieldLabelComponent=A,c.FormCardComponent=it,c.FormRowComponent=ot,c.IncludeExcludeComponent=J,c.InlineCopyComponent=W,c.InputsComponent=Q,c.MultiBarComponent=nt,c.SearchComponent=st,c.SnackbarComponent=at,c.SortableListComponent=ht,c.TableComponent=et,c.TabsComponent=Z,c.TextAreaComponent=pt,c.TooltipComponent=M,c.TreeDropdownComponent=gt,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(r,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(r=typeof globalThis<"u"?globalThis:r||self,T(r["shared-ui-e2e"]={}))})(this,function(r){"use strict";var ft=Object.defineProperty;var Gt=(r,T,c)=>T in r?ft(r,T,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[T]=c;var l=(r,T,c)=>(Gt(r,typeof T!="symbol"?T+"":T,c),c);var T=(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))(T||{}),c=(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))(c||{}),F=(a=>(a.WRAPPER="banner-wrapper",a.CONTENT="banner-content",a))(F||{}),C=(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))(C||{}),w=(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))(w||{}),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||{}),W=(a=>(a.WRAPPER="swicth-wrapper",a.BUTTON="swicth-button",a.TEXT="swicth-text",a))(W||{}),L=(a=>(a.WRAPPER="ta-wrapper",a.LABEL="ta-label",a.FIELD="ta-field",a.TEXT="ta-text",a))(L||{}),$=(a=>(a.CONTAINER="search-container",a.FIELD="search-field",a.CLOSE="search-close",a.CLEAR="search-clear",a))($||{}),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||{}),f=(a=>(a.TEXT="tt-text",a.TRIGGER="tt-trigger",a.HEADER="tt-header",a))(f||{}),A=(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))(A||{}),R=(a=>(a.WRAPPER="tabs-wrapper",a.TAB="tabs-tab",a))(R||{}),O=(a=>(a.CONTAINER="field-label-container",a.TEXT="field-label-text",a.MANDATORY="field-label-mandatory",a.TOOLTIP="field-label-help-tooltip",a))(O||{}),m=(a=>(a.CONTAINER="field-help-text-container",a.TEXT="field-help-text-text",a.ICON="field-help-text-icon",a))(m||{}),I=(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))(I||{}),x=(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))(x||{}),G=(a=>(a.TITLE="ah-title",a.APP_KEY="ah-app-key",a.APP_PLATFORM="ah-app-platform",a.AB_ICON="ah-ab-icon",a))(G||{}),U=(a=>(a.TEXT="ic-text",a.COPY_BTN="ic-copy-btn",a))(U||{}),N=(a=>(a.WRAPPER="multibar-wrapper",a.CLOSE_BTN="multibar-close-button",a.MENU="multibar-menu",a.ACTION="multibar-action",a))(N||{}),d=(a=>(a.CONTAINER="sortable-list-container",a.DRAGGABLE_LIST="sortable-list-draggable-list",a.LOCKED_LIST="sortable-list-locked-list",a))(d||{}),u=(a=>(a.CONTAINER="chart-container",a.HEADER="chart-header",a.TREND="chart-trend",a.TYPE_SWITCHER="chart-type-switcher",a.LEGEND="chart-legend",a.LEGEND_CONTAINER="chart-legend-container",a.LEGEND_SORT="chart-legend-sort",a.EXTRA_CHART="chart-extra-chart",a.LOADER="chart-loader",a))(u||{});const it=(a,t)=>{const e=new URLSearchParams(a).toString();return t.includes("?")?`${t}${e}`:`${t}?${e}`},st=(a,t={})=>{const e=[];Object.entries(t).forEach(([s,g])=>{e.push(`${s}:${g}`)});const o={id:a,viewMode:"story",args:e.join(";")};return it(o,"iframe.html")},n=(a,t)=>`${a}-${t}`;class ct{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${F.WRAPPER}']`;await this.page.waitForSelector(e)}getBannerText({testId:t}){return this.page.getByTestId(n(t,F.CONTENT)).textContent()}hasBannerType({testId:t,type:e}){return this.page.getByTestId(n(t,F.WRAPPER)).locator(`.icon.icon-name--${e}`)!==null}}class rt{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(st(t.storyId||this.componentId,e)),await this.page.waitForSelector(this.loadedPageSelector)}}class lt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${w.WRAPPER}']`;await this.page.waitForSelector(e)}getDialogTitle({testId:t}){return this.page.getByTestId(n(t,w.HEADER)).textContent()}getDialogText({testId:t}){return this.page.getByTestId(n(t,w.CONTENT)).textContent()}async closeDialog({testId:t}){await(await this.page.getByTestId(n(t,w.ACTION_CLOSE))).click()}async clickOnPrimaryButton({testId:t}){await this.page.getByTestId(n(t,w.SAVE_BUTTON)).click()}async clickOnDefaultButton({testId:t}){await this.page.getByTestId(n(t,w.CANCEL_BUTTON)).click()}async clickOnDeleteButton({testId:t}){await(await this.page.getByTestId(n(t,w.ACTION_BUTTONS_WRAPPER)).locator(".danger")).click()}getDialogSubtitle({testId:t}){return this.page.getByTestId(n(t,w.HEADER_SECONDARY)).locator(".subtitle").textContent()}async isDialogVisible({testId:t}){return await this.page.waitForTimeout(1e3),(await this.page.getByTestId(n(t,w.WRAPPER))).isVisible()}async waitForDialogToClose(t){await this.page.waitForSelector(n(t,w.WRAPPER),{state:"hidden"})}}class j{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){await this.page.getByTestId(n(t,c.WRAPPER))}async selectDropdownOptionByIndex({testId:t,index:e}){await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,c.LIST_CONTAINER)).locator("ul > li").nth(e).click()}getDropdownButtonContent(t){return this.page.getByTestId(n(t,c.BUTTON_CONTENT)).textContent()}async openDropdownComponent({testId:t}){await this.page.getByTestId(n(t,c.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,c.LIST_CONTAINER)).locator("ul > li div.text-container",{hasText:e}).click()}async selectDropdownOptionByNameV2({testId:t,name:e,shouldOpen:o=!0}){o&&await this.openDropdownComponent({testId:t}),await(await this.page.getByTestId(n(t,c.LIST_CONTAINER)).locator(`li div.option-content:has-text("${e}")`)).click()}async clearAllOptions({testId:t}){await this.page.getByTestId(n(t,c.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,c.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,c.LIST_CONTAINER)).locator("ul > li span",{hasText:i}).first().click()}async clickOnApply({testId:t}){await this.page.getByTestId(n(t,c.ACTION_APPLY)).click()}async clickOnCancel({testId:t}){await this.page.getByTestId(n(t,c.ACTION_CANCEL)).click()}async isValidationAppear({testId:t}){return(await this.page.getByTestId(n(t,c.BUTTON_WRAPPER)).getAttribute("class")).includes("state-error")}}class b{constructor(t){l(this,"page");this.page=t}getLabelText({testId:t}){return this.page.getByTestId(n(t,O.TEXT)).textContent()}isMandatory({testId:t}){return this.page.getByTestId(n(t,O.MANDATORY)).isVisible()}async getHelpIconText({testId:t}){const e=await this.page.getByTestId(n(t,O.TOOLTIP));return await e.hover(),e.getAttribute("text")}}class H{constructor(t){l(this,"page");this.page=t}hasExtraText({testId:t}){return this.page.getByTestId(n(t,m.TEXT)).isVisible()}getExtraText({testId:t}){return this.page.getByTestId(n(t,m.TEXT)).textContent()}async hasExtraTextIconType({testId:t,type:e}){return await(await this.page.getByTestId(n(t,m.CONTAINER)).locator(`.icon.icon-name--${e}`)).count()!==0}}class V extends j{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new b(e),this.fieldHelpTextComponent=new H(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,c.BUTTON_CONTENT)).textContent();if(await this.page.getByTestId(n(e,c.BUTTON_CONTENT_SUFFIX)).isVisible({timeout:1e3})){const g=await this.page.getByTestId(n(e,c.BUTTON_CONTENT_SUFFIX)).textContent();i=`${i}${g}`}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,c.LIST_CONTAINER)).locator("ul > li span").first().textContent()}async isErrorText({testId:e}){return await this.page.getByTestId(n(e,m.TEXT)).count()>0}async isDisabled({testId:e}){return(await this.page.getByTestId(n(e,c.TRIGGER)).locator(".button__container--disabled")).isVisible()}isSelectAllChecked({testId:e}){return this.page.getByTestId(n(e,c.SELECT_ALL)).locator(".checkbox.input").isChecked()}isSelectAllIndeterminate({testId:e}){return this.page.getByTestId(n(e,c.SELECT_ALL)).locator(".icon.indeterminate").isVisible()}async removeChipSelection({testId:e}){await this.page.getByTestId(n(e,c.BUTTON_CLEAR)).click()}getDropdownOptions({testId:e}){return this.page.getByTestId(n(e,c.LIST_CONTAINER)).locator(".list").allTextContents()}async getDropdownOptionsV2({testId:e}){const o=[],i=await this.page.getByTestId(n(e,c.LIST_CONTAINER)).locator(".list li").all();for(const s of i){const g=await s.textContent();o.push(g)}return o}}class pt extends j{constructor(t){super(t)}getDropdownTitle({testId:t}){return this.page.getByTestId(n(t,c.WRAPPER)).locator("label > span").textContent()}getSelectedItem({testId:t}){return this.page.getByTestId(n(t,c.TRIGGER)).locator("button > span").textContent()}async searchForItem({testId:t,searchTerm:e}){return await this.openDropdownComponent({testId:t}),await this.page.getByTestId(n(t,$.FIELD)).fill(e),this.page.getByTestId(n(t,c.LIST_CONTAINER)).locator("ul > li span").first().textContent()}}class gt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${T.TRIGGER}']`;await this.page.waitForSelector(e)}async clickOnApply(t){await this.page.getByTestId(n(t,T.ACTION_APPLY)).click()}async clickOnCancel(t){await this.page.getByTestId(n(t,T.ACTION_CANCEL)).click()}async openIncludeExcludeComponent(t){await this.page.getByTestId(n(t,T.TRIGGER)).click()}async searchForItem({testId:t,searchTerm:e}){return await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,T.SEARCH)).locator("input.transparent").fill(e),this.page.getByTestId(n(t,T.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,T.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,T.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,T.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,T.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,T.LIST_SELECTED)).locator("ul li button").nth(e).click(),o&&await this.clickOnApply(t)}async getSelectedCounter(t){return await this.page.getByTestId(n(t,T.LIST_SELECTED)).locator(".include-exclude-selected-header-left span").textContent()}async clearAll({testId:t}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,T.CLEAR_ALL)).click(),await this.clickOnApply(t)}getTriggerText({testId:t}){return this.page.getByTestId(n(t,T.TRIGGER)).locator(".include-exclude-trigger-middle-section .container span").first().textContent()}getTriggerDescription({testId:t}){return this.page.getByTestId(n(t,T.TRIGGER)).locator("div span.include-exclude-trigger-description").first().textContent()}async selectAll({testId:t}){await this.openIncludeExcludeComponent(t),await this.page.getByTestId(n(t,T.SELECT_ALL)).click(),await this.clickOnApply(t)}}class q{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 Tt extends q{constructor(e){super(e);l(this,"fieldLabelComponent");l(this,"fieldHelpTextComponent");this.fieldLabelComponent=new b(e),this.fieldHelpTextComponent=new H(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 ht{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${R.WRAPPER}']`;await this.page.waitForSelector(e)}getSelectedTabText({testId:t}){return this.page.getByTestId(n(t,R.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,`${R.TAB}-${o+1}`)).click()}async getTabIndex({testId:t,tabName:e}){return(await this.page.getByTestId(n(t,R.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,`${R.TAB}-${o}`)).locator(".tab-item--disabled").isVisible()}}class dt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${f.TRIGGER}']`;await this.page.waitForSelector(e)}getTooltipText({testId:t}){return this.page.getByTestId(`${t}-${f.TRIGGER}`).getAttribute("text")}getTooltipHeaderText({testId:t}){return this.page.getByTestId(`${t}-${f.TRIGGER}`).getAttribute("header")}}const S=".table-row",X=".icon-wrapper",z=".states",Y=".table-head-container",Q=".table-row.loading",ut=1e3;class yt{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(S).count()}async getColumnHeaders({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(Y).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(Y,{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(Y,{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(ut)}async waitForTableToLoad(){await this.page.waitForSelector(Q,{state:"hidden"})}async waitingForTableLoadingToAppear(){await this.page.waitForSelector(Q)}async expandRow({testId:t,rowValue:e}){await this.page.getByTestId(n(t,h.BODY_WRAPPER)).locator(S,{hasText:e}).locator(X).click()}isRowExpanded({testId:t,rowValue:e}){return this.page.getByTestId(n(t,h.BODY_WRAPPER)).locator(S,{hasText:e}).locator(X).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(S,{hasText:e}).locator(X).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(S,{hasText:e}).locator(z).click()}getCheckedRowsNumber({testId:t}){return this.page.getByTestId(n(t,h.TABLE)).locator(S).locator(".icon.checked").count()}async clickOnSelectAllCheckbox({testId:t}){await this.page.getByTestId(n(t,h.TABLE)).locator(z).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 Z{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 Et{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${I.CONTAINER}']`;await this.page.waitForSelector(e)}getSnackbarTitle({testId:t}){return this.page.getByTestId(n(t,I.TITLE)).textContent()}async closeSnackbar({testId:t}){await this.page.getByTestId(n(t,I.CLOSE)).locator(".icon-name--x").click()}async waitForSnackbarToBeClosed({testId:t}){const e=`[data-testid='${t}-${I.CONTAINER}']`;await this.page.waitForSelector(e,{state:"detached"})}getSnackbarDescription({testId:t}){return this.page.getByTestId(n(t,I.MESSAGE)).textContent()}async clickOnActionButton({testId:t,buttonName:e}){const o=await this.getActionButtonIndex({testId:t,buttonName:e}),i=`[data-testid='${t}-${I.ACTION_BUTTON}-${o}']`;await this.page.click(i)}async getActionButtonIndex({testId:t,buttonName:e}){return(await this.page.getByTestId(n(t,I.CONTAINER)).locator(".font-button").allTextContents()).indexOf(e)}}class wt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${N.WRAPPER}']`;await this.page.waitForSelector(e)}async closeMultiBar({testId:t}){await this.page.getByTestId(n(t,N.CLOSE_BTN)).locator(".icon-wrapper").click()}getMultiBarCountText({testId:t}){return this.page.getByTestId(n(t,N.WRAPPER)).locator(".count-text").textContent()}async isMultiBarVisible({testId:t}){return await this.page.waitForTimeout(1e3),this.page.getByTestId(n(t,N.WRAPPER)).locator(".multi-bar-panel").isVisible()}async clickOnActionButton({testId:t,actionButtonId:e}){await this.page.getByTestId(n(t,`${N.ACTION}-${e}`)).locator(".start-icon").click()}}class Ct{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${O.TEXT}']`;await this.page.waitForSelector(e)}getFormRowTitle({testId:t}){return new b(this.page).getLabelText({testId:t})}isFormRowMandatory({testId:t}){return new b(this.page).isMandatory({testId:t})}getIconText({testId:t}){return new H(this.page).getExtraText({testId:t})}}class mt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${x.CONTENT}']`;await this.page.waitForSelector(e)}getCardTitle({testId:t}){return this.page.getByTestId(n(t,x.TITLE)).textContent()}getCardContentText({testId:t}){return this.page.getByTestId(n(t,x.CONTENT)).textContent()}getCardLabelText({testId:t}){return new b(this.page).getLabelText({testId:t})}async clickOnSaveButton({testId:t}){await this.page.getByTestId(n(t,x.SAVE_BUTTON)).click()}async clickOnCancelButton({testId:t}){await this.page.getByTestId(n(t,x.CANCEL_BUTTON)).click()}isSaveButtonLoading({testId:t}){return new Z(this.page).isButtonLoading({testId:t})}async clearForm({testId:t,inputType:e}){(await this.page.getByTestId(n(t,x.CONTENT)).locator(`[data-testid='ad-units-form-card-form-card-content'] input[type='${e}']`).all()).forEach(i=>i.clear())}}class P extends q{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 It{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${$.CONTAINER}']`;await this.page.waitForSelector(e)}async searchInput({testId:t,searchTerm:e}){await new P(this.page).addInput({testId:t,text:e})}async clearInput({testId:t}){await new P(this.page).clearInput({testId:t})}async clickOnXButton({testId:t}){await this.page.getByTestId(n(t,$.CLEAR)).locator(".icon-name--x-circle").click()}isDisabled({testId:t}){return new P(this.page).isDisabled({testId:t})}getSearchPlaceholder({testId:t}){return new P(this.page).getPlaceholderText({testId:t})}getSearchInputValue({testId:t}){return new P(this.page).getInputsFieldText({testId:t})}}class M{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${U.TEXT}']`;await this.page.waitForSelector(e)}getInlineCopyText({testId:t}){return this.page.getByTestId(`${t}-${U.TEXT}`).textContent()}}class Bt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${G.TITLE}']`;await this.page.waitForSelector(e)}getHeaderTitle({testId:t}){return this.page.getByTestId(`${t}-${G.TITLE}`).textContent()}getInlineCopyText({testId:t}){return new M(this.page).getInlineCopyText({testId:t})}async isIconPresent({testId:t,iconName:e}){return await this.page.getByTestId(`${t}-${G.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}-${C.WRAPPER}']`;await this.page.waitForSelector(e)}getAlertText({testId:t}){return this.page.getByTestId(n(t,C.MESSAGE)).textContent()}getAlertTitle({testId:t}){return this.page.getByTestId(n(t,C.TITLE)).textContent()}async clickOnActionButton({testId:t}){await this.page.click(n(t,C.ACTION_BUTTON))}getActionButtonText({testId:t}){return this.page.getByTestId(n(t,C.ACTION_BUTTON)).textContent()}async closeAlert({testId:t}){await this.page.getByTestId(n(t,C.CLOSE_BUTTON)).click()}async isAlertVisible({testId:t}){return await this.page.getByTestId(n(t,C.WRAPPER)).count()>0}getAlertIconType({testId:t}){return this.page.getByTestId(n(t,C.WRAPPER)).getAttribute("class")}}class At{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${L.FIELD}']`;await this.page.waitForSelector(e)}async addInput({testId:t,text:e}){await this.page.getByTestId(n(t,L.FIELD)).type(e)}async clearInput({testId:t}){await this.page.getByTestId(n(t,L.FIELD)).clear()}getInput({testId:t}){return this.page.getByTestId(n(t,L.FIELD)).inputValue()}getPlaceholderText({testId:t}){return this.page.getByTestId(n(t,L.FIELD)).getAttribute("placeholder")}isDisabled({testId:t}){return this.page.getByTestId(n(t,L.FIELD)).isDisabled()}}class xt extends At{getLabelText({testId:t}){return this.page.getByTestId(n(t,O.TEXT)).textContent()}hasFieldHelpText({testId:t}){return this.page.getByTestId(n(t,m.CONTAINER)).isVisible()}getFieldHelpText({testId:t}){return this.page.getByTestId(n(t,m.CONTAINER)).textContent()}}class Rt 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,c.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,c.LIST_CONTAINER)).locator("ul > li span").first().textContent()}async isErrorText({testId:t}){return await this.page.getByTestId(n(t,m.TEXT)).count()>0}async isDisabled({testId:t}){return(await this.page.getByTestId(n(t,c.TRIGGER)).locator(".button__container--disabled")).isVisible()}async clearAllOptions({testId:t}){await this.page.getByTestId(n(t,c.ACTION_CLEAR_ALL)).click()}isSelectAllChecked({testId:t}){return this.page.getByTestId(n(t,c.SELECT_ALL)).locator(".checkbox.input").isChecked()}isSelectAllIndeterminate({testId:t}){return this.page.getByTestId(n(t,c.SELECT_ALL)).locator(".icon.indeterminate").isVisible()}async removeChipSelection({testId:t}){await this.page.getByTestId(n(t,c.BUTTON_CLEAR)).click()}getDropdownOptions({testId:t}){return this.page.getByTestId(n(t,c.LIST_CONTAINER)).locator(".list").allTextContents()}async expandTreeNode({testId:t,nodeName:e}){const o=this.page.getByTestId(n(t,c.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 s=this.page.getByTestId(n(t,c.LIST_CONTAINER)).locator(`text=${o}`);if(await s.isVisible())await s.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 Ot=".sortable-item";class Nt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=`[data-testid='${t}-${d.CONTAINER}']`;await this.page.waitForSelector(e)}async isComponentLoaded(t){const e=`[data-testid='${t}-${d.CONTAINER}']`;return this.page.isVisible(e)}async getItems(t){return this.page.getByTestId(n(t,d.CONTAINER)).locator(".sortable-item").allTextContents()}async sortItem(t,e,o){const i=await this.page.getByTestId(n(t,"sortable-list-item")),s=i.nth(e),g=i.nth(o);await s.dragTo(g)}async verifyOrder(t,e){return(await this.getItems(t)).every((i,s)=>i===e[s])}async getListItemLocator({testId:t,item:e,modifier:o}){return this.page.getByTestId(n(t,o)).locator(Ot,{hasText:e})}async selectItem({testId:t,item:e,isLockedItem:o}){const i=o?d.LOCKED_LIST:d.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?d.LOCKED_LIST:d.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?d.LOCKED_LIST:d.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?d.LOCKED_LIST:d.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 s=this.page.locator(".dropdown-list-wrapper");await s.locator("ul.list li",{hasText:i}).click(),await s.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?d.LOCKED_LIST:d.DRAGGABLE_LIST,g=await(await this.getListItemLocator({testId:t,item:e,modifier:i})).locator(".item.drag-allowed").first().boundingBox();if(g){const y=g.x,E=g.y;await this.page.mouse.move(y,E),await this.page.mouse.down(),await this.page.mouse.move(y+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,d.CONTAINER)).locator("ul > li span").first().textContent()}async verifySearchResultDisplayed({testId:t,item:e}){const o=[],i=await this.page.getByTestId(n(t,d.CONTAINER)).all();let s;for(const g of i)s=await g.locator(".child-list span",{hasText:e}).count(),o.push(s>0);return o}async getSelectedItem(t){return this.page.getByTestId(n(t,d.CONTAINER)).locator(".sortable-item--selected").textContent()}}class bt{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=n(t,W.WRAPPER);await this.page.getByTestId(e).waitFor({state:"visible"})}async selectView({view:t,testId:e}){const o=`[text="${t}"]`,i=n(e,W.WRAPPER);await(await this.page.getByTestId(i).locator(o)).click()}}class St{constructor(t){l(this,"page");this.page=t}async waitForComponent({testId:t}){const e=n(t,A.WRAPPER);await this.page.getByTestId(e).waitFor({state:"visible"})}async openDateRangeComponent(t){const e=n(t,A.TRIGGER);await(await this.page.getByTestId(e)).click()}async selectDateRangeMenu({testId:t,option:e}){await this.openDateRangeComponent(t);const o=n(t,A.MENU);await(await this.page.getByTestId(`${o}-${e}`)).click()}async selectSpecificDates({testId:t,startMonthYear:e,startDate:o,endMonthYear:i,endDate:s}){await this.openDateRangeComponent(t);const g=await this.goToStartMonthYear(e);await(await this.getDayElement(g,o)).click();const E=await this.goToEndMonthYear(i);await(await this.getDayElement(E,s)).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 g of i)if(await g.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 g of i)if(await g.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,A.ACTION_APPLY);await(await this.page.getByTestId(e)).click()}async clickOnCancel(t){const e=n(t,A.ACTION_CANCEL);await(await this.page.getByTestId(e)).click()}async getDateRangeLabel(t){const e=n(t,A.TRIGGER);return(await this.page.getByTestId(e)).textContent()}createRangeLabel({startMonthYear:t,startDate:e,endMonthYear:o,endDate:i}){const s={January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},[g,y]=t.split(" "),E=s[g],[B,_]=o.split(" "),D=s[B];return`${E} ${e}, ${y} - ${D} ${i}, ${_}`}calculateDaysBetweenDates(t){const[e,o]=t.split(" - ");function i(B){const[_,D]=B.split(", "),[k,J]=_.split(" "),v={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11}[k];if(v===void 0)throw new Error(`Invalid month: ${k}`);return new Date(parseInt(D),v,parseInt(J))}const s=i(e),E=(i(o).getTime()-s.getTime())/(1e3*60*60*24);return Math.floor(E+1)}}const tt=".header-texts .header-row",et=".container .font-body-2",Pt=".font-caption",at=".legend__list li",nt=`${at} ${et}`,_t="chart-legend-search-clear",Dt=".checkboxes svg.checked";class kt{constructor(t){l(this,"page");l(this,"inputComponent");l(this,"dropdownComponent");this.page=t,this.inputComponent=new P(t),this.dropdownComponent=new V(t)}async waitForComponent(t){const e=n(t,u.CONTAINER);await this.page.getByTestId(e).waitFor({state:"visible"})}async getChartHeaderData({testId:t,chartTitle:e,extraChartIndex:o}){var i,s,g;try{const y=o!==""?`${n(t,u.EXTRA_CHART)}-${o}-${u.HEADER}`:n(t,u.HEADER),E=o!==""?`${n(t,u.EXTRA_CHART)}-${o}-${u.TREND}`:n(t,u.TREND),B=await this.page.getByTestId(y),_=B.locator(tt,{hasText:e}),D=B.locator(tt).nth(1),k=B.getByTestId(E),J=((i=await _.textContent())==null?void 0:i.trim().replace(":",""))||null,ot=((s=await D.textContent())==null?void 0:s.trim())||null,v=((g=await k.textContent())==null?void 0:g.trim())||null,Ft=await k.evaluate($t=>{const K=$t.className;return K.includes("up")?"up":K.includes("down")?"down":K.includes("neutral")?"neutral":"unknown"});return{title:J,value:ot,trend:v,trendDirection:Ft}}catch(y){return console.error(`Failed to retrieve chart header data for testId: ${t}, chartTitle: ${e}`,y),null}}async getLegend(t){return this.page.getByTestId(`${n(t,u.LEGEND)}-${u.LEGEND_CONTAINER}`)}async selectLegendItem({testId:t,itemToSelect:e}){const i=await(await this.getLegend(t)).locator(nt).all();for(const s of i)await s.textContent()===e&&await s.click()}async clearLegendSearch(t){const e=n(t,_t);await this.page.getByTestId(e).click()}async searchAndSelectLegendItems({testId:t,itemsToSelect:e}){const o=n(t,u.LEGEND);for(const i of e)await this.inputComponent.addInput({testId:o,text:i}),await this.selectLegendItem({testId:t,itemToSelect:i}),await this.clearLegendSearch(t)}async getLegendItems(t){const e=[],i=await(await this.getLegend(t)).locator(nt).all();for(const s of i){const g=await s.textContent();e.push(g)}return e}async getSelectedItems(t){const e=[],i=await(await this.getLegend(t)).locator(at).all();for(const s of i)if(await s.locator(Dt).count()>0){const y=await s.locator(et).textContent(),E=await s.locator(Pt).textContent();e.push({itemLabel:y,subLabel:E})}return e}async sortBy({testId:t,sortType:e}){const o=`${n(t,u.LEGEND)}-chart-legend-sort`;await this.page.getByTestId(o).click(),await this.dropdownComponent.selectDropdownOptionByName({testId:o,name:e,shouldOpen:!1})}async getSortOptions(t){const e=`${n(t,u.LEGEND)}-chart-legend-sort`,o={testId:e};await this.page.getByTestId(e).click();const i=await this.dropdownComponent.getDropdownOptionsV2(o);return await this.page.getByTestId(e).click(),i}}r.AlertComponent=Lt,r.AppHeaderComponent=Bt,r.BannerComponent=ct,r.ButtonComponent=Z,r.ComponentBasePage=rt,r.DateRangeComponent=St,r.DialogComponent=lt,r.DropdownComponent=V,r.DropdownComponentV3=pt,r.FieldHelpTextComponent=H,r.FieldLabelComponent=b,r.FormCardComponent=mt,r.FormRowComponent=Ct,r.IncludeExcludeComponent=gt,r.InlineCopyComponent=M,r.InputsComponent=Tt,r.MultiBarComponent=wt,r.MultiChartComponent=kt,r.SearchComponent=It,r.SnackbarComponent=Et,r.SortableListComponent=Nt,r.SwitchComponent=bt,r.TableComponent=yt,r.TabsComponent=ht,r.TextAreaComponent=xt,r.TooltipComponent=dt,r.TreeDropdownComponent=Rt,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const defaultTestId = "multi-chart-default";
|
|
2
|
+
export declare const multiChartStoryId = "v4-components-chart-multichart--default";
|
|
3
|
+
export declare const loadedPageSelector = ".chart-container";
|
|
4
|
+
export declare const CHART_TITLE_SELECTOR = ".header-texts .header-row";
|
|
5
|
+
export declare const EXPECTED_REVENUE_HEADER_DATA: {
|
|
6
|
+
title: string;
|
|
7
|
+
value: string;
|
|
8
|
+
trend: string;
|
|
9
|
+
trendDirection: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const EXPECTED_DAU_HEADER_DATA: {
|
|
12
|
+
title: string;
|
|
13
|
+
value: string;
|
|
14
|
+
trend: string;
|
|
15
|
+
trendDirection: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const EXPECTED_IMPRESSIONS_HEADER_DATA: {
|
|
18
|
+
title: string;
|
|
19
|
+
value: string;
|
|
20
|
+
trend: string;
|
|
21
|
+
trendDirection: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const EXPECTED_SORT_OPTIONS: string[];
|
|
24
|
+
export declare const LEGEND_MAIN_TITLE_SELECTOR = ".container .font-body-2";
|
|
25
|
+
export declare const LEGEND_SUB_TITLE_SELECTOR = ".font-caption";
|
|
26
|
+
export declare const LEGEND_LIST_SELECTOR = ".legend__list li";
|
|
27
|
+
export declare const LEGEND_OPTION_MAIN_TITLE_SELECTOR = ".legend__list li .container .font-body-2";
|
|
28
|
+
export declare const CLEAR_SEARCH_CHART_MODIFIER = "chart-legend-search-clear";
|
|
29
|
+
export declare const CHECKBOX_SELECTOR = ".checkboxes svg.checked";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
import { ChartHeaderData, GetChartHeaderDataArgs, LegendItemText } from './types';
|
|
3
|
+
import { InputComponent } from '../../inputs/input-v3/input-component';
|
|
4
|
+
import { DropdownComponent } from '../../dropdown/dropdown-v4/dropdown-component';
|
|
5
|
+
export declare class MultiChartComponent {
|
|
6
|
+
readonly page: Page;
|
|
7
|
+
readonly inputComponent: InputComponent;
|
|
8
|
+
readonly dropdownComponent: DropdownComponent;
|
|
9
|
+
constructor(page: any);
|
|
10
|
+
waitForComponent(testId: string): Promise<void>;
|
|
11
|
+
getChartHeaderData({ testId, chartTitle, extraChartIndex, }: GetChartHeaderDataArgs): Promise<ChartHeaderData>;
|
|
12
|
+
getLegend(testId: string): Promise<Locator>;
|
|
13
|
+
selectLegendItem({ testId, itemToSelect, }: {
|
|
14
|
+
testId: string;
|
|
15
|
+
itemToSelect: string;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
clearLegendSearch(testId: string): Promise<void>;
|
|
18
|
+
searchAndSelectLegendItems({ testId, itemsToSelect, }: {
|
|
19
|
+
testId: string;
|
|
20
|
+
itemsToSelect: string[];
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
getLegendItems(testId: string): Promise<string[]>;
|
|
23
|
+
getSelectedItems(testId: string): Promise<LegendItemText[]>;
|
|
24
|
+
sortBy({ testId, sortType }: {
|
|
25
|
+
testId: string;
|
|
26
|
+
sortType: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
getSortOptions(testId: string): Promise<any[]>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentBasePage } from '../../base-page/component-base-page.ts';
|
|
2
|
+
import { MultiChartComponent } from './multi-chart-component.ts';
|
|
3
|
+
import { Page } from '@playwright/test';
|
|
4
|
+
import { LegendItemText } from './types.ts';
|
|
5
|
+
export declare class MultiChartPage extends ComponentBasePage {
|
|
6
|
+
readonly component: MultiChartComponent;
|
|
7
|
+
constructor(page: Page);
|
|
8
|
+
waitForComponent(): Promise<void>;
|
|
9
|
+
getChartHeaderData({ chartTitle, extraChartIndex, }: {
|
|
10
|
+
chartTitle: string;
|
|
11
|
+
extraChartIndex?: number | '';
|
|
12
|
+
}): Promise<import("./types.ts").ChartHeaderData>;
|
|
13
|
+
getLegendItems(): Promise<string[]>;
|
|
14
|
+
selectLegendItem(item: string): Promise<void>;
|
|
15
|
+
searchAndSelectLegendItems(itemsToSelect: string[]): Promise<void>;
|
|
16
|
+
getSelectedItems(): Promise<LegendItemText[]>;
|
|
17
|
+
sortBy(sortType: string): Promise<void>;
|
|
18
|
+
getSortOptions(): Promise<string[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ChartHeaderData = {
|
|
2
|
+
title: string;
|
|
3
|
+
value: string;
|
|
4
|
+
trend: string;
|
|
5
|
+
trendDirection: string;
|
|
6
|
+
};
|
|
7
|
+
export type GetChartHeaderDataArgs = {
|
|
8
|
+
testId: string;
|
|
9
|
+
chartTitle: string;
|
|
10
|
+
extraChartIndex?: number | '';
|
|
11
|
+
};
|
|
12
|
+
export type LegendItemText = {
|
|
13
|
+
itemLabel: string;
|
|
14
|
+
subLabel: string;
|
|
15
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -12,10 +12,11 @@ export declare class BaseDropdownComponent {
|
|
|
12
12
|
testId: string;
|
|
13
13
|
}): Promise<void>;
|
|
14
14
|
selectDropdownOptionByName({ testId, name, shouldOpen, }: SelectionByName): Promise<void>;
|
|
15
|
+
selectDropdownOptionByNameV2({ testId, name, shouldOpen, }: SelectionByName): Promise<void>;
|
|
15
16
|
clearAllOptions({ testId }: {
|
|
16
17
|
testId: string;
|
|
17
18
|
}): Promise<void>;
|
|
18
|
-
selectMultipleItemsByIndex({ testId, itemsToSelect }: SelectMultiple): Promise<void>;
|
|
19
|
+
selectMultipleItemsByIndex({ testId, itemsToSelect, shouldOpen, }: SelectMultiple): Promise<void>;
|
|
19
20
|
selectMultipleItemsByName({ testId, itemsToSelect, shouldClearAll, }: SelectMultipleByName): Promise<void>;
|
|
20
21
|
clickOnApply({ testId }: {
|
|
21
22
|
testId: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Page } from '@playwright/test';
|
|
2
|
+
import { ViewOption } from './types.ts';
|
|
3
|
+
export declare class SwitchComponent {
|
|
4
|
+
readonly page: Page;
|
|
5
|
+
constructor(page: Page);
|
|
6
|
+
waitForComponent({ testId }: {
|
|
7
|
+
testId: string;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
selectView({ view, testId }: {
|
|
10
|
+
view: ViewOption;
|
|
11
|
+
testId: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentBasePage } from '../base-page/component-base-page.ts';
|
|
2
|
+
import { SwitchComponent } from './switch-component.ts';
|
|
3
|
+
import { Page } from '@playwright/test';
|
|
4
|
+
import { ViewOption } from './types.ts';
|
|
5
|
+
export declare class SwitchPage extends ComponentBasePage {
|
|
6
|
+
readonly component: SwitchComponent;
|
|
7
|
+
constructor(page: Page);
|
|
8
|
+
waitForComponent(): Promise<void>;
|
|
9
|
+
selectView(view: ViewOption): Promise<void>;
|
|
10
|
+
}
|
package/tests/index.d.ts
CHANGED
|
@@ -28,3 +28,6 @@ export * from './components/alert/alert-component.ts';
|
|
|
28
28
|
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
|
+
export * from './components/switch/switch-component.ts';
|
|
32
|
+
export * from './components/date-range/date-range-component.ts';
|
|
33
|
+
export * from './components/chart/multiChart/multi-chart-component.ts';
|
package/tests/testids/index.d.ts
CHANGED
|
@@ -29,10 +29,26 @@ 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
|
+
}
|
|
36
|
+
export declare enum ColumnConfiguratorTestIdModifiers {
|
|
37
|
+
WRAPPER = "column-configurator-wrapper",
|
|
38
|
+
SECTION_HEADER = "column-configurator-section-header",
|
|
39
|
+
ADD_BUTTON = "column-configurator-add-button",
|
|
40
|
+
DROPDOWN = "column-configurator-dropdown",
|
|
41
|
+
LIST = "column-configurator-list",
|
|
42
|
+
REMOVE_BUTTON = "column-configurator-remove-button"
|
|
43
|
+
}
|
|
32
44
|
export declare enum BannerTestIdModifiers {
|
|
33
45
|
WRAPPER = "banner-wrapper",
|
|
34
46
|
CONTENT = "banner-content"
|
|
35
47
|
}
|
|
48
|
+
export declare enum LinkTestIdModifiers {
|
|
49
|
+
WRAPPER = "link-wrapper",
|
|
50
|
+
ICON = "link-icon"
|
|
51
|
+
}
|
|
36
52
|
export declare enum AlertTestIdModifiers {
|
|
37
53
|
WRAPPER = "alert-wrapper",
|
|
38
54
|
TITLE = "alert-title",
|
|
@@ -60,7 +76,14 @@ export declare enum InputTestIdModifiers {
|
|
|
60
76
|
LABEL_TEXT = "input-label-text",
|
|
61
77
|
FIELD = "input-field",
|
|
62
78
|
EXTRA_TEXT = "input-extra-text",
|
|
63
|
-
TOGGLE_PASSWORD = "input-toggle-password-icon"
|
|
79
|
+
TOGGLE_PASSWORD = "input-toggle-password-icon",
|
|
80
|
+
CLEAR_BUTTON = "input-clear-button",
|
|
81
|
+
LOADING = "input-loading"
|
|
82
|
+
}
|
|
83
|
+
export declare enum TagsFieldTestIdModifiers {
|
|
84
|
+
WRAPPER = "tags-field-wrapper",
|
|
85
|
+
FIELD = "tags-field-field",
|
|
86
|
+
CHIP = "tags-field-chip"
|
|
64
87
|
}
|
|
65
88
|
export declare enum CheckboxTestIdModifiers {
|
|
66
89
|
WRAPPER = "cb-wrapper",
|
|
@@ -230,3 +253,26 @@ export declare enum ToggleButtonGroupABTestIdModifiers {
|
|
|
230
253
|
POPOVER_TRIGGER = "ab-group-popover-trigger",
|
|
231
254
|
POPOVER_AB = "ab-group-popover"
|
|
232
255
|
}
|
|
256
|
+
export declare enum ChartTestIdModifiers {
|
|
257
|
+
CONTAINER = "chart-container",
|
|
258
|
+
HEADER = "chart-header",
|
|
259
|
+
TREND = "chart-trend",
|
|
260
|
+
TYPE_SWITCHER = "chart-type-switcher",
|
|
261
|
+
LEGEND = "chart-legend",
|
|
262
|
+
LEGEND_CONTAINER = "chart-legend-container",
|
|
263
|
+
LEGEND_SORT = "chart-legend-sort",
|
|
264
|
+
EXTRA_CHART = "chart-extra-chart",
|
|
265
|
+
LOADER = "chart-loader"
|
|
266
|
+
}
|
|
267
|
+
export declare enum ChartSettingsHeaderTestIdModifiers {
|
|
268
|
+
CONTAINER = "chart-settings-header-container",
|
|
269
|
+
TYPE_DROPDOWN = "chart-settings-header-type-dropdown"
|
|
270
|
+
}
|
|
271
|
+
export declare enum ChartTooltipTestIdModifiers {
|
|
272
|
+
CONTAINER = "chart-tooltip-container"
|
|
273
|
+
}
|
|
274
|
+
export declare enum EmptyStateTestIdModifiers {
|
|
275
|
+
CONTAINER = "empty-state-container",
|
|
276
|
+
TITLE = "empty-state-title",
|
|
277
|
+
SUBTITLE = "empty-state-subtitle"
|
|
278
|
+
}
|