Test for the new method.

anticaptcha
Pedro de Oliveira Guedes 2022-01-05 15:04:25 -03:00
parent 1477673c5d
commit 739b21ddd1
2 changed files with 19 additions and 1 deletions

View File

@ -27,4 +27,11 @@ Feature: The Chrome API client
And a Chrome instance
And the id of a new Google Chrome tab opened
When the close method is called upon the tab id
Then the tab must close
Then the tab must close
Scenario: Using the Chrome.eval method
Given the Chrome client
And a Chrome instance
And the id of a new Google Chrome tab opened
When the eval method is called upon the tab id with a command
Then this command must give back a value

View File

@ -66,3 +66,14 @@ def step_impl(context):
def step_impl(context):
assert context.close_return == "", "The tab did not closed correctly."
context.client.stop()
# ========================== Chrome.eval () ==========================
@when("the eval method is called upon the tab id with a command")
def step_impl(context):
context.eval_value = context.client.eval(context.tab_id1, "2+2")
@then("this command must give back a value")
def step_impl(context):
assert 'value' in context.eval_value['result']['result'], "The command did not worked as expected."
context.client.stop()