Git Product home page Git Product logo

web-automation-using-playwright's Introduction

Web-Automation-using-Playwright

1_gMiUPuRGC36nxZHe2zthOg

What is Automation?

Automation is the practice of using software tools and scripts to perform tasks that would typically require human intervention. In the context of software testing, automation involves using specialized tools to execute test cases and compare the actual outcomes with the expected results automatically.

Why we use Playwright?

Playwright offers several compelling reasons for web automation:

Multi-Browser Support: Playwright supports multiple web browsers, including Chrome, Firefox, and WebKit. This enables you to run your tests on different browsers without modifying your codebase.

Powerful Cross-Browser API: Playwright provides a powerful and consistent API for automating web interactions across different browsers. You can easily simulate user actions, interact with DOM elements, and perform browser-specific operations.

Headless and Headful Modes: Playwright allows you to run tests in headless mode for faster execution or in headful mode for debugging and troubleshooting. You have the flexibility to choose the appropriate mode based on your needs.

Robust Wait and Retry Mechanism: Playwright's built-in wait and retry mechanism ensures that your tests wait for elements to appear or conditions to be met before proceeding. This reduces flakiness and enhances test reliability.

Accessibility Testing: Playwright includes extensive support for accessibility testing, allowing you to verify that your web applications are accessible to users with disabilities.

Overall, Playwright is a powerful and efficient tool for web automation that can help you to test your application more effectively and catch issues early in the development process.

Prerequisites

Before you can run the test suite, ensure that Node.js and npm are installed on your local machine.

Login Page:

https://opensource-demo.orangehrmlive.com/web/index.php/auth/login

Technology used:

  • Playwright: The automation framework.
  • JavaScript: The programming language used to write the test scripts.
  • Visual Studio Code: The recommended code editor for this project.

Setup

  1. Clone the repository to your local machine.

  2. Navigate to the project directory.

  3. Install the dependencies by running the following command:

    npm install
    

Running the Tests

To run the test suite, execute the following command:

npx playwright test

View Test Report

To see test report: npx playwright show-report

Test Cases

The test suite includes the following test cases:

  1. Positive test: Successful Login with valid credentials
  2. Negative test: Unsuccessful Login with invalid credentials

Browsers Used

  1. Chromium
  2. Firefox
  3. Webkit

Test Report:

Screenshot 2023-10-31 at 6 06 18 AM

Video Output

Screen.Recording.2023-10-31.at.6.24.38.AM.mov

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.