1 / 9

Playwright Course Online | Playwright Automation Online Training

Playwright Course in Hyderabad, India. Visualpath provides Best Playwright Online Training by IT 5-10 yr in industrial real time experts. Call on 91-9989971070. <br>Telegram: https://t.me/ bEu9LVFFlh5iOTA9<br>WhatsApp : https://www.whatsapp.com/catalog/919989971070/<br>Visit : https://www.visualpath.in/playwright-automation-online-training.html<br>

Download Presentation

Playwright Course Online | Playwright Automation Online Training

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Running Playwright Test With Playwright Test Runner www.visualpath.in

  2. Playwright is a Node library for automating browsers, and Playwright Test is a test runner built on top of Playwright. - To set up Playwright Test Runner - you can follow these general steps: 1. Install Node.js: - Ensure that you have Node.js installed on your machine. - You can download it from [nodejs.org](https://nodejs.org/). 2. Initialize a new Node.js project: - Open a terminal in your project's directory and run the following commands. www.visualpath.in

  3. - To create a new `package.json` file: ```bash npm init -y ``` 3. Install Playwright and Playwright Test: - Install the Playwright and Playwright Test packages using npm: ```bash npm install --save-dev playwright playwright-test ``` 4. Configure Playwright Test in package.json: - Open your `package.json` file and add a `test` script that runs Playwright Test. www.visualpath.in

  4. - Update the `"scripts"` section: ```json "scripts": { "test": "playwright test" } ` 5. Write a test file: - Create a directory for your tests (e.g., `tests`) and add a test file inside it. - For example, create a file named `example.test.js`: ```javascript const { test, expect } = require('@playwright/test'); www.visualpath.in

  5. test('example test', async ({ page }) => { await page.goto('https://example.com'); await expect(page).toHaveTitle('Example Domain'); }); ``` 6. Run your tests: Execute the following command in the terminal to run your tests: ```bash npm test ``` - Playwright Test Runner will launch a browser, run your test.# - provide the results in the terminal. www.visualpath.in

  6. 7. Custom Configuration (Optional): - You can customize your Playwright Test configuration by creating a `playwright.config.js` file in your project's root. - For example: ```javascript module.exports = { projects: [ { name: 'desktop', use: { ... }, }, { www.visualpath.in

  7. name: 'mobile', use: { ... }, }, ], }; ``` - Here, you can configure different browser contexts, devices, etc., for each test project. - That's it! You've set up Playwright Test Runner and written a basic test. - You can expand on this foundation by writing more tests, exploring Playwright's APIs. - And customizing your test environment as needed. www.visualpath.in

  8. CONTACT For More Information About Playwright Automation Training Address:- Flat no: 205, 2nd Floor, Nilagiri Block, Aditya EnclaVe, Ameerpet, Hyderabad-16 Ph No : +91-9989971070 Visit : www.visualpath.in E-Mail : online@visualpath.in www.visualpath.in

  9. THANK YOU www.visualpath.in

More Related