PromucFlow_constructor/app/client/cypress/support/Pages/Tabs.ts
Preet Sidhu 0cc716c2a5
chore: add cypress tests for auto height scenarios (#23616)
## Description

Added specs:
1. AutoHeight_Container_spec.js
2. AutoHeight_Form_spec.js
3. AutoHeight_Modal_spec.js
4. AutoHeight_Tabs_spec.js

#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

## Testing

#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] Jest
- [x] Cypress

---------

Co-authored-by: rahulramesha <rahul@appsmith.com>
2023-07-10 10:02:42 +05:30

32 lines
1012 B
TypeScript

import { ObjectsRegistry } from "../Objects/Registry";
export class Tabs {
public agHelper = ObjectsRegistry.AggregateHelper;
public propPane = ObjectsRegistry.PropertyPane;
private _tabSelector = (tabId: string): string => `.t--tabid-${tabId}`;
private _tabsWidgetNameSelector = (widgetName: string): string =>
`.t--widget-${widgetName?.toLowerCase()}`;
private _showTabsProperty = "showtabs";
public toggleShowTabHeader(showTabs = true, selector: string) {
this.agHelper.GetNClick(selector).then(() => {
this.propPane.TogglePropertyState(
this._showTabsProperty,
showTabs ? "On" : "Off",
);
this.agHelper.Sleep();
});
}
public getTabSelectorByWidgetName(widgetName = "Tabs1", tabId = "tab1") {
return `${this._tabsWidgetNameSelector(widgetName)} ${this._tabSelector(
tabId,
)}`;
}
public getWidgetSelectorByNameComponent(widgetName = "Tabs1") {
return `${this._tabsWidgetNameSelector(widgetName)} .t--widget-name`;
}
}