Skip to content

Commit

Permalink
Fix autoheight tests timeout (datalens-tech#505)
Browse files Browse the repository at this point in the history
* check disabled state on tab click

* cleanup comments
  • Loading branch information
flops authored Jan 22, 2024
1 parent d97d320 commit 0cc27fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/page-objects/dashboard/DashboardPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class DashboardPage extends BasePage {
tabsList: '.gc-adaptive-tabs__tabs-list',
tabItem: '.gc-adaptive-tabs__tab',
tabItemActive: '.gc-adaptive-tabs__tab_active',
tabItemDisabled: '.gc-adaptive-tabs__tab_disabled',
tabContainer: '.gc-adaptive-tabs__tab-container',
selectControl: '.yc-select-control',
/** @deprecated instead use selectItems */
Expand All @@ -107,6 +108,7 @@ class DashboardPage extends BasePage {
selectItems: '.g-select-list',
selectItemsMobile: '.g-select-list_mobile',
selectItemTitle: '.g-select-list__option',
selectItemTitleDisabled: '.g-select-list__option_disabled',

radioManualControl: DialogControlQa.radioSourceType,
inputNameControl: 'control-name-input',
Expand Down Expand Up @@ -921,7 +923,7 @@ class DashboardPage extends BasePage {

if (fullTab) {
const tab = await fullTab.waitForSelector(
`${DashboardPage.selectors.tabItem} >> text=${tabName}`,
`${DashboardPage.selectors.tabItem}:not(${DashboardPage.selectors.tabItemDisabled}) >> text=${tabName}`,
);
await tab.click();
return;
Expand All @@ -935,7 +937,7 @@ class DashboardPage extends BasePage {
if (shortTab) {
await shortTab.click();
const tab = await this.page.waitForSelector(
`${DashboardPage.selectors.selectItems} ${DashboardPage.selectors.selectItemTitle} >> text=${tabName}`,
`${DashboardPage.selectors.selectItems} ${DashboardPage.selectors.selectItemTitle}:not(${DashboardPage.selectors.selectItemTitleDisabled}) >> text=${tabName}`,
);
await tab.click();
return;
Expand Down

0 comments on commit 0cc27fa

Please sign in to comment.