## Description **This PR does the below improvements:** - Handles initial empty error toast- with cy.LogOut() - Calling cy.LoginFromAPI() per need only - to improve execution time - Update agHelper.UpdateCodeInput() - Added waitForNetworkCall for AsserHelper methods to only get api call & validate - Added gitSync.AuthorizeKeyToGitea() - to validate keyGenerate success - Adding validationg for 'Unable to import application in workspace' - cy.CreateNewAppInNewWorkspace() improved - agHelper.RemoveUIElement() created to handle tooltip, toast, evaluatedpopup & removed duplicates - cy.merge() improved to call assertHelper - assertHelper.AssertNetworkStatus() to handle both array & individual status checks & return actual responseCode - createBranch & generatedKey intercepts added to git operation validations - homePage.AssertApplication() created - Removed cy.Logout() & Login improved - brings down total run time to less than 1 hr from 1+ hrs - entityExplorer.NavigateToSwitcher() improved to check status - dataSources.ValidateDSDeletion() improved to handle one of array toast for array value also - assertHelper.WaitForNetworkCall() improved to wait & return latest request - Private methods processNetworkStatus() & processNetworkResponseData() created **Also flaky fixes below:** - ServerSide/QueryPane/S3_2_spec.ts - Adding sleep for CI flaky behaviour - Trial fix for cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts - GitWithJSLibrary/GitwithCustomJSLibrary_spec.js - Handling Import failure at various points in the flow - ExplorerTests/Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js - ClientSide/JSLibrary/Library_spec.ts - asserting success import - /OtherUIFeatures/ApplicationURL_spec.js - using cy.url() - /ClientSide/Templates/Fork_Template_spec.js - ServerSide/Postgres_DataTypes/Binary_Spec.ts & /Postgres_DataTypes/Json_Spec.ts - Adding sleep for CI flaky behaviour - ClientSide/Widgets/List/List4_2_spec.js - /Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after Cypress tests were reviewed
88 lines
2.6 KiB
TypeScript
88 lines
2.6 KiB
TypeScript
import { ObjectsRegistry } from "../Objects/Registry";
|
|
|
|
export class LibraryInstaller {
|
|
private _aggregateHelper = ObjectsRegistry.AggregateHelper;
|
|
private _installer_trigger_locator =
|
|
".t--entity-add-btn.group.libraries button";
|
|
private _installer_close_locator =
|
|
".ads-v2-popover__body-header .ads-v2-icon";
|
|
|
|
private getLibraryLocatorInExplorer(libraryName: string) {
|
|
return `.t--installed-library-${libraryName}`;
|
|
}
|
|
|
|
private getLibraryCardLocator(libraryName: string) {
|
|
return `div.library-card.t--${libraryName}`;
|
|
}
|
|
|
|
private libraryURLLocator = "[data-testid='library-url']";
|
|
private installBtnLocator = "[data-testid='install-library-btn']";
|
|
|
|
public OpenInstaller(force = false) {
|
|
this._aggregateHelper.GetNClick(this._installer_trigger_locator, 0, force);
|
|
}
|
|
|
|
public CloseInstaller() {
|
|
this._aggregateHelper.GetNClick(this._installer_close_locator);
|
|
}
|
|
|
|
public InstallLibrary(
|
|
libraryName: string,
|
|
accessor: string,
|
|
checkIfSuccessful = true,
|
|
) {
|
|
cy.get(this.getLibraryCardLocator(libraryName))
|
|
.find(".t--download")
|
|
.click();
|
|
if (checkIfSuccessful) this.assertInstall(libraryName, accessor);
|
|
}
|
|
|
|
public InstallLibraryViaURL(
|
|
url: string,
|
|
accessor: string,
|
|
checkIfSuccessful = true,
|
|
) {
|
|
this._aggregateHelper.TypeText(this.libraryURLLocator, url);
|
|
this._aggregateHelper.GetNClick(this.installBtnLocator);
|
|
if (checkIfSuccessful) {
|
|
this._aggregateHelper.AssertContains(
|
|
`Installation Successful. You can access the library via ${accessor}`,
|
|
);
|
|
}
|
|
}
|
|
|
|
private assertInstall(libraryName: string, accessor: string) {
|
|
this._aggregateHelper.AssertContains(
|
|
`Installation Successful. You can access the library via ${accessor}`,
|
|
);
|
|
cy.get(this.getLibraryCardLocator(libraryName))
|
|
.find(".installed")
|
|
.should("be.visible");
|
|
this._aggregateHelper.AssertElementExist(
|
|
this.getLibraryLocatorInExplorer(libraryName),
|
|
);
|
|
}
|
|
|
|
public uninstallLibrary(libraryName: string) {
|
|
cy.get(this.getLibraryLocatorInExplorer(libraryName))
|
|
.realHover()
|
|
.find(".t--uninstall-library")
|
|
.click();
|
|
}
|
|
|
|
public assertUnInstall(libraryName: string) {
|
|
this._aggregateHelper.WaitUntilToastDisappear(
|
|
`${libraryName} is uninstalled successfully.`,
|
|
);
|
|
this._aggregateHelper.AssertElementAbsence(
|
|
this.getLibraryLocatorInExplorer(libraryName),
|
|
);
|
|
}
|
|
|
|
public AssertLibraryinExplorer(libraryName: string) {
|
|
this._aggregateHelper.AssertElementExist(
|
|
this.getLibraryLocatorInExplorer(libraryName),
|
|
);
|
|
}
|
|
}
|