Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Latest commit

 

History

History
207 lines (157 loc) · 4.47 KB

sanity_tests.md

File metadata and controls

207 lines (157 loc) · 4.47 KB

Sanity Tests

Until a reliable unit tests and integration tests system is up and running, a sanity test need to be performed manually before each release.

Setup

Actions

  1. Go to the extension manager
  2. Open the details page for the sideloaded Nano Adblocker
  3. Open the background console
  4. Enable error collection

Expected

  1. No error is ever logged to the background console
  2. No error is ever collected

Dashboard

Actions

  1. Open the dashboard using the popup panel

Expected

  1. Correct icon shows in the top left corner

Settings Tab

Actions

  1. Go to Settings tab
  2. Click Reset to default settings...
  3. Confirm action

Expected

  1. The confirm prompt mentions Nano
  2. Settings are restored (check outdated warning markers in Filter lists tab)
  3. Filters cache is purged (check the last modified timestamp of EasyList)
  4. Filters are reloaded from the extension package (check Network tab of the background console)
  5. The subfilter of the uBlock base filter is properly loaded

Actions

  1. Open the advanced settings page

Expected

  1. Correct highlighting style is used

My Filters Tab

Actions

  1. Go to My filters tab
  2. Add these filters:
||www1.example.com^$mp4
||www2.example.com^$empty
||www3.example.com^$redirect=
||www4.example.com^$redirect=noopjs
*/*$redirect=nooptext
/[w\d]\.example\.com/$mp4
||www5.example.com^$mp4,empty
@@||www6.example.com^$mp4

1

||ww2.example.com^$xmlhtprequest

www1.example.com#@#+js()
www2.example.com##+js()
www3.example.com##+js(nanop-click-elements-onload, a)

||example.com^$csp=default-src 'none'; report-to https://other.example.com;

Expected

  1. No error thrown in the background console
  2. Highlighter markers:
    1. Section 1:
      1. Line 3: redirect= marked as invalid
    2. Section 3:
      1. Line 1: xmlhtprequest marked as invalid
    3. Section 4:
      1. Line 2: ##+js() marked as invalid
  3. Linter markers:
    1. Section 1:
      1. Line 3: 1 warning
      2. Line 4: 1 warning
      3. Line 5: 2 warnings
      4. Line 6: 1 warning
      5. Line 7: 1 error
      6. Line 8: 1 error
    2. Section 2:
      1. Line 1: 1 error
    3. Section 3:
      1. Line 1: 1 error
    4. Section 4:
      1. Line 2: 1 error
      2. Line 3: 1 error
    5. Section 5:
      1. Line 1: 1 error
  4. Filter lists tab shows 5 total filters for My filters

Actions

  1. Refresh the dashboard

Expected

  1. Warnings and errors are reloaded

Cleanup

  1. Remove added filters

Whitelist Tab

Actions

  1. Go to Whitelist tab

Expected

  1. Correct highlighting style is used

About Tab

Actions

  1. Go to About tab

Expected

  1. Page shows the correct information

Popup Panel

Actions

  1. Go to example.com
  2. Open the popup panel

Expected

  1. Refresh button is visible
  2. 6 buttons are shown in the bottom toolbar
  3. Correct extension name and version are displayed

Actions

  1. Click Less until the popup panel is completely contracted
  2. Click More twice

Expected

  1. The top toolbar appears, then the firewall panel appears

Actions

  1. Click Less twice

Expected

  1. The firewall panel disappears, then the top toolbar disappears

Actions

  1. Open the bug reporter using the popup panel

Expected

  1. Quick Issue Reporter opens
  2. Correct URL is filled into the form automatically

Logger

Actions

  1. Open the logger using the popup panel
  2. Go to example.com

Expected

  1. Appropriate network requests are logged
  2. Correct icons are shown in the toolbar

Actions

  1. Bring up the popup panel inside the logger

Expected

  1. Icon in the toolbar changes properly
  2. Correct extension name and version are displayed
  3. Two rows of tools are visible
  4. Refresh button is visible

Cosmetic Filtering

Actions

  1. Go to https://gorhill.github.io/uBlock/tests/
  2. Click CSS selector-based cosmetic filters
  3. Add filters as instructed
  4. Reload the page
  5. Wait 5 seconds
  6. Repeat for Procedural cosmetic filters

Expected

  1. All boxes are green and stay green
  2. No highlighter marker and no linter marker in My filters tab

Cleanup

  1. Remove added filters

Element Picker

Actions

  1. Go to example.com
  2. Bring up the element picker using the popup panel
  3. Pick some text
  4. Add the filter
  5. Refresh the page

Expected

  1. Picked text stays hidden
  2. No highlight marker and no linter marker in my filters tab

Cleanup

  1. Remove added filter