Search

Playwright

Installation

Introduction:

Playwright Test is an end-to-end test framework for modern web apps. It bundles test runner, assertions, isolation, parallelization and rich tooling. Playwright supports Chromium, WebKit and Firefox on Windows, Linux and macOS, locally or in CI, headless or headed, with native mobile emulation for Chrome (Android) and Mobile Safari.

Installing Playwright

Using npm, yarn or pnpm #

The command below either initializes a new project or adds Playwright to an existing one.

npm:
  • npm init playwright@latest
yarn:
  • yarn create playwright
pnpm:
  • pnpm create playwright

When prompted, choose / confirm:

  • TypeScript or JavaScript (default: TypeScript)
  • Tests folder name (default: tests, or e2e if tests already exists)
  • Add a GitHub Actions workflow (recommended for CI)
  • Install Playwright browsers (default: yes)
You can re-run the command later; it does not overwrite existing tests.

What's Installed#

Playwright downloads required browser binaries and creates the scaffold below.

playwright.config.ts         # Test configuration
package.json
package-lock.json            # Or yarn.lock / pnpm-lock.yaml
tests/
example.spec.ts                # Minimal example test

The playwright.config centralizes configuration: target browsers, timeouts, retries, projects, reporters and more. In existing projects dependencies are added to your current package.json.

tests/ contains a minimal starter test.

Running the Example Test#

By default tests run headless in parallel across Chromium, Firefox and WebKit (configurable in playwright.config). Output and aggregated results display in the terminal.

npm:
  • npx playwright test
yarn:
  • yarn playwright test
pnpm:
  • pnpm exec playwright test


Tips:
  • See the browser window: add --headed.
  • Run a single project/browser: --project=chromium.
  • Run one file: npx playwright test tests/example.spec.ts.
  • Open testing UI: --ui.
See Running Tests for details on filtering, headed mode, sharding and retries.

Locators:

Check: Check the input Checkbox

Ensure that checkbox or radio element checked.

syntax:

await page.getByRole('checkbox').check();

Ex: await page.getByRole('checkbox', { name: 'Accept Terms' }).check();

Manual Testing

Software:

Software is a collection of programs, data and instructions that tell a Computer how to perform specific tasks.

It is the non-physical(intangible) component of a Computer system that enables hardware to function.

Software can be categorized into two types


System Software:

These softwares are used to provide interface between the system components.

Application Software:

These are developed based on client business needs in order to perform their business activities

Application s/w divided into two types.


a. Product Based :- 

When we develop an application based on standard requirements, it can be sold to any customer in the market.

b. Project Based :- 

When an application is developed based on specific client requirements, it is delivered exclusively to that client.
 

It is a process used to identify the correctness and completeness and to measure the quality of a developed software application.

  • Software testing plays a key role in delivering reliable applications and minimizing project maintenance costs.
  • The primary objective pf software testing is defect identification, which in turn enhances software quality when resolved.
Defect :- It is a variation between the expected result and the actual result produced by the application under test.
  • Defect may also be known as a bug.

Correctness :- Validating that the implemented functionality performs as expected through operational testing.

Completeness :- Ensure that all client business requirements are addressed through the application's functionalities.


  • According to the development team, an application is qualified as a quality product when it meets all client requirements.
  • According to the client or end user, an application is considered high quality when it is fit for use and aligned with business requirements
Following are the major factors depends software quality:
  • Budget or Cost
  • In Time Release
  • Reliability
    1. Meet client requirements in terms of functionality
    2. Meet Client Expectations
Software Testing Methods :-
  • Manual Testing
  • Automation Testing
  • Performance Testing
  • Security Testing
Manual Testing :-

Manual testing involves verifying the application's actual behavior by performing operations or transactions without the use of automation tools. Test engineers prepare test cases to validate the application.

Advantages : Simple & Easy

Disadvantages : 
  • Time Consuming
  • Human Erros
  • In Efficient Results some time
Automation Testing :-