Giter VIP home page Giter VIP logo

netflixselenium's Introduction

NetflixSelenium

License: MIT Jenkins: Build

An automated test suite to test the core functionality of https://netflix.com , as well as add additional functionality for users(video tools, random show picker, etc.). Key features include:

  • Optimized speed(no time.sleep() or implicit waits anywhere)
  • Fully integrated into CI/CD pipeline with Jenkins(windows 10 VM in Google Cloud)
  • POM design to minimize maintenance costs(in time)
  • Elegant report generation with unittest/xmlrunner

Quick Guide

  • "I HAVE NO IDEA WHAT I'M LOOKING AT." Watch gif of test execution, then checkout VideoPage tests, it contains very straightforward tests(mute, pause, add subtitles, etc.).
  • This test suite is organized in a Page-Object-Model(POM) design pattern. TLDR: tests contain the test logic (asserts, etc.), and Page objects pagemodels hold the logic for interacting with the page (e.g. press_play_buttonn).
  • The POM design pattern is most the verbose(and the most complex) to write, but is the easiest to maintain in terms of both speed and complexity. See selenium.dev/POM

Examples/Videos

Getting Started

Setup

Prerequisites

  • See requirements.txt for the simple requirements.
  • Choose a browser/webdriver of your choice (see selenium.dev/webdrivers) I'm currently using:
    • Google Chrome version 81.0.4044.92, ChromeDriver version 81.0.4044.69
    • Firefox version v75.0, geckodriver-v0.26.0-win64
    • Edge version 81.0.416.53, msedgedriver version: 81.0.409.0

Constants/Secrets

  • You need to create a secrets.py file in the root directory that will hold all of your credentials and paths. In secrets.py set the following constants as strings MY_EMAIL, MY_PASSWORD, MY_CHOMEDRIVER_PATH, MY_GECKODRIVER_PATH, MY_MSEDGEDRIVER_PATH, URL_OF_VIDEO_TO_TEST

Running the tests

Tests are executed using the standard unittest framework commands(or xmlrunner for reports)

  • To execute all tests $ python -m xmlrunner discover -o xmltestresults
  • To execute a specific test module $ python -m xmlrunner tests/test_headerpage.py -o xmltestresults

Jenkins

A Jenkins build will only trigger when the windows 10 VM instance is spun up in Google Cloud. To reduce costs, I will only spin up the VM when major changes are made. For the same reason, the Jenkins badge won't display live results.

Why a windows 10 VM? Great question. It helps to be able to watch the tests run in real time, thus a Desktop is required. Connecting with Remote Desktop is priceless for troublesome builds.

DEAR NETFLIX DEVS:

As fun as it was to automate your web app, please reopen the public API! I would love to be able to sort my shows by more than one category at a time, among other things, without having to build an entire project to do so. I know there are drawbacks to adding more complicated features, but reintroducing the public API would be an awesome alternative.

Please kindly email me if you have any questions or concerns [email protected]

Acknowledgements

  • First and foremost to Netflix for creating a beautiful UI. The UI is optimized for screen-readers which also makes it heaven for locating elements. Almost every element has a human-readable data-uia
  • I lay no claim to the underlying software of Netflix's web app.
  • Shoutout to the helpful devs on the Selenium Slack/IRC channel, see slack.com/selenium

netflixselenium's People

Contributors

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