2023-06-15 13:21:11 +00:00
|
|
|
import { ObjectsRegistry } from "../Objects/Registry";
|
|
|
|
|
|
2023-02-10 06:11:35 +00:00
|
|
|
// Edit mode modal
|
|
|
|
|
export class Templates {
|
2023-06-15 13:21:11 +00:00
|
|
|
private agHelper = ObjectsRegistry.AggregateHelper;
|
|
|
|
|
private homePage = ObjectsRegistry.HomePage;
|
2023-02-10 06:11:35 +00:00
|
|
|
public locators = {
|
2023-06-15 13:21:11 +00:00
|
|
|
_templatesTab: ".t--templates-tab",
|
2023-02-10 06:11:35 +00:00
|
|
|
_forkApp: ".t--fork-template",
|
2023-05-19 18:37:06 +00:00
|
|
|
_templateCard: "[data-testid='template-card']",
|
2023-06-08 12:58:49 +00:00
|
|
|
_closeTemplateDialogBoxBtn: ".ads-v2-modal__content-header-close-button",
|
2023-06-15 13:21:11 +00:00
|
|
|
_requestForTemplateBtn: "span:contains('Request for a template')",
|
2023-02-10 06:11:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ForkTemplateByName(name: string) {
|
|
|
|
|
cy.contains(this.locators._templateCard, name)
|
|
|
|
|
.find(this.locators._forkApp)
|
|
|
|
|
.click();
|
|
|
|
|
}
|
2023-06-08 12:58:49 +00:00
|
|
|
|
|
|
|
|
GetTemplatesCardsList() {
|
|
|
|
|
return cy.get(this.locators._templateCard);
|
|
|
|
|
}
|
2023-06-15 13:21:11 +00:00
|
|
|
|
|
|
|
|
public SwitchToTemplatesTab() {
|
|
|
|
|
this.homePage.NavigateToHome();
|
|
|
|
|
this.agHelper.GetNClick(this.locators._templatesTab);
|
|
|
|
|
this.agHelper.AssertElementVisible(
|
|
|
|
|
this.locators._requestForTemplateBtn,
|
|
|
|
|
0,
|
|
|
|
|
30000,
|
|
|
|
|
); //giving more time here for templates page to fully load, since there is no intercept validation for same
|
|
|
|
|
}
|
2023-02-10 06:11:35 +00:00
|
|
|
}
|