Skip to content

Commit

Permalink
Fixing flaky test (#1312)
Browse files Browse the repository at this point in the history
* Fixing flaky test

* updating quickstart docker

* Fixing flaky test
  • Loading branch information
rismehta authored and dmaurya929 committed Jul 24, 2024
1 parent 3629d27 commit 53a91a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .circleci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
entrypoint: tail -f /dev/null # Keeps the container running

circleci-aem-cloudready:
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:473fcacc6d-openjdk11
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:3f4b114b96-openjdk11
depends_on:
- circleci-qp
# Add any additional configurations or environment variables if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("Custom Properties Tests", () => {
// Advanced Tab in dialog
cy.get(tabSelector).contains("Advanced").click({force: true});
cy.get(".fd-CustomProperties-select").click();
cy.get("coral-selectlist-item[role='option']").contains("Group 1").click();
cy.get("coral-selectlist-item[role='option']").contains("Group 1").click({force: true});
cy.get(".fd-CustomProperties-select").click(); // does the job of blur

cy.get(".fd-CustomProperties-additionalCustomPropertiesCheck").click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ describe('Page - Authoring', function () {
cy.get('.rte-toolbar-item[title="Close"]').should('be.visible').click();
});

it('rule editor is working with rich text enum names', function(){
// adding retry since rule editor sometimes does not open at first try
it('rule editor is working with rich text enum names', { retries: 3 }, function(){
cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + checkBoxGroupEditPathSelector);
cy.invokeEditableAction("[data-action='editexpression']");
cy.get("#af-rule-editor").should("be.visible");
Expand Down
11 changes: 6 additions & 5 deletions ui.tests/test-module/specs/datepicker/datepicker.runtime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("Form Runtime with Date Picker", () => {
const fmPropertiesUI = "/libs/fd/fm/gui/content/forms/formmetadataeditor.html/content/dam/formsanddocuments/core-components-it/samples/datepicker/basic"
const themeRef = 'input[name="./jcr:content/metadata/themeRef"]'
const propertiesSaveBtn = '#shell-propertiespage-doneactivator'

// enabling theme for this test case as without theme there is a bug in custom widget css
before(() => {
cy.openPage(fmPropertiesUI).then(() => {
Expand Down Expand Up @@ -215,7 +216,7 @@ describe("Form Runtime with Date Picker", () => {
});

// choose a different date and check if its persisted
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click().then(() => {
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click({force: true}).then(() => {
cy.get("#li-day-11").should("be.visible").should("have.class", "dp-selected"); // first check for the original date selection
cy.get("#li-day-3").should("be.visible").click(); // clicking on the 2nd day of the month of October 2023
cy.get(`#${datePicker7}`).find("input").blur().should("have.value","Wednesday, 2 August, 2023");
Expand All @@ -224,7 +225,7 @@ describe("Form Runtime with Date Picker", () => {
});

// check clear option
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click().then(() => {
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click({force: true}).then(() => {
cy.get(".dp-clear").click();
});

Expand All @@ -233,7 +234,7 @@ describe("Form Runtime with Date Picker", () => {

it("Test order of the days", () => {
const [datePicker7, datePicker7FieldView] = Object.entries(formContainer._fields)[6];
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click().then(() => {
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click({force: true}).then(() => {
cy.get(".header").invoke("text").should("eq", 'SunMonTueWedThuFriSat');
});
});
Expand Down Expand Up @@ -307,7 +308,7 @@ describe("Form Runtime with Date Picker", () => {
const date = '2/8/2023'; // since it has edit format, the date should be in the edit format only
cy.get(`#${datePicker7}`).find("input").clear().type(date).blur().then(x => {
expect(model.getState().value).to.equal('2023-08-02'); // model always has YYYY-MM-DD value
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click().then(() => {
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click({force: true}).then(() => {
cy.get("#li-day-3").should("be.visible").click(); // clicking on the 2nd day of the month of October 2023
cy.get(`#${datePicker7}`).find("input").blur().should("have.value","Wednesday, 2 August, 2023")
.then(() => {
Expand All @@ -325,7 +326,7 @@ describe("Form Runtime with Date Picker", () => {
cy.get(`#${id}`).find("input").clear().type(input).blur().then(x => {
expect(model.getState().value).to.equal(input);
});
cy.get(`#${id}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click().then(() => {
cy.get(`#${id}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click({force: true}).then(() => {
let todayDate = new Date();
let todayYear = todayDate.getFullYear() + "";
cy.get(".dp-caption").should('include.text', todayYear);
Expand Down

0 comments on commit 53a91a8

Please sign in to comment.