Skip to content

Added smartui sample #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def before_scenario(context, scenario):
options = EdgeOptions()
options.browser_version = desired_cap.get("version", "latest")
options.platform_name = "Windows 8"
elif 'SmartUI' in scenario.tags:
options = ChromeOptions()
options.browser_version = desired_cap.get("version", "latest")
options.set_capability('smartUI.project','Python-Behave-sample')
else:
raise ValueError("Unsupported browser tag")

Expand Down
6 changes: 5 additions & 1 deletion features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ def step(context, text):
@then('click the "{button}"')
def step(context, button):
element = wait_for_element(context, By.ID, button)
element.click()
element.click()

@then('take smartui snapshot')
def step(context):
context.browser.execute_script("smartui.takeScreenshot= to-do")
8 changes: 7 additions & 1 deletion features/test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ Feature: Automate a website
When field with name "First Item" is present check the box
When field with name "Second Item" is present check the box
When select the textbox add "Let's add new to do item for Edge" in the box
Then click the "addbutton"
Then click the "addbutton"

@SmartUI
Scenario: Capture smartui snapshot
When visit url "https://lambdatest.github.io/sample-todo-app"
When check if title is "Sample page - lambdatest.com"
Then take smartui snapshot
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Paver==1.3.4
selenium>4.23.0
behave==1.2.6
behavex==1.6.0
behavex>1.6.0