test: Fix flaky git cypress tests (#21282)
Sometimes the git tests fail because of reaching repo limit for the workspace, this PR adds new workspace flow before connecting to git which will make sure test doesnt fail because of reaching repo limit. --------- Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
This commit is contained in:
parent
4c676cc0d0
commit
2b54648694
|
|
@ -7,6 +7,19 @@ describe("Git import empty repository", function() {
|
||||||
const assertConnectFailure = true;
|
const assertConnectFailure = true;
|
||||||
const failureMessage =
|
const failureMessage =
|
||||||
"git import failed. \nDetails: Cannot import app from an empty repo";
|
"git import failed. \nDetails: Cannot import app from an empty repo";
|
||||||
|
before(() => {
|
||||||
|
cy.NavigateToHome();
|
||||||
|
cy.createWorkspace();
|
||||||
|
cy.wait("@createWorkspace").then((interception) => {
|
||||||
|
const newWorkspaceName = interception.response.body.data.name;
|
||||||
|
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||||
|
});
|
||||||
|
cy.generateUUID().then((uid) => {
|
||||||
|
repoName = uid;
|
||||||
|
_.gitSync.CreateTestGiteaRepo(repoName);
|
||||||
|
//cy.createTestGithubRepo(repoName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("Bug #12749 Git Import - Empty Repo NullPointerException", () => {
|
it("Bug #12749 Git Import - Empty Repo NullPointerException", () => {
|
||||||
cy.get(homePage.homeIcon).click();
|
cy.get(homePage.homeIcon).click();
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,19 @@ let repoName;
|
||||||
|
|
||||||
describe("Tests JS Library with Git", () => {
|
describe("Tests JS Library with Git", () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
|
cy.NavigateToHome();
|
||||||
|
cy.createWorkspace();
|
||||||
|
cy.wait("@createWorkspace").then((interception) => {
|
||||||
|
const newWorkspaceName = interception.response.body.data.name;
|
||||||
|
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||||
|
});
|
||||||
// connect app to git
|
// connect app to git
|
||||||
_.gitSync.CreateNConnectToGit(repoName);
|
_.gitSync.CreateNConnectToGit(repoName);
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName = repName;
|
repoName = repName;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("1. Install JS Library and commit changes, create branch and verify JS library changes are present on new branch ", () => {
|
it("1. Install JS Library and commit changes, create branch and verify JS library changes are present on new branch ", () => {
|
||||||
_.entityExplorer.ExpandCollapseEntity("Libraries");
|
_.entityExplorer.ExpandCollapseEntity("Libraries");
|
||||||
_.installer.openInstaller();
|
_.installer.openInstaller();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import template from "../../../../locators/TemplatesLocators.json";
|
||||||
import gitSyncLocators from "../../../../locators/gitSyncLocators";
|
import gitSyncLocators from "../../../../locators/gitSyncLocators";
|
||||||
import widgetLocators from "../../../../locators/Widgets.json";
|
import widgetLocators from "../../../../locators/Widgets.json";
|
||||||
let repoName;
|
let repoName;
|
||||||
let appId;
|
let newWorkspaceName;
|
||||||
let branchName = "test/template";
|
let branchName = "test/template";
|
||||||
const jsObject = "Utils";
|
const jsObject = "Utils";
|
||||||
const homePage = require("../../../../locators/HomePage");
|
const homePage = require("../../../../locators/HomePage");
|
||||||
|
|
@ -11,10 +11,10 @@ import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||||
describe("Fork a template to the current app", () => {
|
describe("Fork a template to the current app", () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.NavigateToHome();
|
cy.NavigateToHome();
|
||||||
cy.generateUUID().then((id) => {
|
cy.createWorkspace();
|
||||||
appId = id;
|
cy.wait("@createWorkspace").then((interception) => {
|
||||||
cy.CreateAppInFirstListedWorkspace(id);
|
newWorkspaceName = interception.response.body.data.name;
|
||||||
localStorage.setItem("AppName", appId);
|
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||||
});
|
});
|
||||||
_.gitSync.CreateNConnectToGit(repoName);
|
_.gitSync.CreateNConnectToGit(repoName);
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
|
|
@ -90,7 +90,7 @@ describe("Fork a template to the current app", () => {
|
||||||
cy.NavigateToHome();
|
cy.NavigateToHome();
|
||||||
cy.get(homePage.searchInput)
|
cy.get(homePage.searchInput)
|
||||||
.clear()
|
.clear()
|
||||||
.type(appId);
|
.type(newWorkspaceName);
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
cy.get(homePage.applicationCard)
|
cy.get(homePage.applicationCard)
|
||||||
.first()
|
.first()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ObjectsRegistry } from "../../../../../support/Objects/Registry";
|
import { ObjectsRegistry } from "../../../../../support/Objects/Registry";
|
||||||
import { encodedWordDoc, encodedXlsxDoc } from "./exampleEncodedDocs";
|
import { encodedWordDoc, encodedXlsxDoc } from "../../../../../fixtures/exampleEncodedDocs";
|
||||||
const ee = ObjectsRegistry.EntityExplorer,
|
const ee = ObjectsRegistry.EntityExplorer,
|
||||||
locator = ObjectsRegistry.CommonLocators,
|
locator = ObjectsRegistry.CommonLocators,
|
||||||
deployMode = ObjectsRegistry.DeployMode,
|
deployMode = ObjectsRegistry.DeployMode,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user