Giter Site home page Giter Site logo

rcorvus / lighthouse.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dima-hx/lighthouse.net

0.0 0.0 0.0 35 KB

Auditing, performance metrics, and best practices for Progressive Web Apps in .NET tests.

Home Page: https://www.nuget.org/packages/lighthouse.net

License: Apache License 2.0

C# 100.00%

lighthouse.net's Introduction

lighthouse.net Nuget

This is a .net (c#) library for Google Lighthouse tool.

Lighthouse.NET analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices from your code.

Auditing, performance metrics, and best practices for Progressive Web Apps in .NET tests.

How to install

You need to install lighthouse as Node module on machine (more info).

  1. Download Google Chrome for Desktop.

  2. Install the current Long-Term Support version of Node.

  3. Install Lighthouse. The -g flag installs it as a global module. npm install -g lighthouse

  4. Install lighthouse.net into your project via NuGet

PM> Install-Package lighthouse.net

Basic example

[TestClass]
public class LighthouseTest
{
    [TestMethod]
    public async Task ExampleComAudit()
    {
        var lh = new Lighthouse();
        var res = await lh.Run("http://example.com");
        Assert.IsNotNull(res);
        Assert.IsNotNull(res.Performance);
        Assert.IsTrue(res.Performance > 0.5m);

        Assert.IsNotNull(res.Accessibility);
        Assert.IsTrue(res.Accessibility > 0.5m);

        Assert.IsNotNull(res.BestPractices);
        Assert.IsTrue(res.BestPractices > 0.5m);

        Assert.IsNotNull(res.Pwa);
        Assert.IsTrue(res.Pwa > 0.5m);

        Assert.IsNotNull(res.Seo);
        Assert.IsTrue(res.Seo > 0.5m);
    }
}

lighthouse.net's People

Contributors

dima-hx avatar alexandrelocas 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.