Skip to content

Commit

Permalink
Merge pull request #5512 from gooddata/fixFailedTestSDK
Browse files Browse the repository at this point in the history
fix: stablize integrated tests
  • Loading branch information
ivan-nejezchleb authored Oct 24, 2024
2 parents e66be92 + 72667fd commit aec606b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ describe("Available value filter", () => {
.selectAttribute(["Cory Owens"])
.apply();

widget.waitChartLoaded().getChart().getDataLabelValues().should("deep.equal", ["$2,376,100.41"]);
widget
.waitLoadStarted()
.waitChartLoaded()
.getChart()
.getDataLabelValues()
.should("deep.equal", ["$2,376,100.41"]);

salesRepFilter.open().elementsAreLoaded().deleteFiltervaluesBy("Activity").hasFilterListSize(22);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ describe("Dependent filter", () => {
cy.intercept("GET", "**/attributes**").as("attributes");
topBar.enterEditMode().editButtonIsVisible(false);
product.open().selectAttributesWithoutApply("TouchAll").apply();
// open, close, then open to make sure that attribute filter on child is reloaded to correct valid elements
cy.wait("@attributes").then(() => {
stageName
.open()
.close()
.open()
.elementsAreLoaded()
.hasNoRelevantMessage()
Expand All @@ -266,6 +269,8 @@ describe("Dependent filter", () => {
new InsightsCatalog().waitForCatalogLoad();
stateFilter.open().selectAttributesWithoutApply("Alabama").apply();
cityFilter
.open()
.close()
.open()
.elementsAreLoaded()
.hasFilterListSize(5)
Expand All @@ -280,7 +285,7 @@ describe("Dependent filter", () => {
topBar.enterEditMode().editButtonIsVisible(false);
stateFilter.open().selectAttributesWithoutApply("Alabama").apply();
cy.wait("@attributes").then(() => {
cityFilter.open().elementsAreLoaded().hasFilterListSize(5).close();
cityFilter.open().close().open().elementsAreLoaded().hasFilterListSize(5).close();
stateFilter.removeFilter();
cityFilter.isLoaded().open().elementsAreLoaded().hasFilterListSize(300);
});
Expand All @@ -294,15 +299,15 @@ describe("Dependent filter", () => {

topBar.enterEditMode().editButtonIsVisible(false);
cy.wait("@attributes").then(() => {
cityFilter.open().selectAttribute(["Portland"]).apply();
cityFilter.open().selectAttribute(["Boston", "Nashua"]).apply();
});

stateFilter
.open()
.elementsAreLoaded()
.configureLimitingParentFilterDependency("City")
.hasFilterListSize(2)
.selectAttribute(["Oregon"])
.selectAttribute(["Massachusetts"])
.apply();

stateFilter
Expand All @@ -313,7 +318,7 @@ describe("Dependent filter", () => {
.close();

stateFilter.open().showAllElementValuesIsVisible(true);
table.waitLoaded().getColumnValues(1).should("deep.equal", ["Oregon"]);
table.waitLoaded().getColumnValues(1).should("deep.equal", ["Massachusetts"]);
},
);
});
5 changes: 5 additions & 0 deletions libs/sdk-ui-tests-e2e/cypress/tools/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export class Widget {
return cy.get(this.getElementSelector());
}

waitLoadStarted() {
this.getElement().find(".s-loading").should("exist");
return this;
}

waitChartLoaded() {
// it needs to see visualization-uri-root to know the chart loading
this.getElement().find(".visualization-uri-root").should("exist");
Expand Down

0 comments on commit aec606b

Please sign in to comment.