2022-01-05 13:30:34 +00:00
|
|
|
Feature: The Chrome API client
|
2022-01-06 14:14:52 +00:00
|
|
|
# ======================== Chrome.start() ========================
|
2022-01-05 15:22:36 +00:00
|
|
|
Scenario: Using the Chrome.start method
|
2022-01-05 13:30:34 +00:00
|
|
|
Given the Chrome client
|
2022-01-05 15:22:36 +00:00
|
|
|
When the start method is called
|
2022-01-05 17:11:36 +00:00
|
|
|
Then Google Chrome must open
|
2022-01-06 14:14:52 +00:00
|
|
|
|
|
|
|
# ======================== Chrome.start_headless() ========================
|
2022-01-05 15:22:36 +00:00
|
|
|
Scenario: Using the Chrome.start_headless method
|
|
|
|
Given the Chrome client
|
|
|
|
When the start_headless method is called
|
2022-01-05 17:11:36 +00:00
|
|
|
Then Google Chrome must open headless
|
2022-01-05 15:22:36 +00:00
|
|
|
|
2022-01-06 14:14:52 +00:00
|
|
|
# ======================== Chrome.stop() ========================
|
2022-01-05 15:22:36 +00:00
|
|
|
Scenario: Using the Chrome.stop method
|
|
|
|
Given the Chrome client
|
|
|
|
And a Chrome instance
|
|
|
|
When the stop method is called upon it
|
2022-01-05 17:11:36 +00:00
|
|
|
Then this Google Chrome instance must close
|
2022-01-06 14:14:52 +00:00
|
|
|
|
|
|
|
# ======================== Chrome.new() ========================
|
2022-01-05 17:11:36 +00:00
|
|
|
Scenario: Using the Chrome.new method
|
|
|
|
Given the Chrome client
|
|
|
|
And a Chrome instance
|
|
|
|
When the new method is called
|
|
|
|
Then a new Google Chrome tab with the url given must open in the instance
|
2022-01-06 14:14:52 +00:00
|
|
|
|
|
|
|
# ======================== Chrome.close() ========================
|
2022-01-05 17:11:36 +00:00
|
|
|
Scenario: Using the Chrome.close method
|
|
|
|
Given the Chrome 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
|
2022-01-05 18:04:25 +00:00
|
|
|
Then the tab must close
|
2022-01-06 14:14:52 +00:00
|
|
|
|
|
|
|
# ======================== Chrome.eval() ========================
|
2022-01-06 11:20:44 +00:00
|
|
|
Scenario: Using the Chrome.eval method for arithmetics
|
2022-01-05 18:04:25 +00:00
|
|
|
Given the Chrome client
|
|
|
|
And a Chrome instance
|
|
|
|
And the id of a new Google Chrome tab opened
|
2022-01-06 11:20:44 +00:00
|
|
|
When the eval method is called upon the tab id with a arithmetic command
|
|
|
|
Then this command must give back the result as a value
|
|
|
|
|
|
|
|
Scenario: Using the Chrome.eval method for JavaScript commands
|
|
|
|
Given the Chrome client
|
|
|
|
And a Chrome instance
|
|
|
|
And the id of a new Google Chrome tab opened in google.com
|
|
|
|
When the eval method is called upon the tab id with a JS command
|
2022-01-06 14:14:52 +00:00
|
|
|
Then this command must give back the element requested as a value
|
|
|
|
|
|
|
|
# ======================== Chrome.wait() ========================
|
|
|
|
Scenario: Using the Chrome.wait method
|
|
|
|
Given the Chrome client
|
|
|
|
And a Chrome instance
|
|
|
|
And the id of a new Google Chrome tab opened in google.com
|
|
|
|
When the wait method is called upon the tab id with a JS command
|
|
|
|
Then this method must return the string 'ok'
|
|
|
|
|
|
|
|
# ======================== Chrome.send() ========================
|
|
|
|
# This method cannot be tested, given it's return cannot be predicted.
|
|
|
|
# Therefore, there will be no testes for this method, at least for now.
|
|
|
|
|
|
|
|
# ======================== Chrome.open_tabs() ========================
|
|
|
|
Scenario: Using the Chrome.open_tabs method
|
|
|
|
Given the Chrome client
|
|
|
|
And a Chrome instance
|
|
|
|
And at least one Google Chrome tab is opened
|
|
|
|
When the open_tabs method is called
|
|
|
|
Then it must return a list of dictionaries containing the tabs data
|