Welcome to the Page Language Model (PLM) repository! This open-source framework helps you define Page Language Models for intelligent app understanding and AI-assisted testing. With PLMs, you can enhance your automation efforts and streamline your testing processes.
In today's fast-paced development environment, the need for effective testing tools is crucial. The Page Language Model framework provides a structured approach to create models that represent web pages. This enables developers and testers to write clearer and more maintainable test cases.
- Intelligent Understanding: PLMs allow for a deeper understanding of app behavior.
- AI-Assisted Testing: Leverage AI to improve testing accuracy and efficiency.
- Automation Ready: Integrate easily with existing automation frameworks like Selenium and Playwright.
- Simple Syntax: Define your page models using a clear and concise syntax.
- JSON Schema Support: Utilize JSON schema for validation and structure.
- Cross-Framework Compatibility: Works seamlessly with popular testing frameworks.
- Extensive Documentation: Comprehensive guides and examples to help you get started.
- Community Support: Join a growing community of developers and testers.
To get started with Page Language Model, you need to clone the repository and install the necessary dependencies.
git clone https://github.com/yassinelahdiy/page-language-model.git
cd page-language-model
npm install
You can also download the latest release here and follow the instructions to set it up.
Once you have installed the framework, you can start defining your Page Language Models. Here’s a simple example to illustrate how it works.
Create a new file called loginPageModel.json
:
{
"title": "Login Page",
"fields": {
"username": {
"type": "input",
"selector": "#username"
},
"password": {
"type": "input",
"selector": "#password"
},
"submit": {
"type": "button",
"selector": "#submit"
}
}
}
You can now use the defined page model in your tests:
const { LoginPage } = require('./loginPageModel.json');
describe('Login Tests', () => {
it('should log in successfully', async () => {
await page.goto('https://example.com/login');
await page.fill(LoginPage.fields.username.selector, 'testuser');
await page.fill(LoginPage.fields.password.selector, 'password123');
await page.click(LoginPage.fields.submit.selector);
// Add assertions here
});
});
We welcome contributions to the Page Language Model framework! If you want to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Make your changes and commit them (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a Pull Request.
Please ensure that your code follows the project's coding standards and includes tests where applicable.
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or issues, feel free to open an issue in the repository or check the Releases section for updates.
Thank you for checking out the Page Language Model framework! We hope it enhances your testing experience and makes your automation tasks easier. Happy coding!