Playwright Notes

1)  install node js

https://nodejs.org/en/download ( just follow default )

check node in path variable echo %PATH%

node -v

2) Download and install vs code

https://code.visualstudio.com/download

3) open folder in VS code 

npm init playwright

Initializing project in '.'

√ Do you want to use TypeScript or JavaScript? · JavaScript

√ Where to put your end-to-end tests? · tests

√ Add a GitHub Actions workflow? (y/N) · false

√ Install Playwright browsers (can be done manually via 'npx playwright install')? (Y/n) · true

Initializing NPM project (npm init -y)…

Important files in Project 

  • playwright.config.js > Test Runner
  • package.json
  • tests
------------------

added this addon for VS code

--------------------------------------
creating first test file : 
require("@playwright/test")


const { default: test } = require("@playwright/test");

test('login tests', async ({browser,page})=>
{
    //const context = await browser.newContext();
    //const page = await context.newPage();
    await page.goto("https://qa.meta11.com/");
}
);


Share on Google Plus

About Sandamal

Software Tester / Quality Analyst From Sri Lanka. Interest in Learning and Sharing new knowledge in Software Testing.You can contact me via LinkedIn OR FaceBook.

0 comments:

Post a Comment