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 committed Jul 11, 2024
1 parent 965c26a commit cb02dd5
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 7 deletions.
47 changes: 47 additions & 0 deletions .circleci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'

services:
circleci-qp:
image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
entrypoint: tail -f /dev/null # Keeps the container running

circleci-aem-cloudready:
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
environment:
- FORMS_DOCUMENT_SERVICE=aem-formsdocservice-java:8080
ports:
- "3000:3000"
- "4502:4502"
- "55555:55555"
- "55556:55556"
volumes:
- /home/circleci/build:/home/circleci/build

aem-formsdocservice-native:
image: docker2-granite-release-local.dr-uw2.adobeitc.com/aem-ethos/formsdocservice-native:1.0.158
depends_on:
- circleci-aem-cloudready
environment:
- REGION_NAME=local
- ENVIRONMENT_NAME=CI
ports:
- "8007:8007"
- "8008:8008"
volumes:
- /tmp:/mnt/shared

aem-formsdocservice-java:
image: docker2-granite-release-local.dr-uw2.adobeitc.com/aem-ethos/formsdocservice-java:10.0.214
depends_on:
- aem-formsdocservice-native
environment:
- REGION_NAME=local
- ENVIRONMENT_NAME=CI
- NATIVE_SERVICE_HOST=aem-formsdocservice-native
ports:
- "8080:8080"
volumes:
- /tmp:/mnt/shared
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 @@ -206,7 +206,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/themeClientLibRef"]'
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 cb02dd5

Please sign in to comment.