Giter Site home page Giter Site logo

akshayp7 / playwright-java-cucumber Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 11.0 394 KB

This is Boilerplate/Template for Playwright with Cucumber Java and JUnit for Assertions with Spark Extent reporting for HTML and PDF

License: MIT License

Java 85.26% Gherkin 14.74%
cucumber java junit playwright extentreports

playwright-java-cucumber's Introduction

About the Project

Playwright Demo - This project is based on Microsoft Playwright which enables reliable end-to-end testing for modern web apps.

Top Features:

  • Easy to Configure.
  • Auto-waits for all the relevant checks to pass and only then performs the requested action.
  • Records the test script and every action on the target page is turned into generated script.
  • Generates trace file on failure, which gives in-depth details of Test Case execution.
  • Execution of test case is faster when compared with other competitive framework in market.
  • Supports Headful/Headless mode execution for Firefox/Webkit/Google Chrome/Chromium/MS Edge on Windows/Linux/Mac machines.
  • Rerun Failed Test cases
  • Supports 'download' event monitoring, so there is no need for user to actually wait for downloads to finish.
  • Supports Serial and Parallel execution.
  • Spark PDF/HTML Reports are generated after execution with an option to capture screenshot/video/trace file on failure.
  • Nonetheless Support from Microsoft so FREQUENT RELEASES and turn around time for any queries is 48 hours.

Built With

Getting Started

Prerequisites

The following software are required:

  • java : Download and Install java 1.8
    https://www.openlogic.com/openjdk-downloads
  • Maven must be configured

Installation

  1. Clone the repo using below URL
https://github.com/akshayp7/playwright-typescipt-playwright-test.git
  1. Navigate to folder and install dependencies using:
mvn clean install

Usage

  1. For Browser Configuration, change required value in browser and headless mode in src/test/resources/config/config.properties.
  2. For executing test cases in parallel, navigate to pom.xml and in plugin in configuration section provide <skipTests>false</skipTests> Now if you want to run 4 features in parallel provide <threadCount>4</threadCount> in maven-failsafe-plugin section in pom.xml and execute below command
mvn verify
  1. For executing test cases in sequence, provide a suitable tag @smoke at the start of your scenario and execute below command:
mvn test "-Dcucumber. options=--tags @smoke"
  1. For recording test scripts execute below command with desired url:
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="codegen https://demoqa.com/"
  1. For HTML Report configuration navigate to src/test/resources/extent.properties and provide destination folder as value in extent.reporter.spark.out
  2. For PDF Report configuration navigate to src/test/resources/extent.properties and provide destination folder as value in extent.reporter.pdf.out
  3. Screenshots and Trace files will be generated in target folder on failure this configuration is provided in src/test/java/hooks/Hooks.java in takeScreenshotAndTrace method.
  4. To change your username go to src/test/resources/config/config.properties and provide value against adminUsername
  5. To change password, go to src/main/java/utils/WebActions.java in encrypt() and replace yourPassword with your password, execute the test case, Encrypted password will be printed on your console . Copy Encrypted password in src/test/resources/config/config.properties against adminPassword field.
  6. You can even execute test cases by running src/test/java/testrunner/TestRunner.java file all the failed test cases are saved in target/rerun.txt
  7. For rerunning failed test cases run src/test/java/testrunner/ReRunner.java
  8. Reports will be generated in target/HTMLReport and target/PdfReport folders.

Reports

  • Overall Report Overall Report Screenshot

  • Failure Report Failure Report Screenshot

  • PDF Report PDF Report Screenshot

playwright-java-cucumber's People

Contributors

akshayp7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.