test-framework-001
v0.0.22
Published
BDD Test Framework For Sample Apps
Downloads
8
Maintainers
Readme
Step definitions
Given steps
Step | Summary ----- | ------- Given the "<actorName>" is on the "<pageName>" page of the "<appName>" app | Opens the application landing page in a new browser based on the app config defined in test.config.jsonDetailsExamples:Given the "Host" is on the "create-event" page of the "events" appGiven the "Viewer" is on the "join-event" page of the "events" appMethod:openLandingPageOfAppUsingConfig(scenarioWorld: ScenarioWorld, actorName: string, pageName: string, appName: string): Promise<void> Given the "<actorName>" is on the "<pageName>" page of the "<appName>" app with the "<appURL>" URL | Opens the application landing page in a new browser based on the URLDetailsExamples:Given the "Host" is on the "create-event" page of the "events" app with the "http://localhost:3000/Meeting" URLGiven the "Viewer" is on the "join-event" page of the "events" app with the "http://localhost:3000/Meeting/watch" URLMethod:openLandingPageOfAppUsingURL(scenarioWorld: ScenarioWorld, actorName: string, pageName: string, appName: string, url: string): Promise<void>
When steps
Step | Summary ----- | ------- When (the <actorName>|I) (check|checks|select|selects) the "<elementSelectorName>" | Check a checkbox or radio buttonDetailsExamples:When the host checks the "simulcast option"When I select the "debugging option"Method:checkTheCheckbox(scenarioWorld: ScenarioWorld, selectorName: string): Promise<void> When (the <actorName>|I) (uncheck|unchecks|unselect|unselects) the "<elementSelectorName>" | Uncheck a checkbox or radio buttonDetailsExamples:When the host unchecks the "simulcast option"When I unselect the "debugging option"Method:uncheckTheCheckbox(scenarioWorld: ScenarioWorld, selectorName: string): Promise<void> When (the <actorName>|I) (check|checks|select|selects) the "<elementSelectorName>" with the placeholder "<placeHolderName:placeHolderValue>" | Check a checkbox or radio button by replacing the placeholder name with a value in the element selectorDetailsExamples:When the host checks the "role option" with the placeholder "ROLENAME:Auditor"When I select the "logging option" with the placeholder "LOGGER:debug"Method:checkTheCheckbox(scenarioWorld: ScenarioWorld, selectorName: string, options: {placeholderPair: string}): Promise<void> When (the <actorName>|I) (uncheck|unchecks|unselect|unselects) the "<elementSelectorName>" with placeholder "<placeHolderName:placeHolderValue>" | Uncheck a checkbox or radio button by replacing the placeholder name with a value in the element selectorDetailsExamples:When the user unchecks the "role option" with the placeholder "ROLENAME:Auditor"When I unselect the "logging option" with the placeholder "LOGGER:debug"Method:uncheckTheCheckbox(scenarioWorld: ScenarioWorld, selectorName: string, options: {placeholderPair: string}): Promise<void> When (the <actorName>|I) (clicks|click) on the "<elementSelectorName>" | Click on an elementDetailsExamples:When the host clicks on the "next button"When I click on the "continue button"Method:clickOnTheElement(scenarioWorld: ScenarioWorld, selectorName: string): Promise<void> When (the <actorName>|I) (clicks|click) on the "<elementSelectorName>" with the placeholder "<placeHolderName:placeHolderValue>" | Click on an element by replacing the placeholder name with a value in the element selectorDetailsExamples:When the host clicks on the "video view" with the placeholder "USERNAME:John"When I click on the "video tab" with the placeholder "VIDEONAME:ScreenShare" Method:clickOnTheElementBasedOnPlaceHolder(scenarioWorld: ScenarioWorld, selectorName: string, options: {placeholderPair: string}): Promise<void> When (the <actorName>|I) (store|stores) the clipboard text as a "<variableName>" variable | Store the clipboard text in the local storeDetailsExamples:When the user stores the clipboard text as a "VIEWER_URL" variableWhen I store the clipboard text as a "CO_HOST_URL" variableMethod:storeClipboardText(scenarioWorld: ScenarioWorld, dataStoreType: string, variableName: string): Promise<void> When (the <actorName>/I) (store|stores) the clipboard text as a "<variableName>" variable in (local|global) data store | Store the clipboard text in the local or global data storeDetailsExamples:When the user stores the clipboard text a "VIEWER_URL" variable in the local data storeWhen I store the clipboard text as a "CO_HOST_URL" variable in the global data storeMethod:storeClipboardText(scenarioWorld: ScenarioWorld, dataStoreType: string, variableName: string): Promise<void> When (the <actorName>|I) (hover|hovers) the mouse over the "<elementSelectorName>" | Hover the mouse over the elementDetailsExamples:When the publisher hovers the mouse over the "footer"When I hover the mouse over the "next button"Method:hoverOverTheElement(scenarioWorld: ScenarioWorld, selectorName: string): Promise<void> When (the <actorName>|I) (enters|enter) the "<textToEnter>" text in the "<elementSelectorName>" | Enter the text in an input fieldDetailsExamples:When the host enters the "John Bond" text in the "username input field"When I enter the "Meeting" text in the "meetingname input field"Method:enterTextInInputField(scenarioWorld: ScenarioWorld, selectorName: string, inputText: string): Promise<void> When (the <actorName>|I) (clears|clear) the text from the "<elementSelectorName>" | Clears the text from an input fieldDetailsExamples:When the host clears the text from the "username input field"When I clear the text from the "meetingname input field"Method:clearTextFromInputField(scenarioWorld: ScenarioWorld, selectorName: string): Promise<void> When (the <actorName>|I) (refresh|refreshes) the page | Refresh the pageDetailsExamples:When the host refreshes the pageWhen I refresh the pageMethod:refreshThePage(scenarioWorld: ScenarioWorld): Promise<void> When "<actorName>" switch to "<pageName>" page of the "<appName>" app | Switch to another page when multiple pages are openedDetailsExamples:When the "Host" switch to "create-event" page of the "events" appWhen the "Viewer" switch to "join-event" page of the "events" appMethod:switchToPage(scenarioWorld: ScenarioWorld, actorName: string, pageName: string, appName: string): Promise<void> When (the <actorName>|I) (store|stores) the "<elementSelectorName>" text as a "<variableName>" variable in the (local|global) data store | Read the element text and store in the local or global data storeDetailsExamples:When the host stores the "viewer link" text as a "VIEWER_URL" variable in the local data storeWhen I store the "timer" text as a "TIMER_VALUE" variable in the global data storeMethod:storeElementText(scenarioWorld: ScenarioWorld, selectorName: string, dataStoreType: string, variableName: string): Promise<void> When (the <actorName>|I) (store|stores) the "<elementSelectorName>" value as a "<variableName>" variable in the (local|global) data store | Read the element value and store in the local or global data storeDetailsExamples:When the host store the "meetingname input field" value as a "MEETING_NAME" variable in the local data storeWhen I store the "username input field" value as a "USER_NAME" variable in the global data storeMethod:storeElementValue(scenarioWorld: ScenarioWorld, selectorName: string, dataStoreType: string, variableName: string): Promise<void> When (the <actorName>|I) (store|stores) the "<elementSelectorName>" text as a "<variableName>" in the environment variable | Read the element text and store in the environment variableDetailsExamples:When the host store the "viewer link" text as a "VIEWER_URL" in the environment variableWhen I store the "timer" text as a "TIMER_VALUE" in the environment variableMethod:storeElementText(scenarioWorld: ScenarioWorld, selectorName: string, dataStoreType: string, variableName: string): Promise<void> When (the <actorName>/I) (store|stores) the "<elementSelectorName>" value as a "<variableName>" in the environment variable | Read the element value and store in the environment variableDetailsExamples:When the host store the "meetingname input field" value as a "MEETING_NAME" in the environment variableWhen I store the "username input field" value as a "USER_NAME" in the environment variableMethod:storeElementValue(scenarioWorld: ScenarioWorld, selectorName: string, dataStoreType: string, variableName: string): Promise<void> When (the <actorName>|I) (take|takes) the screenshot of the "<elementSelectorName>" and save it with the name "<fileName>" | Take a screenshot of the element and store itDetailsExamples:When the host takes the screenshot of the "video tile" and save it with the name "host_video_tile"Method:takeScreenOfElement(scenarioWorld: ScenarioWorld, selectorName: string, imgName: string): Promise<void> When (the <actorName>|I) (take|takes) the screenshot of the "<elementSelectorName>" with the mask "<elementSelectorName>" and save it with the name "<fileName>" | Take the screenshot of the element by masking some elements by pink box and store itDetailsExamples:When the host takes the screenshot of the "video tile" with the mask "speaking indicator icon" and save it with the name "host_video_tile"Method:takeScreenOfElement(scenarioWorld: ScenarioWorld, selectorName: string, imgName: string, {maskSelectorNames: string}): Promise<void> When (the <actorName>|I) (wait|waits) for "<secondsToWait>" seconds | Wait for given secondsDetailsExamples:When the host waits for "10" secondsMethod:waitForSeconds(seconds: number): Promise<void> When (the <actorName>|I) (wait|waits) for "<minutesToWait>" minutes | Wait for the given minutesDetailsExamples:When the host waits for "2" minutesMethod:waitForSeconds(seconds: number): Promise<void>
Then steps
Step | Summary ----- | ------- Then the clipboard text should( not)? be equal to "<expectedText>" | Verify the clipboard textDetailsExamples:Then the clipboard text should be equal to "http://localhost:3000/meet/"Method:verifyClipboardText(expectedText: string, options: {not: boolean}): Promise<boolean> Then the clipboard text should( not)? be equal to the stored "<variabeName>" variable from the (local|global) data store | Verify the clipboard text to the stored variable value from the (local|global) data storeDetailsExamples:Then the clipboard text should be equal to the stored "HOST_LINK" variable from the local data storeMethod:verifyClipboardTextFromDataStore(scenarioWorld: ScenarioWorld, dataStoreType: string, variableName: string, options: {not: boolean}): Promise<boolean> Then the "<elementSelectorName>" count should( not)? be "<expectedCount>" | Verify the number of elementsDetailsExamples:Then the "input field" count should be "2"Method:verifyElementCount(scenarioWorld: ScenarioWorld, selectorName: string, expectedCount: string, options: {not: boolean}): Promise<boolean> Then the "<elementSelectorName>" should( not)? be "<expectedElementState>" | Verify element state such as displayed | visible | invisible | hidden | enabled | disabled | editable | checked | selectedDetailsExamples:Then the "username input field" should be "displayed"Then the "next button" should be "enabled"Method:verifyElementState(scenarioWorld: ScenarioWorld, selectorName: string, expectedState: string, options: {not: boolean}): Promise<boolean> Then the "<elementSelectorName>" with the placeholder "<placeHolderName:placeHolderValue>" should( not)? be "<expectedElementState>" | Verify element state such as displayed | visible | invisible | hidden | enabled | disabled | editable | checked | selected by replacing placeholder name with value in the element selectorDetailsExamples:Then the "video tile" with the placeholder "NAME:John" should be "displayed"Then the "video tile" with the placeholder "NAME:Jony" should not be "displayed"Method:verifyElementState(scenarioWorld: ScenarioWorld, selectorName: string, expectedState: string, options: {placeholderPair: string, not: boolean}): Promise<boolean> Then the "<elementSelectorName>" text should( not)? be "<expectedText>" | Verify element textDetailsExamples:Then the "meeting name" text should be "All-Hands"Then the "timer" text should not be "00:00:00"Method:verifyElementText(scenarioWorld: ScenarioWorld, selectorName: string, expectedText: string, options: {not: boolean}): Promise<boolean> Then the "<elementSelectorName>" text should( not)? contain "<expectedText>" | Verify element contains textDetailsExamples:Then the "app version" text should contain "SDK"Then the "app version" text should not contain "RTS"Method:verifyElementContainText(scenarioWorld: ScenarioWorld, selectorName: string, expectedText: string, options: {not: boolean}): Promise<boolean> Then the "<elementSelectorName>" value should( not)? be "<expectedValue>" | Verify element valueDetailsExamples:Then the "username input field" value should be "John"Then the "username input field" value should not be "Jony"Method:verifyElementValue(scenarioWorld: ScenarioWorld, selectorName: string, expectedValue: string, options: {not: boolean}): Promise<boolean> Then the "<elementSelectorName>" attribute "<attributeName>" value should( not)? be "<attributeValue>" | Verify element attribute valueDetailsExamples:Then the "user name input field" attribute "placeholder" value should be "Enter your name"Method:verifyElementText(scenarioWorld: ScenarioWorld, selectorName: string, expectedText: string, options: {not: boolean}): Promise<boolean> Then the image "<image1>" should( not)? be equal to image "<image2>" | Verify that the two images are sameDetailsExamples:Then the image "<image1>" should be equal to image "<image2>"Then the image "<image1>" should not be equal to image "<image2>"Method:verifyImage(scenarioWorld: ScenarioWorld, image1: string, image2: string, options: {not: boolean}): Promise<boolean> Then (the <actorName>|I) should be navigated to the "<pageName>" page | Verify that the user is navigated to another pageDetailsExamples:Then the host should be navigated to the "device-setup" pageThen I should be navigated to the "rejoin-meeting" pageMethod:verifyNavigateToPage(scenarioWorld: ScenarioWorld, pageName: string): Promise<boolean>