Git Product home page Git Product logo

playwright-typescript's Introduction

Playwright (TypeScript)

Introduction

This repo is an example Playwright test suite written in TypeScript. It has been put together to demonstrate my approach to UI testing and also as a practical example of how Playwright can be used, incorporating various techniques and tricks I have learned throughout my professional career.

Website Under Test

This project uses a third-party dummy retail website (Luma) as the software under test. The website is MUCH bigger than is ideal for this sort of exercise but if it works (which it seems to) then that puts it streets ahead of various other websites and options I have tried.

Playwright does offer an example "to do" app that can be used for testing but the Playwright installation also includes a sample test suite for the "to do" app so what would I be adding that hasn't already been done? I'm not showcasing my own skills and approach if I use an app that already has a full test suite publicly available.

Also by using a third-party deployed website like the Luma store then it is easier to show how different test tools and frameworks can be used together.

There are a couple of major drawbacks to using a third-party website for this test suite. Firstly, being unable to edit the application source code means I can't make it more testable e.g. by adding attributes to web elements. As as result the tests herein use page.locator() far more than I would ideally because many web elements don't have IDs, test ID attributes, roles etc. Secondly, the lack of access to the developers to help understand certain aspects of the system means I have been unable to write certain types of tests. For example, based on Chrome dev tools, I can't see any obvious requests being made when a user signs in so I have been unable to write tests to verify the correct API requests are made and the right response received. Something must be providing auth but I haven't been able to figure out how it has been implemented and don't have access to the team that wrote the application to ask them.

Test Suite

NB In an ideal world many of the test cases in this test suite would be executed further down the test pyramid rather than at UI level. However, I wanted to illustrate my thinking around various test scenarios and the types of test I would implement and executing them at UI level is the only option open to me given I am using a third-party application for this project.

Work in progress...

playwright-typescript's People

Contributors

mathare 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.