test: Cypress | App level Import test (non-Gsheet) + CI Stabilize (#27683)

## Description
- This PR includes script for App level import for ds - MySql (non
Gsheet)
- Fixes flaky Replay_Editor_spec.js

#### Type of change
- Script update (non-breaking change which fixes an issue)

## Testing

#### How Has This Been Tested?
- [X] Cypress

## Checklist:
#### QA activity:
- [X] Added `Test Plan Approved` label after Cypress tests were reviewed
This commit is contained in:
Aishwarya-U-R 2023-09-28 17:45:21 +05:30 committed by GitHub
parent 0e00302317
commit c3d546d434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 68 additions and 18 deletions

View File

@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
job: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
job: [0]
# Service containers to run with this job. Required for running tests
services:
@ -315,7 +315,7 @@ jobs:
if [[ ${{ inputs.pr }} -ne 0 ]]; then
echo "COMMIT_INFO_MESSAGE=${{ env.COMMIT_INFO_MESSAGE }}" >> $GITHUB_ENV
else
if [[ '${{env.EVENT_COMMITS}}' == 'null' ]]; then
if [[ '${{env.EVENT_COMMITS}}' == 'null' ]]; then
echo "COMMIT_INFO_MESSAGE=${{ github.event_name }} by ${{ env.COMMIT_INFO_AUTHOR }}" >> $GITHUB_ENV
else
echo "COMMIT_INFO_MESSAGE=$(echo \"${{ env.EVENT_COMMITS }}\" | awk -F '\\\\n' '{print $1}' | sed 's/^\"//')" >> $GITHUB_ENV

View File

@ -3,7 +3,6 @@ import {
dataSources,
homePage,
} from "../../../../support/Objects/ObjectsCore";
import reconnectDSLocator from "../../../../locators/ReconnectLocators.js";
let workspaceId: string;

View File

@ -154,6 +154,7 @@ describe("Undo/Redo functionality", function () {
cy.get("body").click(0, 0);
cy.get("body").type(`{${modifierKey}}z`);
cy.get("input[name='url']").should("have.value", "");
cy.get("body").type(`{${modifierKey}}z`);
cy.get("input[name='headers[0].key']").should("have.value", "");
cy.get("body").click(0, 0);
cy.get("body").type(`{${modifierKey}}{shift}z`);

View File

@ -0,0 +1,37 @@
import {
agHelper,
appSettings,
homePage,
dataSources,
jsEditor,
deployMode,
locators,
draggableWidgets,
} from "../../../../support/Objects/ObjectsCore";
describe("App level import with Datasource", () => {
before(() => {
homePage.CreateNewWorkspace("AppLevelImport", true);
homePage.CreateAppInWorkspace("AppLevelImport");
});
//this tests coveres Applevel import for MySql, Gsheet is covered in Gsheet folder
it("1. Bug #26024 - Import an app at App Level with Datasource - MySql", () => {
appSettings.OpenAppSettings();
appSettings.GoToImport();
agHelper.ClickButton("Import");
homePage.ImportApp("ImportApps/JSOnLoadImport.json", "JSOnLoadTest", true);
cy.wait("@importNewApplication").then(() => {
agHelper.Sleep();
dataSources.ReconnectSingleDSNAssert("MySQL-Ds", "MySQL");
});
jsEditor.ConfirmationClick("Yes");
agHelper.ClickButton("Got it");
deployMode.DeployApp();
jsEditor.ConfirmationClick("Yes");
agHelper.AssertElementLength(
locators._widgetInDeployed(draggableWidgets.IMAGE),
10,
);
});
});

View File

@ -195,7 +195,7 @@ describe("Validate Oracle DS", () => {
TO_DATE('2020-01-15', 'YYYY-MM-DD'),
TO_DATE('{{DatePicker1.formattedDate}}', 'YYYY-MM-DD'),
'This aircraft is used for domestic flights.')`;
entityExplorer.ActionTemplateMenuByEntityName(guid.toUpperCase(), "SELECT");
entityExplorer.ActionTemplateMenuByEntityName(guid.toUpperCase(), "Select");
dataSources.RunQuery();
agHelper
.GetText(dataSources._noRecordFound)

View File

@ -14,7 +14,8 @@ describe(
let placeholderText =
'{\n "name": {{nameInput.text}},\n "dob": {{dobPicker.formattedDate}},\n "gender": {{genderSelect.selectedOptionValue}} \n}';
//Skiiping due to open bug #18035: Should the Save button be renamed as "Save and Authorise" in case of Google sheets for datasource discard popup?
//Skiiping due to open bug #18035: Should the Save button be renamed as "Save and Authorise" in case of Google sheets for datasource discard popup? -
//Bug #18035: Bug is to be taken in ds experience activation phase
it.skip("1. Bug: 16391 - Google Sheets DS, placeholder objects keys should have quotes", function () {
// create new Google Sheets datasource
dataSources.NavigateToDSCreateNew();

View File

@ -10,6 +10,7 @@ export class AppSettings {
_generalSettingsHeader: "#t--general-settings-header",
_embedSettingsHeader: "#t--share-embed-settings",
_navigationSettingsTab: "#t--navigation-settings-header",
_importHeader: "#t--update-via-import",
_navigationSettings: {
_showNavbar: "#t--navigation-settings-show-navbar",
_showSignIn: "#t--navigation-settings-show-sign-in",
@ -87,6 +88,10 @@ export class AppSettings {
this.agHelper.GetNClick(this.locators._embedSettingsHeader);
}
public GoToImport() {
this.agHelper.GetNClick(this.locators._importHeader);
}
public GoToPageSettings(pageName: string) {
this.agHelper.GetNClick(this.locators._getPageSettingsHeader(pageName));
}

View File

@ -1,4 +1,3 @@
import { propPane } from "../../Objects/ObjectsCore";
import { ObjectsRegistry } from "../../Objects/Registry";
export class EmbedSettings {

View File

@ -796,9 +796,9 @@ export class DataSources {
);
}
public TestSaveDatasource(expectedRes = true, isForkModal = false) {
public TestSaveDatasource(expectedRes = true, isReconnectModal = false) {
this.TestDatasource(expectedRes);
this.SaveDatasource(isForkModal);
this.SaveDatasource(isReconnectModal);
}
public TestDatasource(expectedRes = true) {
@ -810,10 +810,10 @@ export class DataSources {
}
}
public SaveDatasource(isForkModal = false, isSavingEnvInOldDS = false) {
public SaveDatasource(isReconnectModal = false, isSavingEnvInOldDS = false) {
this.agHelper.Sleep(500); //bit of time for CI!
this.agHelper.GetNClick(this._saveDs);
if (!isForkModal) {
if (!isReconnectModal) {
this.assertHelper.AssertNetworkStatus("@saveDatasource", 201);
if (!isSavingEnvInOldDS)
this.agHelper.AssertContains("datasource created");
@ -1096,7 +1096,7 @@ export class DataSources {
if (dsName == "PostgreSQL") this.FillPostgresDSForm();
else if (dsName == "MySQL") this.FillMySqlDSForm();
else if (dsName == "MongoDB") this.FillMongoDSForm();
this.SaveDatasource(true);
this.TestSaveDatasource(true, true);
this.assertHelper.AssertNetworkStatus("@getPage", 200);
this.assertHelper.AssertNetworkStatus("getWorkspace");
}

View File

@ -491,13 +491,21 @@ export class HomePage {
this.NavigateToHome();
}
public ImportApp(fixtureJson: string, intoWorkspaceName = "") {
cy.get(this._homeIcon).click({ force: true });
if (intoWorkspaceName)
this.agHelper.GetNClick(this._optionsIconInWorkspace(intoWorkspaceName));
else this.agHelper.GetNClick(this._optionsIcon);
this.agHelper.GetNClick(this._workspaceImport, 0, true);
this.agHelper.AssertElementVisibility(this._workspaceImportAppModal);
public ImportApp(
fixtureJson: string,
intoWorkspaceName = "",
onlyImport = false,
) {
if (onlyImport === false) {
cy.get(this._homeIcon).click({ force: true });
if (intoWorkspaceName)
this.agHelper.GetNClick(
this._optionsIconInWorkspace(intoWorkspaceName),
);
else this.agHelper.GetNClick(this._optionsIcon);
this.agHelper.GetNClick(this._workspaceImport, 0, true);
this.agHelper.AssertElementVisibility(this._workspaceImportAppModal);
}
cy.xpath(this._uploadFile).selectFile("cypress/fixtures/" + fixtureJson, {
force: true,
});