Index
This document is intended to be used by Scripters in order to get directions about script creation.
The Scripters should follow all the steps for successful script creation and consequence for a successful automated run.
1. Environment setup
· In this step, you will configure your environment with all you need.
· If you need assistance, you can contact the coordinator anytime by opening a ticket.
2. Script development
· Write the requested scripts using our guidelines.
3. Script validation in Scripter'ss local machine
· Validate first your script in your local machine.
4. Sandbox Package Run
· You can use our sandbox to validate the scripts, by creating a run and waiting for the results. Depending on the results you can see if the script needs any fixes or it's ready.
· If no error is verified in the prior step, please send the test package to the coordinator.
· If you need assistance, you can contact the coordinator anytime by opening a ticket.
5. Script validation Testlio
· In this step, the coordinator will execute it in PRD.
6. Script acceptance
· If no error is detected your script development has been accepted!
If you have any suggestions, related to this document please feel free to give the suggestions to the coordinator anytime.
Have good work!
If you need any help or need to contact the coordinator for any reason, please use this Google Form.
Please read and understand this provided user guide step by step. Also, notify your coordinator through Google Form if additional libraries other than listed are required. For any blockers, please submit a ticket through Google Form.
· Provided below ‘Comment section at the very top of the code with details:
/**
* Scripter's Name:
* Scripter's Email:
* Script Creation Date:
* Additional Libraries Used and Version:
* Test Case Name: * Test Case Description:
*/
· Add proper comments for a better understanding of logic/implementations in code.
· Avoid hardcoded data in the script. Declare all variables and respective values at the beginning of your script.
· Do not hardcode access credentials in the test code.
· For Lambdatest configurations use, lambdatest_config.json file to set credentials.
"lambdatest_auth": {
"username": "username",
"access_key": "access_key"
},
· Use ‘Suite.xls’ file to add the project, test cases, test data details explained in user guide.
· Use ‘AppRepository.xls’ file to add object properties details explained in user guide.
To develop desktop web application tests in Playwright framework, you need to configure the environment locally as described in the instructions below:
1. Install the following IDE:
o Download Visual Studio Code from their official website.
2. Install Node.js and NPM.
3. Install all node dependencies using
npm i
To create a test script compatible with Testlio platform you have to use our framework, containing all the supported libraries by our engine as well as some tools and helper functions which you’re welcome to use during your test’s development process. Also, to help you with the process of creating a test automation project, we prepared a template project. Here are the steps, how to use this template project as a starting point:
1. Pull template projects from GitHub: Github - Testlio/Playwright Framework
2. Open Playwright Framework in the IDE.
3. Check that Testlio Website Open Test works fine in your environment by running the tests suite
· From Playwright command line
npm run test:chrome
4. If tests are executed successfully, it means that your environment is ready to implement Playwright tests for your desktop web application.
In order to use the locators of specific page, create a page class under Pages folder extending Page class. Locator initialisation and common methods will be declared under this page class.
import AppObjsMap from "../../appObjects/AppObjsMap";
import Webpage from "../../pageFactory/Webpage";
export default class TestlioGlobalHomePage extends Webpage {
get testlioTitleBar() { return this.setLocator(AppObjsMap.appObjsType.get('testlioTitleBar'), AppObjsMap.appObjsLocator.get('testlioTitleBar')); }
get applyToFreelanceButton() { return this.setLocator(AppObjsMap.appObjsType.get('applyToFreelanceButton'), AppObjsMap.appObjsLocator.get('applyToFreelanceButton')); }
get signInButton() { return this.setLocator(AppObjsMap.appObjsType.get('signInButton'), AppObjsMap.appObjsLocator.get('signInButton')); }
async clickOnTitleBar() {
await this.clickOnElement(this.testlioTitleBar);
}
async clickOnApplyToFreelanceButton() {
await this.clickOnElement(this.applyToFreelanceButton);
}
async clickOnSignInButton() {
await this.clickOnElement(this.signInButton);
}
}
New test cases will be added under tests folder using the functions from the page class.
it (`should click on 'Apply to Freelance' button`, async() => {
log.info('Test #1');
await browserPage.goto("https://www.testlio.com");
testlioGlobalHomePage = new TestlioGlobalHomePage(browserPage);
await testlioGlobalHomePage.clickOnApplyToFreelanceButton();
});