Skip to content

Commit

Permalink
first scenario from multi-source scope - viewer projects specified so…
Browse files Browse the repository at this point in the history
…urceId
  • Loading branch information
jwrobdolby committed Nov 12, 2024
1 parent eca0346 commit 8385430
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Feature: Multi-source feature

Scenario: Publisher streams with specified sourceId and Viewer projects media
Given the "publisher1" opens "Publisher" app
When the "publisher1" starts the stream with the specified options
| codec | h264 |
| sourceId | CAM1 |
And the "publisher1" stream should be LIVE

When the "viewer1" opens "Viewer" app
And the "viewer1" connected stream should be LIVE
And the "viewer1" projects sourceId "CAM1"

Then the "viewer1" should be able to view media tracks for the connected stream

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { When } from "@cucumber/cucumber";
import { ScenarioWorld } from "cucumber-playwright-framework";
import { viewerProject } from "../stepsImpl/viewerProject.step.impl";

When(
/^the "([^"]*)" projects sourceId "([^"]*)"$/,
async function (this: ScenarioWorld, actor: string, sourceId: string) {
await viewerProject(this, actor, sourceId);
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ScenarioWorld, logger, runStep } from "cucumber-playwright-framework";

export async function viewerProject(
scenarioWorld: ScenarioWorld,
actor: string,
sourceId: string,
) {
logger.debug(`viewerProject function was called`);

await runStep([
`the ${actor} switch to the "Viewer" app`,
`the ${actor} executes the "window.millicastView.project('${sourceId}', [{'media': 'video'} , {'media': 'audio'}])" JavaScript function on the page`,
], scenarioWorld);
}

0 comments on commit 8385430

Please sign in to comment.