-
Notifications
You must be signed in to change notification settings - Fork 0
Home
ganeshgaxy edited this page Jun 21, 2022
·
2 revisions
Welcome to the PPQA wiki!
In this wiki, I'll discuss in detail about the usage and functionalities available in this framework.
Lets start with how to write a test case using playwright runner,
test.beforeAll(async ({ page }) => {
QAFramework.registerAppUrl('https://demo.playwright.dev/');
QAFramework.registerPlaywrightPage(page);
QAFramework.registerPlaywrightExpect(expect);
});
const TODO_ITEMS = [
'buy some cheese',
'feed the cat',
'book a doctors appointment',
];
test.describe('New Todo', () => {
test('should allow me to add todo items', async ({ page }) => {
let todoMvcPage: TodoMvcPage = createFragment(
TodoMvcPage,
TodoMvcPageProps()
);
await todoMvcPage.open();
// Create 1st todo.
await todoMvcPage.addNewTodo(TODO_ITEMS[0]);
await todoMvcPage.verifyTodoLabel(TODO_ITEMS[0]);
// Create 2nd todo.
await todoMvcPage.addNewTodo(TODO_ITEMS[1]);
await todoMvcPage.verifyTodoLabel([TODO_ITEMS[0], TODO_ITEMS[1]]);
await checkNumberOfTodosInLocalStorage(page, 2);
});
test.beforeAll This is the setup part of this test case, we are simply hooking all the fixture we will need to the framework and after that we will be able to do all the heavy lifting,