Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix Onboarding/CreateNewApp flaky test #21347

Merged
merged 7 commits into from
Mar 15, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,13 @@ const guidedTourLocators = require("../../../../locators/GuidedTour.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const homePage = require("../../../../locators/HomePage");
import * as _ from "../../../../support/Objects/ObjectsCore";
let workspaceName;

describe("Creating new app after discontinuing guided tour should not start the same", function() {
it("1. Creating new app after discontinuing guided tour should not start the same", function() {
// Start guided tour
_.homePage.NavigateToHome();
_.agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
workspaceName = "CNAppWorspace" + uid;
_.homePage.CreateNewWorkspace(workspaceName);
_.homePage.CreateAppInWorkspace(workspaceName); //Since welcome tour always creates app in 1st workspace available
_.homePage.NavigateToHome();
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't really using the workspaceName variable anywhere in the test so have removed this . Removing this also seems to have stopped the 503 errors not sure why though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this does not solve the issue. I add the new workspace creation code as a part of script fix - for 503. Tried adding new workspace, creating new application in it & then try to click on welcome tour. This will not/does not solve the 503.

_.agHelper.Sleep(4000); //Adding only because of the CI failure
cy.get(guidedTourLocators.welcomeTour).click();
_.dataSources.CloseReconnectDataSourceModal(); // Check if reconnect data source modal is visible and close it
cy.get(guidedTourLocators.welcomeTour)
.click()
.wait(2000);
_.dataSources.CloseReconnectDataSourceModal(); // Check if reconnect data source modal is visible and close it
cy.get("body").then(($ele) => {
if ($ele.find(guidedTourLocators.welcomeTour).length) {
cy.get(guidedTourLocators.welcomeTour)
.click()
.wait(2000);
}
});
_.dataSources.CloseReconnectDataSourceModal(); // Check if reconnect data source modal is visible and close it

cy.get("body").then(($ele) => {
if ($ele.find(guidedTourLocators.startBuilding).length == 0) {
cy.get(commonlocators.homeIcon).click({ force: true });
cy.get(guidedTourLocators.welcomeTour)
.click()
.wait(4000);
}
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CloseReconnectDataSourceModal and clicking on the welcomeTour are repeated which are not required to run the test, so have removed them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added since we see the Reconnect modal dialog appearing out of nowhere in this test flow & test failing to click on welcome tour. Removing this also will not solve the 503 issue.

Copy link
Contributor Author

@akash-codemonk akash-codemonk Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the reconnect modal does appear then either it is a bug or some issue the fork api on ci. Either ways keeping this is a workaround. I can have a look at it when it happens next time, so far the 4 times we ran it does not seem to have happened.
Yes I don't think it fixes the 503 issue.


cy.get(guidedTourLocators.startBuilding).should("be.visible");
// Go back to applications page
Expand Down
Loading