From f5ee90fcf89d06079454b2e9479bd41c9093e714 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Fri, 22 Nov 2024 22:29:03 +0700 Subject: [PATCH] Reorganize test files --- package-lock.json | 72 +++++++++++- test/mocha-test-extension.js | 10 +- test/mocha-test.js | 105 ++++++++---------- test/specs/{ => browser}/browser-all.json | 0 test/specs/{ => cpu}/cpu-all.json | 0 test/specs/{devices => device}/_others.json | 0 test/specs/{devices => device}/acer.json | 0 test/specs/{devices => device}/advan.json | 0 test/specs/{devices => device}/alcatel.json | 0 test/specs/{devices => device}/amazon.json | 0 test/specs/{devices => device}/apple.json | 0 test/specs/{devices => device}/asus.json | 0 .../specs/{devices => device}/blackberry.json | 0 test/specs/{devices => device}/cat.json | 0 test/specs/{devices => device}/energizer.json | 0 test/specs/{devices => device}/facebook.json | 0 test/specs/{devices => device}/fairphone.json | 0 test/specs/{devices => device}/google.json | 0 test/specs/{devices => device}/hmd.json | 0 test/specs/{devices => device}/honor.json | 0 test/specs/{devices => device}/htc.json | 0 test/specs/{devices => device}/huawei.json | 0 test/specs/{devices => device}/imo.json | 0 test/specs/{devices => device}/infinix.json | 0 test/specs/{devices => device}/itel.json | 0 test/specs/{devices => device}/jolla.json | 0 test/specs/{devices => device}/kobo.json | 0 test/specs/{devices => device}/lenovo.json | 0 test/specs/{devices => device}/lg.json | 0 test/specs/{devices => device}/meizu.json | 0 test/specs/{devices => device}/micromax.json | 0 test/specs/{devices => device}/microsoft.json | 0 test/specs/{devices => device}/motorola.json | 0 test/specs/{devices => device}/nintendo.json | 0 test/specs/{devices => device}/nokia.json | 0 test/specs/{devices => device}/nothing.json | 0 test/specs/{devices => device}/nvidia.json | 0 test/specs/{devices => device}/oneplus.json | 0 test/specs/{devices => device}/oppo.json | 0 test/specs/{devices => device}/ouya.json | 0 test/specs/{devices => device}/panasonic.json | 0 test/specs/{devices => device}/pico.json | 0 test/specs/{devices => device}/polytron.json | 0 test/specs/{devices => device}/realme.json | 0 test/specs/{devices => device}/roku.json | 0 test/specs/{devices => device}/samsung.json | 0 test/specs/{devices => device}/sharp.json | 0 test/specs/{devices => device}/smartfren.json | 0 test/specs/{devices => device}/sony.json | 0 test/specs/{devices => device}/tcl.json | 0 test/specs/{devices => device}/technisat.json | 0 test/specs/{devices => device}/tecno.json | 0 test/specs/{devices => device}/tesla.json | 0 test/specs/{devices => device}/ulefone.json | 0 test/specs/{devices => device}/vivo.json | 0 test/specs/{devices => device}/xiaomi.json | 0 test/specs/{devices => device}/zte.json | 0 test/specs/{ => engine}/engine-all.json | 0 .../{browser-clis.json => extension/cli.json} | 0 .../crawler.json} | 0 .../email.json} | 0 .../extra-devices.json} | 0 .../fetcher.json} | 0 .../library.json} | 0 .../mediaplayer.json} | 0 test/specs/{ => os}/os-all.json | 0 66 files changed, 121 insertions(+), 66 deletions(-) rename test/specs/{ => browser}/browser-all.json (100%) rename test/specs/{ => cpu}/cpu-all.json (100%) rename test/specs/{devices => device}/_others.json (100%) rename test/specs/{devices => device}/acer.json (100%) rename test/specs/{devices => device}/advan.json (100%) rename test/specs/{devices => device}/alcatel.json (100%) rename test/specs/{devices => device}/amazon.json (100%) rename test/specs/{devices => device}/apple.json (100%) rename test/specs/{devices => device}/asus.json (100%) rename test/specs/{devices => device}/blackberry.json (100%) rename test/specs/{devices => device}/cat.json (100%) rename test/specs/{devices => device}/energizer.json (100%) rename test/specs/{devices => device}/facebook.json (100%) rename test/specs/{devices => device}/fairphone.json (100%) rename test/specs/{devices => device}/google.json (100%) rename test/specs/{devices => device}/hmd.json (100%) rename test/specs/{devices => device}/honor.json (100%) rename test/specs/{devices => device}/htc.json (100%) rename test/specs/{devices => device}/huawei.json (100%) rename test/specs/{devices => device}/imo.json (100%) rename test/specs/{devices => device}/infinix.json (100%) rename test/specs/{devices => device}/itel.json (100%) rename test/specs/{devices => device}/jolla.json (100%) rename test/specs/{devices => device}/kobo.json (100%) rename test/specs/{devices => device}/lenovo.json (100%) rename test/specs/{devices => device}/lg.json (100%) rename test/specs/{devices => device}/meizu.json (100%) rename test/specs/{devices => device}/micromax.json (100%) rename test/specs/{devices => device}/microsoft.json (100%) rename test/specs/{devices => device}/motorola.json (100%) rename test/specs/{devices => device}/nintendo.json (100%) rename test/specs/{devices => device}/nokia.json (100%) rename test/specs/{devices => device}/nothing.json (100%) rename test/specs/{devices => device}/nvidia.json (100%) rename test/specs/{devices => device}/oneplus.json (100%) rename test/specs/{devices => device}/oppo.json (100%) rename test/specs/{devices => device}/ouya.json (100%) rename test/specs/{devices => device}/panasonic.json (100%) rename test/specs/{devices => device}/pico.json (100%) rename test/specs/{devices => device}/polytron.json (100%) rename test/specs/{devices => device}/realme.json (100%) rename test/specs/{devices => device}/roku.json (100%) rename test/specs/{devices => device}/samsung.json (100%) rename test/specs/{devices => device}/sharp.json (100%) rename test/specs/{devices => device}/smartfren.json (100%) rename test/specs/{devices => device}/sony.json (100%) rename test/specs/{devices => device}/tcl.json (100%) rename test/specs/{devices => device}/technisat.json (100%) rename test/specs/{devices => device}/tecno.json (100%) rename test/specs/{devices => device}/tesla.json (100%) rename test/specs/{devices => device}/ulefone.json (100%) rename test/specs/{devices => device}/vivo.json (100%) rename test/specs/{devices => device}/xiaomi.json (100%) rename test/specs/{devices => device}/zte.json (100%) rename test/specs/{ => engine}/engine-all.json (100%) rename test/specs/{browser-clis.json => extension/cli.json} (100%) rename test/specs/{browser-crawlers.json => extension/crawler.json} (100%) rename test/specs/{browser-emails.json => extension/email.json} (100%) rename test/specs/{extension-device.json => extension/extra-devices.json} (100%) rename test/specs/{browser-fetchers.json => extension/fetcher.json} (100%) rename test/specs/{browser-libraries.json => extension/library.json} (100%) rename test/specs/{extension-mediaplayer.json => extension/mediaplayer.json} (100%) rename test/specs/{ => os}/os-all.json (100%) diff --git a/package-lock.json b/package-lock.json index 56374f4..3e7e547 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,8 +35,11 @@ "@babel/traverse": "7.23.2", "@jazzer.js/core": "^1.4.0", "@playwright/test": "~1.32.2", + "@types/node": "^22.9.1", + "@types/node-fetch": "^2.6.12", "jshint": "~2.13.6", "mocha": "~8.2.0", + "node-fetch": "^2.7.0", "requirejs": "2.3.2", "safe-regex": "^2.1.1", "tsd": "^0.29.0", @@ -781,10 +784,23 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true + "version": "22.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", + "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.8" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.2", @@ -3525,6 +3541,26 @@ "integrity": "sha512-YsjmaKGPDkmhoNKIpkChtCsPVaRE0a274IdERKnuc/E8K1UJdBZ4/mvI006OijlQZHCfpRNOH3dfHQs92se8gg==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-releases": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", @@ -4576,6 +4612,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -4649,6 +4691,12 @@ "node": ">=0.8.0" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -4710,6 +4758,22 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/test/mocha-test-extension.js b/test/mocha-test-extension.js index 246bf35..6ba195b 100644 --- a/test/mocha-test-extension.js +++ b/test/mocha-test-extension.js @@ -4,11 +4,11 @@ const parseJS = require('@babel/parser').parse; const traverse = require('@babel/traverse').default; const safe = require('safe-regex'); const { UAParser } = require('../src/main/ua-parser'); -const clis = require('./specs/browser-clis.json'); -const crawlers = require('./specs/browser-crawlers.json'); -const emails = require('./specs/browser-emails.json'); -const fetchers = require('./specs/browser-fetchers.json'); -const libraries = require('./specs/browser-libraries.json'); +const clis = require('./specs/extension/cli.json'); +const crawlers = require('./specs/extension/crawler.json'); +const emails = require('./specs/extension/email.json'); +const fetchers = require('./specs/extension/fetcher.json'); +const libraries = require('./specs/extension/library.json'); const { Bots, CLIs, Crawlers, Emails, Fetchers, Libraries } = require('../src/extensions/ua-parser-extensions'); describe('Extensions', () => { diff --git a/test/mocha-test.js b/test/mocha-test.js index ecd7fe0..8f6d529 100644 --- a/test/mocha-test.js +++ b/test/mocha-test.js @@ -5,11 +5,11 @@ var requirejs = require('requirejs'); var parseJS = require('@babel/parser').parse; var traverse = require('@babel/traverse').default; var {UAParser} = require('../src/main/ua-parser'); -var browsers = require('./specs/browser-all.json'); -var cpus = require('./specs/cpu-all.json'); -var devices = readJsonFiles('test/specs/devices'); -var engines = require('./specs/engine-all.json'); -var os = require('./specs/os-all.json'); +var browsers = require('./specs/browser/browser-all.json'); +var cpus = require('./specs/cpu/cpu-all.json'); +var devices = readJsonFiles('test/specs/device'); +var engines = require('./specs/engine/engine-all.json'); +var os = require('./specs/os/os-all.json'); var { Headers } = require('node-fetch'); function readJsonFiles(dir) { @@ -20,39 +20,6 @@ function readJsonFiles(dir) { return list; }; -var parser = new UAParser(); -var methods = [ - { - title : 'getBrowser', - label : 'browser', - list : browsers, - properties : ['name', 'major', 'version', 'type'] - }, - { - title : 'getCPU', - label : 'cpu', - list : cpus, - properties : ['architecture'] - }, - { - title : 'getDevice', - label : 'device', - list : devices, - properties : ['model', 'type', 'vendor'] - }, - { - title : 'getEngine', - label : 'engine', - list : engines, - properties : ['name', 'version'] - }, - { - title : 'getOS', - label : 'os', - list : os, - properties : ['name', 'version'] -}]; - describe('UAParser()', function () { var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6'; assert.deepEqual(UAParser(ua), new UAParser().setUA(ua).getResult()); @@ -66,26 +33,50 @@ describe('UAParser.setUA method does not throw with undefined ua argument', func assert.doesNotThrow(() => new UAParser().setUA(undefined).getResult()); }); -for (var i in methods) { - describe(methods[i]['title'], function () { - for (var j in methods[i]['list']) { - if (!!methods[i]['list'][j].ua) { - describe('[' + methods[i]['list'][j].desc + ']', function () { - describe('"' + methods[i]['list'][j].ua + '"', function () { - var expect = methods[i]['list'][j].expect; - var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']]; - - methods[i]['properties'].forEach(function(m) { - it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () { - assert.strictEqual(result[m], expect[m] != 'undefined' ? expect[m] : undefined); - }); +describe('UAParser get*() methods', () => { + [ + { + title : 'getBrowser()', + label : 'browser', + list : browsers + }, + { + title : 'getCPU()', + label : 'cpu', + list : cpus + }, + { + title : 'getDevice()', + label : 'device', + list : devices + }, + { + title : 'getEngine()', + label : 'engine', + list : engines + }, + { + title : 'getOS()', + label : 'os', + list : os + } + ] + .forEach(method => { + describe(`[${method.title}]`, () => { + method.list.forEach(unit => { + describe(`[${unit.desc}]: "${unit.ua}"`, () => { + const actual = UAParser(unit.ua)[method.label]; + Object.entries(unit.expect).forEach(entry => { + const [key, val] = entry; + it(`Should return ${key}: ${val}`, () => { + assert.strictEqual(String(val), String(actual[key])); }); }); }); - } - } + }); + }); }); -} +}); describe('Returns', function () { it('getResult() should returns JSON', function(done) { @@ -192,9 +183,9 @@ describe('Testing regexes', function () { describe('Begin testing', function () { it('all regexes in main file', function () { - regexes.forEach(function (regex) { - describe('Test against `safe-regex` : ' + regex, function () { - it('should be safe from potentially vulnerable regex', function () { + describe('Test against `safe-regex` module', function () { + regexes.forEach(function (regex) { + it(`Should pass \`safe-regex\`: ${regex}`, function () { assert.strictEqual(safe(regex), true); }); }); diff --git a/test/specs/browser-all.json b/test/specs/browser/browser-all.json similarity index 100% rename from test/specs/browser-all.json rename to test/specs/browser/browser-all.json diff --git a/test/specs/cpu-all.json b/test/specs/cpu/cpu-all.json similarity index 100% rename from test/specs/cpu-all.json rename to test/specs/cpu/cpu-all.json diff --git a/test/specs/devices/_others.json b/test/specs/device/_others.json similarity index 100% rename from test/specs/devices/_others.json rename to test/specs/device/_others.json diff --git a/test/specs/devices/acer.json b/test/specs/device/acer.json similarity index 100% rename from test/specs/devices/acer.json rename to test/specs/device/acer.json diff --git a/test/specs/devices/advan.json b/test/specs/device/advan.json similarity index 100% rename from test/specs/devices/advan.json rename to test/specs/device/advan.json diff --git a/test/specs/devices/alcatel.json b/test/specs/device/alcatel.json similarity index 100% rename from test/specs/devices/alcatel.json rename to test/specs/device/alcatel.json diff --git a/test/specs/devices/amazon.json b/test/specs/device/amazon.json similarity index 100% rename from test/specs/devices/amazon.json rename to test/specs/device/amazon.json diff --git a/test/specs/devices/apple.json b/test/specs/device/apple.json similarity index 100% rename from test/specs/devices/apple.json rename to test/specs/device/apple.json diff --git a/test/specs/devices/asus.json b/test/specs/device/asus.json similarity index 100% rename from test/specs/devices/asus.json rename to test/specs/device/asus.json diff --git a/test/specs/devices/blackberry.json b/test/specs/device/blackberry.json similarity index 100% rename from test/specs/devices/blackberry.json rename to test/specs/device/blackberry.json diff --git a/test/specs/devices/cat.json b/test/specs/device/cat.json similarity index 100% rename from test/specs/devices/cat.json rename to test/specs/device/cat.json diff --git a/test/specs/devices/energizer.json b/test/specs/device/energizer.json similarity index 100% rename from test/specs/devices/energizer.json rename to test/specs/device/energizer.json diff --git a/test/specs/devices/facebook.json b/test/specs/device/facebook.json similarity index 100% rename from test/specs/devices/facebook.json rename to test/specs/device/facebook.json diff --git a/test/specs/devices/fairphone.json b/test/specs/device/fairphone.json similarity index 100% rename from test/specs/devices/fairphone.json rename to test/specs/device/fairphone.json diff --git a/test/specs/devices/google.json b/test/specs/device/google.json similarity index 100% rename from test/specs/devices/google.json rename to test/specs/device/google.json diff --git a/test/specs/devices/hmd.json b/test/specs/device/hmd.json similarity index 100% rename from test/specs/devices/hmd.json rename to test/specs/device/hmd.json diff --git a/test/specs/devices/honor.json b/test/specs/device/honor.json similarity index 100% rename from test/specs/devices/honor.json rename to test/specs/device/honor.json diff --git a/test/specs/devices/htc.json b/test/specs/device/htc.json similarity index 100% rename from test/specs/devices/htc.json rename to test/specs/device/htc.json diff --git a/test/specs/devices/huawei.json b/test/specs/device/huawei.json similarity index 100% rename from test/specs/devices/huawei.json rename to test/specs/device/huawei.json diff --git a/test/specs/devices/imo.json b/test/specs/device/imo.json similarity index 100% rename from test/specs/devices/imo.json rename to test/specs/device/imo.json diff --git a/test/specs/devices/infinix.json b/test/specs/device/infinix.json similarity index 100% rename from test/specs/devices/infinix.json rename to test/specs/device/infinix.json diff --git a/test/specs/devices/itel.json b/test/specs/device/itel.json similarity index 100% rename from test/specs/devices/itel.json rename to test/specs/device/itel.json diff --git a/test/specs/devices/jolla.json b/test/specs/device/jolla.json similarity index 100% rename from test/specs/devices/jolla.json rename to test/specs/device/jolla.json diff --git a/test/specs/devices/kobo.json b/test/specs/device/kobo.json similarity index 100% rename from test/specs/devices/kobo.json rename to test/specs/device/kobo.json diff --git a/test/specs/devices/lenovo.json b/test/specs/device/lenovo.json similarity index 100% rename from test/specs/devices/lenovo.json rename to test/specs/device/lenovo.json diff --git a/test/specs/devices/lg.json b/test/specs/device/lg.json similarity index 100% rename from test/specs/devices/lg.json rename to test/specs/device/lg.json diff --git a/test/specs/devices/meizu.json b/test/specs/device/meizu.json similarity index 100% rename from test/specs/devices/meizu.json rename to test/specs/device/meizu.json diff --git a/test/specs/devices/micromax.json b/test/specs/device/micromax.json similarity index 100% rename from test/specs/devices/micromax.json rename to test/specs/device/micromax.json diff --git a/test/specs/devices/microsoft.json b/test/specs/device/microsoft.json similarity index 100% rename from test/specs/devices/microsoft.json rename to test/specs/device/microsoft.json diff --git a/test/specs/devices/motorola.json b/test/specs/device/motorola.json similarity index 100% rename from test/specs/devices/motorola.json rename to test/specs/device/motorola.json diff --git a/test/specs/devices/nintendo.json b/test/specs/device/nintendo.json similarity index 100% rename from test/specs/devices/nintendo.json rename to test/specs/device/nintendo.json diff --git a/test/specs/devices/nokia.json b/test/specs/device/nokia.json similarity index 100% rename from test/specs/devices/nokia.json rename to test/specs/device/nokia.json diff --git a/test/specs/devices/nothing.json b/test/specs/device/nothing.json similarity index 100% rename from test/specs/devices/nothing.json rename to test/specs/device/nothing.json diff --git a/test/specs/devices/nvidia.json b/test/specs/device/nvidia.json similarity index 100% rename from test/specs/devices/nvidia.json rename to test/specs/device/nvidia.json diff --git a/test/specs/devices/oneplus.json b/test/specs/device/oneplus.json similarity index 100% rename from test/specs/devices/oneplus.json rename to test/specs/device/oneplus.json diff --git a/test/specs/devices/oppo.json b/test/specs/device/oppo.json similarity index 100% rename from test/specs/devices/oppo.json rename to test/specs/device/oppo.json diff --git a/test/specs/devices/ouya.json b/test/specs/device/ouya.json similarity index 100% rename from test/specs/devices/ouya.json rename to test/specs/device/ouya.json diff --git a/test/specs/devices/panasonic.json b/test/specs/device/panasonic.json similarity index 100% rename from test/specs/devices/panasonic.json rename to test/specs/device/panasonic.json diff --git a/test/specs/devices/pico.json b/test/specs/device/pico.json similarity index 100% rename from test/specs/devices/pico.json rename to test/specs/device/pico.json diff --git a/test/specs/devices/polytron.json b/test/specs/device/polytron.json similarity index 100% rename from test/specs/devices/polytron.json rename to test/specs/device/polytron.json diff --git a/test/specs/devices/realme.json b/test/specs/device/realme.json similarity index 100% rename from test/specs/devices/realme.json rename to test/specs/device/realme.json diff --git a/test/specs/devices/roku.json b/test/specs/device/roku.json similarity index 100% rename from test/specs/devices/roku.json rename to test/specs/device/roku.json diff --git a/test/specs/devices/samsung.json b/test/specs/device/samsung.json similarity index 100% rename from test/specs/devices/samsung.json rename to test/specs/device/samsung.json diff --git a/test/specs/devices/sharp.json b/test/specs/device/sharp.json similarity index 100% rename from test/specs/devices/sharp.json rename to test/specs/device/sharp.json diff --git a/test/specs/devices/smartfren.json b/test/specs/device/smartfren.json similarity index 100% rename from test/specs/devices/smartfren.json rename to test/specs/device/smartfren.json diff --git a/test/specs/devices/sony.json b/test/specs/device/sony.json similarity index 100% rename from test/specs/devices/sony.json rename to test/specs/device/sony.json diff --git a/test/specs/devices/tcl.json b/test/specs/device/tcl.json similarity index 100% rename from test/specs/devices/tcl.json rename to test/specs/device/tcl.json diff --git a/test/specs/devices/technisat.json b/test/specs/device/technisat.json similarity index 100% rename from test/specs/devices/technisat.json rename to test/specs/device/technisat.json diff --git a/test/specs/devices/tecno.json b/test/specs/device/tecno.json similarity index 100% rename from test/specs/devices/tecno.json rename to test/specs/device/tecno.json diff --git a/test/specs/devices/tesla.json b/test/specs/device/tesla.json similarity index 100% rename from test/specs/devices/tesla.json rename to test/specs/device/tesla.json diff --git a/test/specs/devices/ulefone.json b/test/specs/device/ulefone.json similarity index 100% rename from test/specs/devices/ulefone.json rename to test/specs/device/ulefone.json diff --git a/test/specs/devices/vivo.json b/test/specs/device/vivo.json similarity index 100% rename from test/specs/devices/vivo.json rename to test/specs/device/vivo.json diff --git a/test/specs/devices/xiaomi.json b/test/specs/device/xiaomi.json similarity index 100% rename from test/specs/devices/xiaomi.json rename to test/specs/device/xiaomi.json diff --git a/test/specs/devices/zte.json b/test/specs/device/zte.json similarity index 100% rename from test/specs/devices/zte.json rename to test/specs/device/zte.json diff --git a/test/specs/engine-all.json b/test/specs/engine/engine-all.json similarity index 100% rename from test/specs/engine-all.json rename to test/specs/engine/engine-all.json diff --git a/test/specs/browser-clis.json b/test/specs/extension/cli.json similarity index 100% rename from test/specs/browser-clis.json rename to test/specs/extension/cli.json diff --git a/test/specs/browser-crawlers.json b/test/specs/extension/crawler.json similarity index 100% rename from test/specs/browser-crawlers.json rename to test/specs/extension/crawler.json diff --git a/test/specs/browser-emails.json b/test/specs/extension/email.json similarity index 100% rename from test/specs/browser-emails.json rename to test/specs/extension/email.json diff --git a/test/specs/extension-device.json b/test/specs/extension/extra-devices.json similarity index 100% rename from test/specs/extension-device.json rename to test/specs/extension/extra-devices.json diff --git a/test/specs/browser-fetchers.json b/test/specs/extension/fetcher.json similarity index 100% rename from test/specs/browser-fetchers.json rename to test/specs/extension/fetcher.json diff --git a/test/specs/browser-libraries.json b/test/specs/extension/library.json similarity index 100% rename from test/specs/browser-libraries.json rename to test/specs/extension/library.json diff --git a/test/specs/extension-mediaplayer.json b/test/specs/extension/mediaplayer.json similarity index 100% rename from test/specs/extension-mediaplayer.json rename to test/specs/extension/mediaplayer.json diff --git a/test/specs/os-all.json b/test/specs/os/os-all.json similarity index 100% rename from test/specs/os-all.json rename to test/specs/os/os-all.json