Skip to content

Commit

Permalink
Add cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmitpankhania authored Sep 25, 2023
1 parent 7a7e1fb commit fe7f2f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/settings/general-room-settings-tab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,13 @@ describe("General room settings tab", () => {
widths: [580, 796],
},
);

cy.get(".mx_Dialog").invoke("width").then((dialogWidth) => {
// Locate the div with class mx_Field and get its width.
cy.get(".mx_Field").invoke("width").then((fieldWidth) => {
// Assert that the width of the .mx_Field div is less than the .mx_Dialog div.
expect(fieldWidth).to.be.lessThan(dialogWidth);
});
});
});
});

3 comments on commit fe7f2f0

@ABHIXIT2
Copy link

@ABHIXIT2 ABHIXIT2 commented on fe7f2f0 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rashmitpankhania I'm really sorry for the late response. At first, I thought the code was similar to what I nedded because I wasn't familiar with cypress, but now I realize you might be trying to help me by providing me the required code. I'm new to this, so can you please explain?

@rashmitpankhania
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also fairly new to cypress. But doesnt have much difference than jest which also follow the similar test pattern of arrange act and assert
in this case i just looked the existing tests and checked available methods for width in cypress's doc and tested it on my local

so if u want to understand cypress...the documentation is fairly extensive
or anything specific..feel free to shoot!!

@ABHIXIT2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thankyou very much for thr much needed help

Please sign in to comment.