Skip to content
Snippets Groups Projects
Unverified Commit f6b8e1e8 authored by Kamil Mielnik's avatar Kamil Mielnik Committed by GitHub
Browse files

Fix flaky datamodel test (#49583)

* Remove @flaky tag

* Fix flake

* Try typing delay instead

* Improve comment

* Bring back original solution
parent ebf8bb92
No related branches found
No related tags found
No related merge requests found
......@@ -67,8 +67,11 @@ describe("scenarios > admin > datamodel > field > field type", () => {
});
}
function searchFieldType(type) {
cy.findByPlaceholderText("Find...").type(type);
function searchFieldType(value) {
// .type() is flaky when used for ListSearchField - typed characters can
// sometimes get rearranged while typing.
// Unclear why. Possibly because it's rendered as a virtualized list item.
cy.findByPlaceholderText("Find...").invoke("val", value).trigger("blur");
}
function getFKTargetField(targetField) {
......@@ -100,23 +103,19 @@ describe("scenarios > admin > datamodel > field > field type", () => {
cy.intercept("PUT", "/api/field/*").as("fieldUpdate");
});
it(
"should let you change the type to 'No semantic type'",
{ tags: "@flaky" },
() => {
visitAlias("@ORDERS_PRODUCT_ID_URL");
cy.wait(["@metadata", "@metadata"]);
it("should let you change the type to 'No semantic type'", () => {
visitAlias("@ORDERS_PRODUCT_ID_URL");
cy.wait(["@metadata", "@metadata"]);
setFieldType({ oldValue: "Foreign Key", newValue: "No semantic type" });
setFieldType({ oldValue: "Foreign Key", newValue: "No semantic type" });
waitAndAssertOnResponse("fieldUpdate");
waitAndAssertOnResponse("fieldUpdate");
cy.reload();
cy.wait("@metadata");
cy.reload();
cy.wait("@metadata");
getFieldType("No semantic type");
},
);
getFieldType("No semantic type");
});
it("should let you change the type to 'Foreign Key' and choose the target field", () => {
visitAlias("@ORDERS_QUANTITY_URL");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment