2023-03-27 09:36:03 +00:00
|
|
|
import { ObjectsRegistry } from "../Objects/Registry";
|
2024-01-25 13:41:48 +00:00
|
|
|
import { featureFlagIntercept } from "../Objects/FeatureFlags";
|
2023-03-27 09:36:03 +00:00
|
|
|
|
|
|
|
|
export class AdminSettings {
|
|
|
|
|
public agHelper = ObjectsRegistry.AggregateHelper;
|
|
|
|
|
public locator = ObjectsRegistry.CommonLocators;
|
|
|
|
|
public homePage = ObjectsRegistry.HomePage;
|
2023-10-10 09:24:28 +00:00
|
|
|
public assertHelper = ObjectsRegistry.AssertHelper;
|
2023-03-27 09:36:03 +00:00
|
|
|
|
2024-01-25 13:41:48 +00:00
|
|
|
public _adminSettingsBtn = ".admin-settings-menu-option";
|
2023-03-27 09:36:03 +00:00
|
|
|
private _settingsList = ".t--settings-category-list";
|
|
|
|
|
public _usersTab = ".t--settings-category-users";
|
|
|
|
|
public _roles = (user: string) =>
|
|
|
|
|
"//span[contains(text(), '" +
|
|
|
|
|
user +
|
2023-10-10 09:24:28 +00:00
|
|
|
"')]/parent::div/parent::span/parent::a/parent::td/following-sibling::td[1]";
|
|
|
|
|
public _instanceName = '[name="instanceName"]';
|
2024-01-25 13:41:48 +00:00
|
|
|
public rolesTab = ".t--settings-category-roles";
|
2023-03-27 09:36:03 +00:00
|
|
|
|
2024-01-25 13:41:48 +00:00
|
|
|
public NavigateToAdminSettings(toNavigateToHome = true) {
|
|
|
|
|
toNavigateToHome && this.homePage.NavigateToHome();
|
|
|
|
|
this.agHelper.AssertElementVisibility(this._adminSettingsBtn);
|
2023-03-27 09:36:03 +00:00
|
|
|
this.agHelper.GetNClick(this._adminSettingsBtn);
|
2023-10-10 09:24:28 +00:00
|
|
|
this.assertHelper.AssertNetworkStatus("getEnvVariables");
|
2023-08-10 07:06:03 +00:00
|
|
|
this.agHelper.AssertElementVisibility(this._settingsList);
|
2023-03-27 09:36:03 +00:00
|
|
|
}
|
2024-01-25 13:41:48 +00:00
|
|
|
|
|
|
|
|
public EnableGAC(
|
|
|
|
|
toNavigateToHome = true,
|
|
|
|
|
toNavigateBackToHome = true,
|
|
|
|
|
methodType: "adminSettings" | "home" = "adminSettings",
|
|
|
|
|
) {
|
|
|
|
|
switch (methodType) {
|
|
|
|
|
case "adminSettings":
|
|
|
|
|
this.NavigateToAdminSettings(toNavigateToHome);
|
|
|
|
|
this.enableGACFeatureFlag();
|
|
|
|
|
this.assertHelper.AssertDocumentReady();
|
|
|
|
|
this.agHelper.WaitUntilEleAppear(this.rolesTab);
|
2024-02-01 11:12:53 +00:00
|
|
|
this.agHelper.AssertElementExist(this.rolesTab);
|
|
|
|
|
this.agHelper.AssertElementVisibility(this.rolesTab);
|
2024-01-25 13:41:48 +00:00
|
|
|
toNavigateBackToHome && this.homePage.NavigateToHome();
|
|
|
|
|
break;
|
|
|
|
|
case "home":
|
|
|
|
|
toNavigateToHome && this.homePage.NavigateToHome();
|
|
|
|
|
this.enableGACFeatureFlag();
|
|
|
|
|
this.assertHelper.AssertDocumentReady();
|
|
|
|
|
this.agHelper.AssertElementExist(this.homePage._homePageContainer);
|
|
|
|
|
this.agHelper.AssertElementVisibility(this.homePage._homePageContainer);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private enableGACFeatureFlag() {
|
|
|
|
|
featureFlagIntercept({ license_gac_enabled: true });
|
|
|
|
|
}
|
2023-03-27 09:36:03 +00:00
|
|
|
}
|