Skip to content

Commit

Permalink
Merge branch 'dev' into player-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandana-NNR committed Oct 30, 2024
2 parents 2570746 + efa81ba commit 8bae4f6
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 24 deletions.
62 changes: 45 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ It has the following features -

## Table of Contents

- [Brief overview](#brief-overview)
- [Setup](#setup)
- [FCA URL deployed and available in the S3](#fca-url-deployed-and-available-in-the-s3)
- [Below are the steps to run FCA in local system](#below-are-the-steps-to-run-fca-in-local-system)
- [Supported ways of Execution](#supported-ways-of-execution)
- [Sanity Suite Flow](./docs/index.md)
- [Supported targets](#supported-targets)
- [Supported Modes of execution](#supported-modes-of-execution)
- [Supported validations](#supported-validations)
- [Supported ways of retrieving reports](#supported-ways-of-retrieving-reports)
- [Supported Report Parameters](#supported-report-parameters)
- [PR and merge process](#pr-and-merge-process)
- [Supported URL parameters](#supported-url-parameters)
- [Supported PubSub Handlers](#supported-pubsub-handlers)
- [Plugins](#plugins)
- [Connect to mock Firebolt OS](#connect-to-mock-firebolt-os)
- [Timeout in UI prompt](#timeout-in-ui-prompt)
- [firebolt-certification-app](#firebolt-certification-app)
- [Brief overview](#brief-overview)
- [Table of Contents](#table-of-contents)
- [Setup](#setup)
- [FCA URL deployed and available in the S3](#fca-url-deployed-and-available-in-the-s3)
- [Below are the steps to run FCA in local system](#below-are-the-steps-to-run-fca-in-local-system)
- [Supported ways of Execution](#supported-ways-of-execution)
- [Supported targets](#supported-targets)
- [Supported Modes of execution](#supported-modes-of-execution)
- [Supported validations](#supported-validations)
- [Supported ways of retrieving reports](#supported-ways-of-retrieving-reports)
- [Supported Report Parameters](#supported-report-parameters)
- [PR and merge process](#pr-and-merge-process)
- [Supported URL parameters](#supported-url-parameters)
- [Supported Intent Parameters](#supported-intent-parameters)
- [Supported PubSub Handlers](#supported-pubsub-handlers)
- [Plugins](#plugins)
- [Connect to mock Firebolt OS](#connect-to-mock-firebolt-os)
- [Timeout in UI prompt](#timeout-in-ui-prompt)

## Setup

Expand Down Expand Up @@ -113,6 +115,32 @@ Mode of execution implies the way in which an API is invoked. There are 2 modes
- If FCA systemui=true, FCA acts as the base app in case of ripple. The background color will be changed to purple and it will display one more button as "Launch FCA app" to launch FCA as third-party app on Ripple devices.
- TestContext: testContext=true
- If testContext=true, it will add the field context in mocha report generated
- AppId: appId=`<appId>`
- `appId` used to launch the app.
- Mac Address: macAddress=`<macAddress>`
- `macAddress` of the device running the tests.
- appType: appType=`<appType>`
- `appType` is the type of app being launched.
- Pub Sub Subscribe suffix : pubSubSubscribeSuffix=`<pubSubSubscribeSuffix>`
- `pubSubSubscribeSuffix` is the subscribe suffix value used for Pub Sub communication.
- Pub Sub Publish suffix : pubSubPublishSuffix=`<pubSubPublishSuffix>`
- `pubSubPublishSuffix` is the publish suffix value used for Pub Sub communication.

## Supported Intent Parameters
- appType:
- Classifier for the app - Launch the certification app for certification validations. Launching a firebolt app for app certification.
- appId:
- When `appId` is specified in the intent, it will be used to launch the app.
- macAddress:
- When `macAddress` is specified in the intent, it indicates the mac address of the device running the tests.
- PubSub Publish Suffix:
- When `pubSubPublishSuffix` is specified in the intent, it publishes to the topic.
- PubSub Subscribe Suffix:
- When `pubSubSubscribeSuffix` is specified in the intent, it subscribes to the topic.
- pubSubUrl:
- Sets the the url to use for a PubSub server.
- registerprovider:
- When `registerProvider = false`, then certification app will not register for userInterest provider.

## Supported PubSub Handlers

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"perf_hooks": "^0.0.1",
"rxjs": "7.2.0",
"uuid": "^9.0.0",
"winston": "3.13.1",
"winston": "3.15.0",
"winston-transport": "4.7.1",
"xml2js": "^0.5.0"
},
"scripts": {
Expand Down
12 changes: 11 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export default class App extends Base {

// Set the pubSub URL if present
process.env.PUB_SUB_URL = new URLSearchParams(window.location.search).get('pubSubUrl');
process.env.MACADDRESS = new URLSearchParams(appUrl.search).get('macaddress');
process.env.CURRENT_APPID = new URLSearchParams(appUrl.search).get('appId');
process.env.APP_TYPE = new URLSearchParams(appUrl.search).get('appType');
process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = new URLSearchParams(appUrl.search).get('pubSubSubscribeSuffix');
process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX = new URLSearchParams(appUrl.search).get('pubSubPublishSuffix');

if (platform) {
process.env.PLATFORM = platform;
Expand Down Expand Up @@ -159,7 +164,6 @@ export default class App extends Base {
this.pubSubListener();
}
getCurrentAppID().then((res) => {
process.env.APPID = res;
this._setState('LoadingState');
});
}
Expand Down Expand Up @@ -391,7 +395,13 @@ export default class App extends Base {
if (lifecycle_validationString == true) {
process.env.LIFECYCLE_VALIDATION = 'true';
}
if (query.params.pubSubPublishSuffix) {
process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX = query.params.pubSubPublishSuffix;
}

if (query.params.pubSubSubscribeSuffix) {
process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = query.params.pubSubSubscribeSuffix;
}
process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST;

try {
Expand Down
2 changes: 2 additions & 0 deletions src/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,6 @@ export const CONSTANTS = {
VERSIONS: 'Versions',
NO_RESULT_OR_ERROR_MESSAGE: 'No result or error in response. eg: {jsonrpc: "2.0", id: x }',
SCHEMA_VALIDATION: 'Schema Validation',
DEFAULT_APP_ID: 'DEFAULT_APP_ID',
DEFAULT_MAC: 'DEFAULT_MAC',
};
4 changes: 2 additions & 2 deletions src/pubSubClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class PubSubClient {
constructor() {
this.ws = null;
this.url = process.env.PUB_SUB_URL ? process.env.PUB_SUB_URL : 'ws://localhost:8080';
this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = '_FCS';
this.PUBSUB_PUBLISH_TOPIC_SUFFIX = '_FCA';
this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX ? process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX : '_FCS';
this.PUBSUB_PUBLISH_TOPIC_SUFFIX = process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX ? process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX : '_FCA';
}

// Initializes a WS connection
Expand Down
10 changes: 7 additions & 3 deletions src/utils/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ function pushReportToS3(report) {
}
});
});
} else {
process.env.MACADDRESS = CONSTANTS.DEFAULT_MAC;
macAddress = process.env.MACADDRESS;
}
} else {
macAddress = process.env.MACADDRESS;
Expand Down Expand Up @@ -327,7 +330,7 @@ function removeSetInMethodName(apiName) {
* @description get the current appid with Advertising.appBundleId
*/
async function getCurrentAppID() {
if (!process.env.CURRENT_APPID || !process.env.APPID) {
if (!process.env.CURRENT_APPID) {
try {
let res = await FireboltExampleInvoker.get().invoke(CONSTANTS.CORE.toLowerCase(), 'Advertising.appBundleId', []);
const lastIndex = res.lastIndexOf('.');
Expand All @@ -336,7 +339,8 @@ async function getCurrentAppID() {
return res;
} catch (error) {
logger.error('Error while calling Advertising.appBundleId : ' + error, 'App getAppId');
return error;
process.env.CURRENT_APPID = CONSTANTS.DEFAULT_APP_ID;
return process.env.CURRENT_APPID;
}
}
}
Expand Down Expand Up @@ -396,7 +400,7 @@ async function overrideParamsFromTestData(methodObj) {
try {
const paramsJson = testDataHandler('overrideParams');
if (paramsJson && typeof paramsJson == 'object' && Object.keys(paramsJson).length) {
const appID = process.env.APPID;
const appID = process.env.CURRENT_APPID;
// Checking if any data present for the passed appId
const parsedMethod = paramsJson[appID];
// Fetching the examples from the parsedMethod
Expand Down

0 comments on commit 8bae4f6

Please sign in to comment.