fix: ListV2 flaky Tests (DefaultSelectedItem) (#22382)

## Description
Fix Meta Hydration Tests in ListV2 : This is an actual regression and to
be handled here https://github.com/appsmithorg/appsmith/issues/22534
FIx DefaultSelectedItem in Listv2


Fixes #22252


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change
- Chore (housekeeping or task changes that don't impact user perception)


## How Has This Been Tested?

- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
This commit is contained in:
Tolulope Adetula 2023-04-24 10:04:42 +01:00 committed by GitHub
parent e651f6242e
commit e6c0a3bdd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 8 deletions

View File

@ -91,7 +91,8 @@ function verifyMultiDropdownValuesCount(count, page = 1) {
});
}
describe("List widget v2 - meta hydration tests", () => {
// Skipping this test due to regression, issue id to track this regression https://github.com/appsmithorg/appsmith/issues/22534
describe.skip("List widget v2 - meta hydration tests", () => {
before(() => {
agHelper.AddDsl(dsl);
});
@ -107,8 +108,8 @@ describe("List widget v2 - meta hydration tests", () => {
cy.wait(1000);
cy.NavigateToDatasourceEditor();
// Click on sample(mock) user database.
cy.get(datasource.mockUserDatabase).click();
// // Click on sample(mock) user database.
// cy.get(datasource.mockUserDatabase).click();
// Choose the first data source which consists of users keyword & Click on the "New Query +"" button
// Choose the first data source which consists of users keyword & Click on the "New Query +"" button
@ -203,6 +204,17 @@ describe("List widget v2 - meta hydration tests", () => {
)
.should("have.length", 3),
);
cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`)
.eq(0)
.within(() => {
cy.waitUntil(() =>
cy
.get(".rc-select-selection-overflow-item .remove-icon")
.should("exist"),
);
});
verifyMultiDropdownValuesCount(6, 2);
// SecondPage
// First Row
@ -239,6 +251,16 @@ describe("List widget v2 - meta hydration tests", () => {
.should("have.length", 3),
);
cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`)
.eq(0)
.within(() => {
cy.waitUntil(() =>
cy
.get(".rc-select-selection-overflow-item .remove-icon")
.should("exist"),
);
});
cy.waitUntil(
() =>
cy
@ -250,7 +272,7 @@ describe("List widget v2 - meta hydration tests", () => {
.first()
.invoke("text")
.then(($selectedValue) => {
expect($selectedValue).to.eq("Green");
cy.waitUntil(() => expect($selectedValue).to.eq("Green"));
}),
{
timeout: 10000,
@ -289,6 +311,16 @@ describe("List widget v2 - meta hydration tests", () => {
.should("have.length", 3),
);
cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`)
.eq(0)
.within(() => {
cy.waitUntil(() =>
cy
.get(".rc-select-selection-overflow-item .remove-icon")
.should("exist"),
);
});
cy.waitUntil(
() =>
cy
@ -300,7 +332,7 @@ describe("List widget v2 - meta hydration tests", () => {
.first()
.invoke("text")
.then(($selectedValue) => {
expect($selectedValue).to.eq("Blue");
cy.waitUntil(() => expect($selectedValue).to.eq("Blue"));
}),
{
timeout: 10000,
@ -360,6 +392,16 @@ describe("List widget v2 - meta hydration tests", () => {
.should("have.length", 3),
);
cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`)
.eq(0)
.within(() => {
cy.waitUntil(() =>
cy
.get(".rc-select-selection-overflow-item .remove-icon")
.should("exist"),
);
});
// SecondPage
// First Row
changeValueOfWidget("selectwidget", "Blue", 0);
@ -394,6 +436,16 @@ describe("List widget v2 - meta hydration tests", () => {
.should("have.length", 3),
);
cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`)
.eq(0)
.within(() => {
cy.waitUntil(() =>
cy
.get(".rc-select-selection-overflow-item .remove-icon")
.should("exist"),
);
});
cy.waitUntil(
() =>
cy
@ -405,7 +457,7 @@ describe("List widget v2 - meta hydration tests", () => {
.first()
.invoke("text")
.then(($selectedValue) => {
expect($selectedValue).to.eq("Green");
cy.waitUntil(() => expect($selectedValue).to.eq("Green"));
}),
{
timeout: 10000,
@ -444,6 +496,16 @@ describe("List widget v2 - meta hydration tests", () => {
.should("have.length", 3),
);
cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`)
.eq(0)
.within(() => {
cy.waitUntil(() =>
cy
.get(".rc-select-selection-overflow-item .remove-icon")
.should("exist"),
);
});
cy.waitUntil(
() =>
cy
@ -455,7 +517,7 @@ describe("List widget v2 - meta hydration tests", () => {
.first()
.invoke("text")
.then(($selectedValue) => {
expect($selectedValue).to.eq("Blue");
cy.waitUntil(() => expect($selectedValue).to.eq("Blue"));
}),
{
timeout: 10000,

View File

@ -21,6 +21,7 @@ function testJsontextClear(endp) {
}
const verifyDefaultItem = () => {
cy.wait(1000);
cy.waitUntil(() =>
cy
.get(
@ -28,7 +29,7 @@ const verifyDefaultItem = () => {
)
.then((val) => {
const data = JSON.parse(val.text());
cy.wrap(data?.Text11?.text).should("equal", "4");
cy.waitUntil(() => cy.wrap(data?.Text11?.text).should("equal", "4"));
}),
);