New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

roku-test-automation

Package Overview
Dependencies
Maintainers
2
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roku-test-automation - npm Package Compare versions

Comparing version 1.0.56 to 1.0.57

2

package.json
{
"name": "roku-test-automation",
"version": "1.0.56",
"version": "1.0.57",
"description": "Helps with automating functional tests",

@@ -5,0 +5,0 @@ "main": "server/dist/index.js",

@@ -15,3 +15,3 @@ # Roku Test Automation

Once installed, the standard way for using RTA is via the singletons `ecp`, like
Once installed, the standard way for using RTA is via the singletons like

@@ -54,19 +54,4 @@ ```ts

to setup the environment for you. To avoid having to do this in each test file you can setup a global include in your mocha package.json setup like:
to setup the environment for you. To avoid having to do this in each test file you can setup a global include in the mocha section of your package.json as demonstrated in `/testProject/package.json`. Be sure to change the path to match where you put your include file.
```json
"mocha": {
"timeout": 5000,
"file": [
"./src/test/include.ts"
],
"require": [
"ts-node/register",
"source-map-support/register"
]
}
```
be sure to change the include.ts path to match where you put your include file.
If you're going to use the OnDeviceComponent then there are a number of files that need to be copied over into your app. If you're not using the [BrightScript Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=celsoaf.brightscript) yet then now is a great time to try it out. If you are all you need to is add:

@@ -85,4 +70,6 @@

If you did this all the steps above correct you should be ready to start making use of RTA's components.
RTA's RokuDevice also exposes a `deploy()` function for including these files and also turning on a bs_const for `ENABLE_RTA` if included in your manifest.
If you did all the steps above correct you should be ready to start making use of RTA's components.
## Components

@@ -99,2 +86,4 @@

---
### **OnDeviceComponent**

@@ -104,3 +93,3 @@

`m.odc = createObject("RTA_OnDeviceComponent")`
Once setup you can send requests to the device to either kick off something to check or check whether the expected outcome occurred. The following is list of all current request types:
Once setup you can send requests to the device to either kick off an event or check whether the expected outcome occurred or both. The following is list of all current request types:

@@ -125,3 +114,3 @@ ---

The [getValuesAtKeyPaths unit test](https://github.com/triwav/roku-test-automation/blob/master/server/src/OnDeviceComponent.spec.ts#L59) provides an example of its usage
The [getValuesAtKeyPaths unit test](https://github.com/triwav/roku-test-automation/blob/master/server/src/OnDeviceComponent.spec.ts#L70) provides an example of its usage

@@ -161,3 +150,3 @@ ---

Instead of having to do an arbitrary delay or polling repeatedly for a field to match an expected value, you can use observeField to setup an observer and be notified when the value changes. It takes the standard `base` and `keyPath` properties along with the following for `args`:
**`match`?: any | {base, keyPath, value}** sometimes when you are observing a field you don't just want the first change. You're looking for a specific value. In this case you can pass the value you're looking for match. In this case, `base` and `keyPath` are the same as those the base level args. It's even more powerful than that though. You can also supply an object where the value your matching against actually comes from a totally different node than the one being observed.
**`match`?: any | {base, keyPath, value}** sometimes when you are observing a field you don't just want the first change. You're looking for a specific value. In this case you can pass the value you're looking for the match like `await odc.observeField({keyPath: 'AuthManager.isLoggedIn', match: true})` In this case, `base` and `keyPath` for match are the same as those for the base level args. It's even more powerful than that though. You can also supply an object where the value your matching against actually comes from a totally different node than the one being observed.

@@ -181,2 +170,32 @@ One note, to simplify writing tests, if `match` is supplied and the value already matches it will not setup an observer but will just return right away. Without this you'd have to write something like:

---
**readRegistry(args: [ODCReadRegistryArgs](https://github.com/triwav/roku-test-automation/blob/3dad049dac6e17b278a873341757dd296011d213/server/src/types/OnDeviceComponentRequest.ts#L90), options: [ODCRequestOptions](https://github.com/triwav/roku-test-automation/blob/master/server/src/types/OnDeviceComponentRequest.ts#L84)): {
values: {
[section: string]: {[sectionItemKey: string]: string}
}
}**
Allows for reading from the registry. If no specific sections are requested then it will return the entire contents of the registry
---
**writeRegistry(args: [ODCWriteRegistryArgs](https://github.com/triwav/roku-test-automation/blob/3dad049dac6e17b278a873341757dd296011d213/server/src/types/OnDeviceComponentRequest.ts#L96), options: [ODCRequestOptions](https://github.com/triwav/roku-test-automation/blob/master/server/src/types/OnDeviceComponentRequest.ts#L84))**
Allows for writing to the registry. If `null` is passed for a sectionItemKey that key will be deleted. If `null` is passed for a section that entire section will be deleted.
---
**deleteRegistrySections(args: [ODCDeleteRegistrySectionsArgs](https://github.com/triwav/roku-test-automation/blob/3dad049dac6e17b278a873341757dd296011d213/server/src/types/OnDeviceComponentRequest.ts#L102), options: [ODCRequestOptions](https://github.com/triwav/roku-test-automation/blob/master/server/src/types/OnDeviceComponentRequest.ts#L84))**
Allows for deleting sections from the registry. Similar functionality can be achieved with `writeRegistry` passing null sections but helps to make it clearer if a mixed model isn't needed.
---
**deleteEntireRegistry(args: [ODCDeleteRegistrySectionsArgs](https://github.com/triwav/roku-test-automation/blob/3dad049dac6e17b278a873341757dd296011d213/server/src/types/OnDeviceComponentRequest.ts#L108), options: [ODCRequestOptions](https://github.com/triwav/roku-test-automation/blob/master/server/src/types/OnDeviceComponentRequest.ts#L84))**
Provides a way to clear out all sections in registry. Uses `deleteRegistrySections` under the hood but makes it clearer what is being done
---
### **RokuDevice**

@@ -186,2 +205,25 @@

---
### **NetworkProxy**
This class serves as a wrapper around the [http-network-proxy](https://www.npmjs.com/package/http-network-proxy) npm module. It is still in active development and will change some as testing shows necessary changes. At it's core the idea is to be able to take a [Charles](https://www.charlesproxy.com/) config file and use those same rules in your tests. The following methods are exposed:
`start(configFilePath: string = 'charlesRewrite.xml')`
sets up the proxy, loads the provided config in and writes to the device's registry to get it ready to proxy requests.
`stop()`
Used to shutdown the proxy port when you no longer want to proxy. Also sends an ODC request to the device
`reloadConfig(configFilePath: string = 'charlesRewrite.xml')`
Gives the ability to reload the config without having to stop and restart the entire proxy
`addBreakPointListener(onProxyRequestCallback: OnProxyRequestCallback)`
Allows you add a callback that will be called for every breakpoint Charles would have run into
`observeRequest(url: string, onProxyResponseCallback: OnProxyResponseCallback)`
Provides a simplified way of receiving a callback when a url is accessed without needing to create a Charles config file for that case.
---
### **utils**

@@ -188,0 +230,0 @@

@@ -461,4 +461,7 @@ "use strict";

if (currentFrame.typeName === 'OnDeviceComponent') {
// Go back one to get to the actual call that the user made
// Go back one to get to the actual call that the user made if it exists
var frame = stackTrace[i + 1];
if (!frame) {
frame = currentFrame;
}
return "(" + frame.fileName + ":" + frame.lineNumber + ":" + frame.columnNumber + ")";

@@ -465,0 +468,0 @@ }

@@ -224,3 +224,3 @@ "use strict";

id = (_a.sent()).id;
expect(id).to.equal('subchild2');
expect(id).to.equal('loginButton');
return [2 /*return*/];

@@ -234,10 +234,9 @@ }

it('should return true when current node has focus', function () { return __awaiter(_this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = expect;
return [4 /*yield*/, _1.odc.hasFocus({ base: 'scene', keyPath: 'subchild2' })];
var hasFocus;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, _1.odc.hasFocus({ base: 'scene', keyPath: 'pagesContainer.loginButton' })];
case 1:
_a.apply(void 0, [_b.sent()]).to.be.true;
hasFocus = _a.sent();
expect(hasFocus).to.be.true;
return [2 /*return*/];

@@ -264,10 +263,9 @@ }

it('should return true when current node is in focus chain', function () { return __awaiter(_this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = expect;
return [4 /*yield*/, _1.odc.isInFocusChain({ base: 'scene', keyPath: 'child2' })];
var isInFocusChain;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, _1.odc.isInFocusChain({ base: 'scene', keyPath: 'pagesContainer.loginButton' })];
case 1:
_a.apply(void 0, [_b.sent()]).to.be.true;
isInFocusChain = _a.sent();
expect(isInFocusChain).to.be.true;
return [2 /*return*/];

@@ -274,0 +272,0 @@ }

@@ -112,5 +112,3 @@ import * as express from 'express';

export interface ODCNodeRepresentation {
id: string;
focusedChild: ODCNodeRepresentation;
focusable: boolean;
[key: string]: any;
change: {

@@ -121,16 +119,21 @@ Index1: number;

};
visible?: boolean;
childRenderOrder?: 'renderFirst' | 'renderLast';
children: ODCNodeRepresentation[];
clippingRect?: [number, number, number, number];
enableRenderTracking?: boolean;
focusedChild: ODCNodeRepresentation;
focusable: boolean;
id: string;
inheritParentOpacity?: boolean;
inheritParentTransform?: boolean;
muteAudioGuide?: boolean;
opacity?: number;
translation?: [number, number];
renderPass?: number;
renderTracking?: 'none' | 'partial' | 'full';
rotation?: number;
scale?: [number, number];
scaleRotateCenter?: [number, number];
childRenderOrder?: 'renderFirst' | 'renderLast';
inheritParentTransform?: boolean;
inheritParentOpacity?: boolean;
clippingRect?: [number, number, number, number];
renderPass?: number;
muteAudioGuide?: boolean;
enableRenderTracking?: boolean;
renderTracking?: 'none' | 'partial' | 'full';
subtype: string;
translation?: [number, number];
visible?: boolean;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc