Generating the POM File
After adding or removing the desired POM elements, you can download the POM class file containing these elements.
To Generate the POM File
-
Assign a meaningful name to the POM class.
-
Click Create POM.
-
Select one of the following options:
-
Copy POM
Copies the POM class code to your clipboard.
-
Copy Autoheal Data
Copies the autoheal JSON data to your clipboard.
-
Download All
Downloads a zip file containing the POM class and Autohealing code.

-
Copying the Code to your Cypress Framework
Once you have generated the code, you need to copy it to your Cypress framework.
- Unzip the generated code downloaded to your Download folder.
- Copy and paste the file
yourPOMClassNamePOM.cy.jsinto a folder in your framework, for example,./cypress/testgenai/POMs. - Copy and paste the file
<testDataId>-PreflightCyPOM_AutohealData.jsoninto your./cypress/autohealfolder.
You can manually create a test in your ./cypress/e2e folder
or whichever folder contains your tests using this generated POM class.
Below is a code snippet using a generated POM class file.
import YourWebAppLoginPOM from '../POMs/YourWebAppLoginPOM';
describe('Simple login test', () => {
it('Performs login using POM', () => {
cy.viewport(1440, 900);
let loginPage = new YourWebAppLoginPOM();
loginPage.visit();
loginPage.typePassword('test');
loginPage.typeEmailAddress('test@test.com');
loginPage.clickSignIn();
loginPage
.getErrorMessage()
.should('contain.text', 'Invalid email or password');
loginPage.clickForgotYourPassword();
cy.autoheal();
});
});