Giter VIP home page Giter VIP logo

playwrightjavascript's Introduction

this is playwright javascript framwork

This Project is created in Playwright

Table of contents

Installing Playwright

Get started by installing Playwright using npm . Alternatively, you can also get started and run your tests using the VS Code Extension.

npm init playwright@latest

Run the install command and select the following to get started:

  • Choose between TypeScript or JavaScript (default is TypeScript)
  • Name of your Tests folder (default is tests or e2e if you already have a tests folder in your project)
  • Add a GitHub Actions workflow to easily run tests on CI

Folder Structure

Playwright will download the browsers needed as well as create the following files.

playwright.config.js;
package.json;
package - lock.json;
tests / example.spec.js;
tests - examples / demo - todo - app.spec.js;

The playwright.config is where you can add configuration for Playwright including modifying which browsers you would like to run Playwright on. If you are running tests inside an already existing project then dependencies will be added directly to your package.json.

The tests folder contains a basic example test to help you get started with testing. For a more detailed example check out the tests-examples folder which contains tests written to test a todo app.

Available Scripts

  • Running all tests

     npx playwright test
  • Running a single test file

    npx playwright test landing-page.spec.js
  • Running tests in headed mode

    npx playwright test landing-page.spec.js -- headed

    See the doc on Running Tests to learn more about running tests in headed mode, running multiple tests, running specific tests etc.

How to run this test in local

You can run this test locally only if you have installed Node.

After cloning this repository in your local , follow the below steps to run the test.

  • Step1: Run below command to Install Playwright Browsers and dependencies(if the browsers are already install you can skip this step)

    npx playwright install --with-deps
  • Step2: Run below command to Install the package to use Playwright Test , it will create a node_module folder in the directory

    npm install @playwright/test
  • Step3: Run below command to run the test cases

    npx playwright test
  • Step4: Run below command to show the test report

    npx playwright show-report

playwrightjavascript's People

Contributors

vipinsonu1 avatar

Watchers

 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.