Progressive Web Apps testing in 2020
Tags: architecture, softwarequalityassur, progressivewebapps, qa
Published: 2021-01-12 12:45:46

---
title: Progressive Web Apps testing in 2020
published: true
date: 2020-12-09 09:31:39 UTC
tags: SoftwareArchitecture,SoftwareQualityAssur,ProgressiveWebApps,QA
canonical_url: https://apiumhub.com/tech-blog-barcelona/progressive-web-apps-testing-in-2020/
---

## Using console in JS for better testing

Hi, in this article i’d like to share my experience of testing PWA (progressive web applications).

Let’s start with definition of PWA. Google told us that Progressive Web App is website that looks and behaves as if it is a mobile app.

Some of PWA features:

– Launch site from mobile home screen  
 – Work in offline mode  
 – Get push notifications

This and other features allow user to have website fast and convenient. Saves memory and traffic in user device.

To reach PWA functionality, PWA has some technical components:

– **\*\*Web App manifest\*\*** (a json file, that determines app behaviour. Usually it contains starting URL, links to icons, type, location)  
 – **\*\*Service worker\*\*** (JS file, that defines network requests logic and caching strategy, such as offline mode, background sync, push notifications)  
 – **\*\*App Shell\*\*** (set of resources(css, js, html) to load UI. App shell cached by Service Worker. Used to define of static UI content)

Now let’s move to testing of PWA features. To take in mind, that to test web application you should not forgot about testing general functionality of app (not just testing PWA features). I mean to test app functionality and performing app non-functional testing (UI, cross-browser, performance testing).

About PWA features testing:

– app installation on home screen  
 – offline mode (service worker testing)  
 – push notifications

As a PWA is a website, you can use standard tools for web testing.  
 Tools to be used:

– Chrome DevTools  
 – Postman/Charles  
 – Lighthouse

### 1. PWA Manifest and app installation testing

For this purpose will be testing Chrome DevTools. For PWA example will be used site of [Google Developers](https://developers.google.com). In Chrome DevTools select Application tab, and then Manifest. QA should validate key properties in manifest (short\_name, start\_url, display mode, icons).

![PWA Manifest](https://apiumhub.com/wp-content/uploads/2020/12/1.png)

 

### 2. Service workers testing

As we mentioned earlier, the main purpose of Software Worker is to be able use app in offline mode, using cache and providing push notifications. To test Service Worker you should navigate to Service worker tab in browser DevTools (for our example we use Chrome DevTools).

![](https://apiumhub.com/wp-content/uploads/2020/12/2.png)

 

Here QA Engineer should validate that Service worker is registered, activated and running. A checkbox “Offline” is to perform tests under offline mode. All app data is cached during first service worker registration. Note: service worker has own cache, which is accesible under proper tab in DevTools.

![Service workers testing](https://apiumhub.com/wp-content/uploads/2020/12/3.png)

 

### 3. Push notifications

QA Engineer should check that app asks for notification permission in browser. Also sometimes for different projects could be implemented third-party SDK to control push notifications across the app. (Such as [Airship](https://www.airship.com), etc.)

### 4. Lighthouse tool

[Lighthouse](https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk) ** ** is a useful tool provided by Google to test PWA. Can be installed as an Chrome extension. Tool that allows you to check App performance, accessibility, PWA features, etc. As an Output it will display report with metrics and recommendations for website improvement. Also [Lighthouse](https://www.npmjs.com/package/lighthouse) can be installed from npm library to run as a node module in command line.

As an another example of Progressive Web App you can see on [Twitter](https://twitter.com) webpage. If you are using Chrome on your Android Device, navigate to options, and select \*\*Add to homescreen\*\*. It allows you to have Twitter on your mobile homescreen, without installation from Play Store. By the way, subscribe to our [Apiumhub](https://twitter.com/Apium_hub) account on Twitter.

That’s all folks! Happy Testing!

The post [Progressive Web Apps testing in 2020](https://apiumhub.com/tech-blog-barcelona/progressive-web-apps-testing-in-2020/) appeared first on [Apiumhub](https://apiumhub.com).