Moved Selenium web driver to WebDriver-Eiffel repository
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
note
|
||||
description : "project application root class"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
ARGUMENTS
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
-- Run application.
|
||||
do
|
||||
execute_search
|
||||
end
|
||||
|
||||
execute_example1
|
||||
do
|
||||
(create {EXAMPLE_1}).test
|
||||
end
|
||||
|
||||
execute_search
|
||||
do
|
||||
(create {EXAMPLE_SEARCH}).search
|
||||
end
|
||||
end
|
||||
@@ -1,58 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {EXAMPLE_1}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
EXAMPLE_1
|
||||
|
||||
feature -- Access
|
||||
test
|
||||
local
|
||||
web_driver: SE_JSON_WIRE_PROTOCOL
|
||||
capabilities: SE_CAPABILITIES
|
||||
l_session : detachable SE_SESSION
|
||||
do
|
||||
create web_driver.make
|
||||
if attached web_driver.status as l_status then
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
l_session:= web_driver.create_session_with_desired_capabilities (capabilities)
|
||||
if attached l_session as l_s then
|
||||
|
||||
-- navigate to www.google.com
|
||||
web_driver.navigate_to_url (l_s.session_id, "http://www.google.com/")
|
||||
|
||||
-- Find the text input element by its name
|
||||
if attached {WEB_ELEMENT} web_driver.search_element (l_s.session_id, (create {SE_BY}).name ("q")) as l_element then
|
||||
-- search something
|
||||
web_driver.send_event(l_s.session_id, l_element.element,<<"Eiffel Room">>)
|
||||
|
||||
-- Submit Form
|
||||
web_driver.element_submit (l_s.session_id, l_element.element)
|
||||
|
||||
if attached web_driver.page_title (l_s.session_id) as l_page then
|
||||
print ("Page Name" + l_page)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- // And now use this to visit Google
|
||||
-- driver.get("http://www.google.com");
|
||||
|
||||
-- // Find the text input element by its name
|
||||
-- WebElement element = driver.findElement(By.name("q"));
|
||||
|
||||
-- // Enter something to search for
|
||||
-- element.sendKeys("Cheese!");
|
||||
|
||||
-- // Now submit the form. WebDriver will find the form for us from the element
|
||||
-- element.submit();
|
||||
|
||||
-- // Check the title of the page
|
||||
-- System.out.println("Page title is: " + driver.getTitle());
|
||||
end
|
||||
@@ -1,72 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {EXAMPLE_SEARCH}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
EXAMPLE_SEARCH
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Example
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to Google
|
||||
web_driver.to_url ("http://www.google.com/")
|
||||
|
||||
-- Find the text input element by its name
|
||||
if attached web_driver.find_element ((create {SE_BY}).name ("q")) as l_element then
|
||||
|
||||
-- Enter something to search for
|
||||
l_element.send_keys (<<"Eiffel Room">>)
|
||||
|
||||
-- Now submit the form. WebDriver will find the form for us from the element
|
||||
l_element.submit
|
||||
end
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
|
||||
-- Google's search is rendered dynamically with JavaScript.
|
||||
-- Wait for the page to load, timeout after 10 seconds
|
||||
create wait.make (web_driver, 10)
|
||||
wait.until_when (agent expected_title(web_driver, "Eiffel Room"))
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
expected_title (driver: WEB_DRIVER; title: STRING_32): BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="selenium_example" uuid="61EFD50A-C916-494A-91D6-3E12E0738F4D">
|
||||
<target name="selenium_example">
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="selenium" location="..\selenium-safe.ecf"/>
|
||||
</target>
|
||||
<target name="search" extends="selenium_example">
|
||||
<root class="EXAMPLE_SEARCH" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementById" extends="selenium_example">
|
||||
<root class="FIND_ELEMENT_ID" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementByName" extends="selenium_example">
|
||||
<root class="FIND_ELEMENT_NAME" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementByClass" extends="selenium_example">
|
||||
<root class="FIND_ELEMENT_CLASS" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementChild" extends="selenium_example">
|
||||
<root class="FIND_ELEMENT_CHILD" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementsLinks" extends="selenium_example">
|
||||
<root class="FIND_ELEMENTS_LINKS" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementsLinksByText" extends="selenium_example">
|
||||
<root class="FIND_ELEMENTS_LINKS_BY_TEXT" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementsLinksByPartialText" extends="selenium_example">
|
||||
<root class="FIND_ELEMENTS_LINKS_BY_PARTIAL_TEXT" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementCssSelector" extends="selenium_example">
|
||||
<root class="FIND_ELEMENT_CSS_SELECTOR" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
<target name="findElementXPath" extends="selenium_example">
|
||||
<root class="FIND_ELEMENT_XPATH" feature="default_create"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</system>
|
||||
@@ -1,61 +0,0 @@
|
||||
note
|
||||
description: "The WEB_ELEMENT class also supports find methods that find child elements."
|
||||
|
||||
class
|
||||
FIND_ELEMENT_CHILD
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom login page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/")
|
||||
|
||||
-- Find the element div with id page,and then we can find a child element div page-inner
|
||||
--<div id="page">
|
||||
-- <div id="page-inner">
|
||||
-- <a id="navigation-top" name="top"></a>
|
||||
-- <div id="skip-to-nav">
|
||||
-- <div id="header">
|
||||
-- <div id="main">
|
||||
-- <div id="footer">
|
||||
-- </div>
|
||||
--</div>
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("page")) as l_div_page then
|
||||
print ("%N Page element id" + l_div_page.element)
|
||||
if attached {WEB_ELEMENT}l_div_page.find_element ((create {SE_BY}).id ("page-inner")) as l_div_page_inner then
|
||||
print ("%N Inner Page element id" + l_div_page_inner.element)
|
||||
end
|
||||
end
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
print ("%N")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,84 +0,0 @@
|
||||
note
|
||||
description: "Using the class attribute to find elements. The class attribute is provided to apply CSS to an element."
|
||||
|
||||
class
|
||||
FIND_ELEMENT_CLASS
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
-- Create desired capabilities
|
||||
|
||||
create capabilities.make
|
||||
capabilities.set_css_selectors_enabled (True)
|
||||
capabilities.set_browser_name ("chrome")
|
||||
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome and capabilities
|
||||
web_driver.start_session_chrome_with_desired_capabilities (capabilities)
|
||||
|
||||
-- Go to EiffelRoom login page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/user?destination=front")
|
||||
|
||||
|
||||
-- Find the user name, password element by its id and submit
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-name")) as l_user and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-pass")) as l_pass and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-submit")) as l_form then
|
||||
l_user.send_keys (<<"test">>)
|
||||
l_pass.send_keys (<<"pass">>)
|
||||
l_form.submit
|
||||
end
|
||||
|
||||
-- After submit, there is an error message, and we still are in the same page
|
||||
|
||||
-- Wait for the page to load, timeout after 10 seconds
|
||||
create wait.make (web_driver,10)
|
||||
wait.until_when (agent expected_title (web_driver, "User account"))
|
||||
|
||||
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).class_name ("title")) as l_title then
|
||||
if attached l_title.get_text as l_text then
|
||||
print ("%NDisplay:" + l_text)
|
||||
|
||||
end
|
||||
end
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
|
||||
expected_title (driver : WEB_DRIVER; title : STRING_32) : BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,66 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
]"
|
||||
|
||||
class
|
||||
FIND_ELEMENT_CSS_SELECTOR
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom home page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/")
|
||||
|
||||
-- Absolute Path
|
||||
-- <div id="header">
|
||||
-- html.js body.front div#page div#page-inner div#header
|
||||
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).css_selector ("html.js body.front div#page div#page-inner div#header")) as selector then
|
||||
print ("%NElement:" + selector.element)
|
||||
end
|
||||
|
||||
-- Relative Path
|
||||
--
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).css_selector ("div#header")) as selector then
|
||||
print ("%NElement:" + selector.element)
|
||||
end
|
||||
print ("%Nend process ...")
|
||||
io.read_line
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
expected_title (driver: WEB_DRIVER; title: STRING_32): BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,63 +0,0 @@
|
||||
note
|
||||
description: "Using the id attribute is the most preferable way to locate elements on a page."
|
||||
|
||||
class
|
||||
FIND_ELEMENT_ID
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom login page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/user?destination=front")
|
||||
|
||||
-- Find the user name, password element by its id and submit
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-name")) as l_user and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-pass")) as l_pass and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-submit")) as l_form then
|
||||
l_user.send_keys (<<"test">>)
|
||||
l_pass.send_keys (<<"pass">>)
|
||||
l_form.submit
|
||||
end
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
|
||||
-- Find the user name, password element by its id and submit
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-name")) as l_user and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-pass")) as l_pass and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id ("edit-submit")) as l_form then
|
||||
if attached l_user.get_css_value ("width") as l_width then
|
||||
print ("%NCss value:" + l_width)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
io.read_line
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,57 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Unlike find_element_id, find by name attribute may not be unique on a page. We might find multiple elements
|
||||
with similar name attributes,if that happends, the first element on the page
|
||||
will be selected, which may not be the element we are looking for.
|
||||
]"
|
||||
|
||||
class
|
||||
FIND_ELEMENT_NAME
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom login page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/user?destination=front")
|
||||
|
||||
-- Find the user name, password element by its name and submit
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).name ("name")) as l_user and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).name ("pass")) as l_pass and then attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).name ("op")) as l_form then
|
||||
l_user.send_keys (<<"test">>)
|
||||
l_pass.send_keys (<<"pass">>)
|
||||
l_form.submit
|
||||
end
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,74 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
]"
|
||||
|
||||
class
|
||||
FIND_ELEMENT_XPATH
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
xpath_expression : STRING_32
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom home page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/")
|
||||
|
||||
|
||||
--Xpath expression
|
||||
xpath_expression := "//*[@id='page']"
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).xpath (xpath_expression)) as l_path then
|
||||
print ("%NElement:" + l_path.element)
|
||||
end
|
||||
|
||||
-- Images with Alt
|
||||
-- img[@alt]
|
||||
if attached {LIST[WEB_ELEMENT]}web_driver.find_elements ((create {SE_BY}).xpath ("//img[@alt]")) as l_paths then
|
||||
from
|
||||
l_paths.start
|
||||
until
|
||||
l_paths.after
|
||||
loop
|
||||
print ("%NElement:" + l_paths.item.element)
|
||||
l_paths.forth
|
||||
end
|
||||
end
|
||||
|
||||
print ("%Nend process ...")
|
||||
io.read_line
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
expected_title (driver: WEB_DRIVER; title: STRING_32): BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,72 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
|
||||
]"
|
||||
|
||||
class
|
||||
FIND_ELEMENTS_LINKS
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom home page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/")
|
||||
|
||||
create wait.make (web_driver,10)
|
||||
wait.until_when (agent expected_title (web_driver, "Eiffel Room"))
|
||||
|
||||
|
||||
-- Find links
|
||||
if attached web_driver.find_elements ((create {SE_BY}).tag_name("a")) as l_links then
|
||||
from
|
||||
l_links.start
|
||||
until
|
||||
l_links.after
|
||||
loop
|
||||
if attached l_links.item.get_attribute ("href") as l_ref then
|
||||
print ("%Nhref:" + l_ref)
|
||||
end
|
||||
l_links.forth
|
||||
end
|
||||
end
|
||||
print ("%Nend process ..." )
|
||||
io.read_line
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
|
||||
expected_title (driver : WEB_DRIVER; title : STRING_32) : BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,71 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
|
||||
]"
|
||||
|
||||
class
|
||||
FIND_ELEMENTS_LINKS_BY_PARTIAL_TEXT
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
|
||||
-- Go to EiffelRoom home page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/")
|
||||
|
||||
-- Find links
|
||||
-- <a href="http://www.eiffel.com">Eiffel.com</a></li><li><a>
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).partial_link_text("Eiffel")) as l_link then
|
||||
if attached l_link.get_attribute ("href") as l_ref then
|
||||
print ("%Nhref:" + l_ref)
|
||||
end
|
||||
end
|
||||
-- <a href="#navigation">Skip to Navigation</a>
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).partial_link_text("Skip to")) as l_link then
|
||||
if attached l_link.get_attribute ("href") as l_ref then
|
||||
print ("%Nhref:" + l_ref)
|
||||
end
|
||||
end
|
||||
print ("%Nend process ..." )
|
||||
io.read_line
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
|
||||
expected_title (driver : WEB_DRIVER; title : STRING_32) : BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,55 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
|
||||
]"
|
||||
|
||||
class
|
||||
FIND_ELEMENTS_LINKS_BY_TEXT
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
create
|
||||
default_create
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Search by id
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to EiffelRoom home page
|
||||
web_driver.to_url ("http://www.eiffelroom.com/")
|
||||
|
||||
-- Find links
|
||||
-- <a href="http://www.eiffel.com">Eiffel.com</a></li><li><a>
|
||||
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).link_text("Eiffel.com")) as l_link then
|
||||
if attached l_link.get_attribute ("href") as l_ref then
|
||||
print ("%Nhref:" + l_ref)
|
||||
end
|
||||
end
|
||||
print ("%Nend process ..." )
|
||||
io.read_line
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1 "This Program was made using EiffelStudio using Visual Studio C++"
|
||||
END
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1 "This Program was made using EiffelStudio using Visual Studio C++"
|
||||
END
|
||||
@@ -1,193 +0,0 @@
|
||||
Eiffel Selenium binding
|
||||
=================================================
|
||||
|
||||
## Overview
|
||||
Selenium will help you test your web applications effectively and efficiently against a vast number of browsers and platforms.
|
||||
This client is a binding for the REST API interface defined in the WebDriver protocol http://code.google.com/p/selenium/wiki/JsonWireProtocol.
|
||||
|
||||
WARNING this API is still under development, and maybe it will change
|
||||
|
||||
## Requirements
|
||||
|
||||
* Get the server selenium-server-standalone-#.jar file provided here: http://code.google.com/p/selenium/downloads/list
|
||||
|
||||
* Download and run that file, replacing # with the current server version.
|
||||
|
||||
java -jar selenium-server-standalone-#.jar
|
||||
(it only has a Firefox WebDriver by default)
|
||||
|
||||
But you can add other drivers doing something like that (change PATH_TO to the corresponding value in your environment)
|
||||
java -jar selenium-server-standalone-2.32.0.jar
|
||||
-Dwebdriver.chrome.driver=%PATH_TO%\chromedriver.exe -Dwebdriver.ie.driver=%PATH_TO%\IEDriverServer.exe
|
||||
|
||||
## Getting Started Selenium-WebDriver API
|
||||
(Eiffel binding only support (for now) RemoteWebDriver)
|
||||
The examples and guide are based on http://docs.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example
|
||||
|
||||
WebDriver is a tool for automating web application testing, and in particular to verify that they work as expected.
|
||||
|
||||
class
|
||||
EXAMPLE_SEARCH
|
||||
|
||||
inherit
|
||||
|
||||
ANY
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
|
||||
feature
|
||||
|
||||
default_create
|
||||
do
|
||||
search
|
||||
end
|
||||
|
||||
feature -- Example
|
||||
|
||||
search
|
||||
local
|
||||
web_driver: WEB_DRIVER
|
||||
wait: WEB_DRIVER_WAIT
|
||||
do
|
||||
--Create a new instance of a Web driver
|
||||
create web_driver.make
|
||||
|
||||
-- Start session with chrome
|
||||
web_driver.start_session_chrome
|
||||
|
||||
-- Go to Google
|
||||
web_driver.to_url ("http://www.google.com/")
|
||||
|
||||
-- Find the text input element by its name
|
||||
if attached web_driver.find_element ((create {SE_BY}).name ("q")) as l_element then
|
||||
|
||||
-- Enter something to search for
|
||||
l_element.send_keys (<<"Eiffel Room">>)
|
||||
|
||||
-- Now submit the form. WebDriver will find the form for us from the element
|
||||
l_element.submit
|
||||
end
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
|
||||
-- Google's search is rendered dynamically with JavaScript.
|
||||
-- Wait for the page to load, timeout after 10 seconds
|
||||
create wait.make (web_driver, 10)
|
||||
wait.until_when (agent expected_title(web_driver, "Eiffel Room"))
|
||||
if attached web_driver.get_page_tile as l_title then
|
||||
print ("%NPage title is:" + l_title)
|
||||
end
|
||||
|
||||
-- close the window
|
||||
web_driver.window_close
|
||||
end
|
||||
|
||||
expected_title (driver: WEB_DRIVER; title: STRING_32): BOOLEAN
|
||||
do
|
||||
if attached {STRING_32} driver.get_page_tile as l_title and then l_title.has_substring (title) then
|
||||
Result := True
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
### Selenium-WebDriver API Commands and Operations
|
||||
To learn more go to [Selenium documentation] (http://docs.seleniumhq.org/docs/03_webdriver.jsp#introducing-the-selenium-webdriver-api-by-example)
|
||||
##### Fetching a Page
|
||||
The first thing you are likely to want to do with WebDriver is navigate to a page.
|
||||
|
||||
web_driver.to_url ("http://www.google.com/")
|
||||
|
||||
##### Locating UI Elements (WebElements)
|
||||
###### By ID
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<div id="head">...</div>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).id ("head"))
|
||||
|
||||
|
||||
###### By Name
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<input name="cheese" type="text"/>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).name ("cheese"))
|
||||
|
||||
###### By Class Name
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<div class="cheese"><span>Cheddar</span></div><div class="cheese"><span>Gouda</span></div>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).class_name ("cheese"))
|
||||
|
||||
###### By CSS Selector
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<div id="food"><span class="dairy">milk</span><span class="dairy aged">cheese</span></div>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).css_selector ("#food span.dairy.aged"))
|
||||
|
||||
###### By Link Text
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<a href="http://www.google.com/search?q=EWF">EWF</a>>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).link_text ("EWF"))
|
||||
|
||||
|
||||
###### By Partial Link Text
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<a href="http://www.google.com/search?q=ewf">search for ewf</a>>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).partial_link_text ("ewf"))
|
||||
|
||||
|
||||
###### By Tag Name
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<iframe src="..."></iframe>
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).tag_name ("iframe"))
|
||||
|
||||
|
||||
###### By XPath
|
||||
|
||||
|
||||
Example of how to find an element that looks like this:
|
||||
|
||||
<input type="text" name="example" />
|
||||
|
||||
Eiffel Code
|
||||
|
||||
web_driver.find_element ((create{SE_BY}).xpath ("//input"))
|
||||
|
||||
|
||||
### Locating Elements
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="selenium" uuid="F76D19F7-509C-47B1-B2EA-46FCB05F9893" library_target="selenium">
|
||||
<target name="selenium">
|
||||
<root all_classes="true"/>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="encoding" location="$ISE_LIBRARY\library\encoding\encoding-safe.ecf"/>
|
||||
<library name="http_client" location="$EIFFEL_LIBRARY\EWF\library\network\http_client\http_client-safe.ecf"/>
|
||||
<library name="json" location="$EIFFEL_LIBRARY\EWF\contrib\library\text\parser\json\library\json-safe.ecf"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||
<cluster name="src" location=".\src\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1 "This Program was made using EiffelStudio using Visual Studio C++"
|
||||
END
|
||||
@@ -1,72 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_BUILD_VALUE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_BUILD_VALUE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_BUILD_VALUE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make_empty
|
||||
if attached {STRING_32} json_to_object (j.item (version_key),Void) as l_item then
|
||||
Result.set_version(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (revision_key), Void) as l_item then
|
||||
Result.set_revision(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (time_key),Void) as l_item then
|
||||
Result.set_time(l_item)
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.version), version_key)
|
||||
Result.put (json.value (o.revision), revision_key)
|
||||
Result.put (json.value (o.time), time_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
version_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("version")
|
||||
end
|
||||
|
||||
time_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("time")
|
||||
end
|
||||
|
||||
revision_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("revision")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,185 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_CAPABILITIES_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_CAPABILITIES_JSON_CONVERTER
|
||||
|
||||
inherit
|
||||
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_CAPABILITIES
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make
|
||||
if attached {STRING_32} json_to_object (j.item (browser_name_key), Void) as l_item then
|
||||
Result.set_browser_name(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (version_key), Void) as l_item then
|
||||
Result.set_version(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (platform_key), Void) as l_item then
|
||||
Result.set_platform(l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (javascriptenabled_key), Void) as l_item then
|
||||
Result.set_javascript_enabled(l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (takesscreenshot_key), Void) as l_item then
|
||||
Result.set_takes_screenshot(l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (handlesalerts_key ), Void) as l_item then
|
||||
Result.set_handles_alerts(l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (locationcontextenabled_key ), Void) as l_item then
|
||||
Result.set_location_context_enabled (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (applicationcacheenabled_key ), Void) as l_item then
|
||||
Result.set_application_cache_enabled (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (browserconnectionenabled_key ), Void) as l_item then
|
||||
Result.set_browser_connection_enabled (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (cssselectorsenabled_key ), Void) as l_item then
|
||||
Result.set_css_selectors_enabled (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (webstorageenabled_key ), Void) as l_item then
|
||||
Result.set_web_storage_enabled (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (rotatable_key ), Void) as l_item then
|
||||
Result.set_rotatable (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (acceptsslcerts_key ), Void) as l_item then
|
||||
Result.set_accept_ssl_certs (l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (nativeevents_key ), Void) as l_item then
|
||||
Result.set_native_events (l_item)
|
||||
end
|
||||
|
||||
-- if attached {WEB_DRIVER_PROXY} json_to_object (j.item (proxy_key), {WEB_DRIVER_PROXY}) as lv then
|
||||
-- Result.set_proxy(lv)
|
||||
-- end
|
||||
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.browser_name),browser_name_key)
|
||||
Result.put (json.value (o.version),version_key)
|
||||
Result.put (json.value (o.platform),platform_key)
|
||||
Result.put (json.value (o.is_javascript_enabled),javascriptenabled_key)
|
||||
Result.put (json.value (o.takes_screenshot),takesscreenshot_key)
|
||||
Result.put (json.value (o.handles_alerts),handlesalerts_key)
|
||||
Result.put (json.value (o.is_database_enabled),databaseenabled_key)
|
||||
Result.put (json.value (o.is_location_context_enabled),locationcontextenabled_key)
|
||||
Result.put (json.value (o.is_application_cache_enabled),applicationcacheenabled_key)
|
||||
Result.put (json.value (o.is_browser_connection_enabled),browserconnectionenabled_key)
|
||||
Result.put (json.value (o.is_css_selectors_enabled),cssselectorsenabled_key)
|
||||
Result.put (json.value (o.is_web_storage_enabled),webstorageenabled_key)
|
||||
Result.put (json.value (o.is_rotatable),rotatable_key)
|
||||
Result.put (json.value (o.accept_ssl_certs),acceptsslcerts_key)
|
||||
Result.put (json.value (o.native_events),nativeevents_key)
|
||||
--Result.put (json.value (o.proxy),proxy_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
browser_name_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("browserName")
|
||||
end
|
||||
|
||||
version_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("version")
|
||||
end
|
||||
|
||||
platform_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("platform")
|
||||
end
|
||||
|
||||
javascriptEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("javascriptEnabled")
|
||||
end
|
||||
|
||||
takesScreenshot_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("takesScreenshot")
|
||||
end
|
||||
|
||||
handlesAlerts_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("handlesAlerts")
|
||||
end
|
||||
|
||||
databaseEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("databaseEnabled")
|
||||
end
|
||||
|
||||
locationContextEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("locationContextEnabled")
|
||||
end
|
||||
|
||||
applicationCacheEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("applicationCacheEnabled")
|
||||
end
|
||||
|
||||
browserConnectionEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("browserConnectionEnabled")
|
||||
end
|
||||
|
||||
cssSelectorsEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("cssSelectorsEnabled")
|
||||
end
|
||||
|
||||
webStorageEnabled_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("webStorageEnabled")
|
||||
end
|
||||
|
||||
rotatable_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("rotatable")
|
||||
end
|
||||
|
||||
acceptSslCerts_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("acceptSslCerts")
|
||||
end
|
||||
|
||||
nativeEvents_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("nativeEvents")
|
||||
end
|
||||
|
||||
proxy_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("proxy")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,100 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_COOKIE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_COOKIE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_COOKIE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result
|
||||
if attached {STRING_32} json_to_object (j.item (name_key), Void) as l_item then
|
||||
Result.set_name(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (value_key), Void) as l_item then
|
||||
Result.set_value(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (path_key), Void) as l_item then
|
||||
Result.set_path(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (domain_key), Void) as l_item then
|
||||
Result.set_domain(l_item)
|
||||
end
|
||||
if attached {BOOLEAN} json_to_object (j.item (secure_key), Void) as l_item then
|
||||
if l_item then
|
||||
Result.secure
|
||||
end
|
||||
end
|
||||
if attached {INTEGER_32} json_to_object (j.item (expiry_key), Void) as l_item then
|
||||
Result.set_expiry (l_item.as_natural_32)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.name), name_key)
|
||||
Result.put (json.value (o.value), value_key)
|
||||
Result.put (json.value (o.path), path_key)
|
||||
Result.put (json.value (o.domain), domain_key)
|
||||
Result.put (json.value (o.is_secure), secure_key)
|
||||
Result.put (json.value (o.expiry), expiry_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
name_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("name")
|
||||
end
|
||||
|
||||
value_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("value")
|
||||
end
|
||||
|
||||
path_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("path")
|
||||
end
|
||||
|
||||
domain_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("domain")
|
||||
end
|
||||
|
||||
secure_key : JSON_STRING
|
||||
once
|
||||
create Result.make_json ("secure")
|
||||
end
|
||||
|
||||
expiry_key : JSON_STRING
|
||||
once
|
||||
create Result.make_json ("expiry")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,51 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_JAVA_VALUE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_JAVA_VALUE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_JAVA_VALUE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make_empty
|
||||
if attached {STRING_32} json_to_object (j.item (version_key), Void) as l_item then
|
||||
Result.set_version(l_item)
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.version), version_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
version_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("version")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
inherit
|
||||
JSON_CONVERTER
|
||||
|
||||
feature -- Convertion
|
||||
|
||||
json_to_object (j: detachable JSON_VALUE; a_type: detachable TYPE [detachable ANY]): detachable ANY
|
||||
local
|
||||
l_classname: detachable STRING
|
||||
do
|
||||
if a_type /= Void then
|
||||
l_classname := a_type.name
|
||||
if l_classname.item (1) = '!' then
|
||||
l_classname := l_classname.substring (2, l_classname.count)
|
||||
end
|
||||
end
|
||||
Result := json.object (j, l_classname)
|
||||
end
|
||||
end
|
||||
@@ -1,73 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_OS_VALUE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_OS_VALUE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_OS_VALUE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make_empty
|
||||
if attached {STRING_32} json_to_object (j.item (version_key), Void) as l_item then
|
||||
Result.set_version(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (name_key), Void) as l_item then
|
||||
Result.set_name(l_item)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (architecture_key), Void) as l_item then
|
||||
Result.set_architecture(l_item)
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.architecture), architecture_key)
|
||||
Result.put (json.value (o.name), name_key)
|
||||
Result.put (json.value (o.version), version_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
version_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("version")
|
||||
end
|
||||
|
||||
name_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("name")
|
||||
end
|
||||
|
||||
architecture_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("arch")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,73 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_RESPONSE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_RESPONSE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_RESPONSE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make_empty
|
||||
if attached {STRING_32} json_to_object (j.item (session_key), Void) as l_item then
|
||||
Result.set_session_id(l_item)
|
||||
end
|
||||
if attached {INTEGER_8} json_to_object (j.item (status_key), Void) as l_item then
|
||||
Result.set_status(l_item)
|
||||
end
|
||||
if attached {JSON_VALUE} j.item (value_key) as l_item then
|
||||
Result.set_value(l_item.representation)
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.session_id),session_key)
|
||||
Result.put (json.value (o.status), status_key)
|
||||
Result.put (json.value (o.value), value_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
session_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("sessionId")
|
||||
end
|
||||
|
||||
status_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("status")
|
||||
end
|
||||
|
||||
value_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("value")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,101 +0,0 @@
|
||||
note
|
||||
description: "A converter for SE_STATUS"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_STATUS_JSON_CONVERTER
|
||||
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_STATUS
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result
|
||||
if attached {INTEGER_32} json_to_object (j.item (status_key), Void) as l_ucs then
|
||||
Result.set_status (l_ucs)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (session_id_key), Void) as l_ucs then
|
||||
Result.set_session_id (l_ucs)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (state_key), Void) as l_ucs then
|
||||
Result.set_state (l_ucs)
|
||||
end
|
||||
if attached {STRING_32} json_to_object (j.item (class_name_key), Void) as l_ucs then
|
||||
Result.set_class_name (l_ucs)
|
||||
end
|
||||
if attached {INTEGER_32} json_to_object (j.item (hash_code_key), Void) as l_ucs then
|
||||
Result.set_hash_code (l_ucs.out)
|
||||
end
|
||||
if attached {SE_STATUS_VALUE} json_to_object (j.item (value_key), {SE_STATUS_VALUE}) as lv then
|
||||
Result.set_value(lv)
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.status), status_key)
|
||||
Result.put (json.value (o.session_id), session_id_key)
|
||||
Result.put (json.value (o.value), value_key)
|
||||
Result.put (json.value (o.state), state_key)
|
||||
Result.put (json.value (o.class_name), class_name_key)
|
||||
Result.put (json.value (o.hash_code), hash_code_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
|
||||
status_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("status")
|
||||
end
|
||||
|
||||
session_id_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("sessionId")
|
||||
end
|
||||
|
||||
value_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("value")
|
||||
end
|
||||
|
||||
state_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("state")
|
||||
end
|
||||
|
||||
class_name_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("class")
|
||||
end
|
||||
|
||||
hash_code_key : JSON_STRING
|
||||
once
|
||||
create Result.make_json ("hCode")
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Javier Velilla, Jocelyn Fiat and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
@@ -1,70 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_STATUS_VALUE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_STATUS_VALUE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_STATUS_VALUE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make_empty
|
||||
if attached {SE_OS_VALUE} json_to_object (j.item (os_key), {SE_OS_VALUE}) as l_item then
|
||||
Result.set_os_value(l_item)
|
||||
end
|
||||
if attached {SE_JAVA_VALUE} json_to_object (j.item (java_key), {SE_JAVA_VALUE}) as l_item then
|
||||
Result.set_java_value(l_item)
|
||||
end
|
||||
if attached {SE_BUILD_VALUE} json_to_object (j.item (build_key), {SE_BUILD_VALUE}) as l_item then
|
||||
Result.set_build_value(l_item)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.os_value), os_key)
|
||||
Result.put (json.value (o.java_value), java_key)
|
||||
Result.put (json.value (o.build_value), build_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
|
||||
os_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("os")
|
||||
end
|
||||
|
||||
java_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("java")
|
||||
end
|
||||
|
||||
build_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("build")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_TIMEOUT_TYPE_JSON_CONVERTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_TIMEOUT_TYPE_JSON_CONVERTER
|
||||
inherit
|
||||
SE_JSON_CONVERTER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create object.make_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
object: SE_TIMEOUT_TYPE
|
||||
|
||||
feature -- Conversion
|
||||
|
||||
from_json (j: like to_json): detachable like object
|
||||
do
|
||||
create Result.make_empty
|
||||
if attached {STRING_32} json_to_object (j.item (type_key), Void) as l_item then
|
||||
Result.set_type(l_item)
|
||||
end
|
||||
if attached {INTEGER_32} json_to_object (j.item (ms_key), Void) as l_item then
|
||||
Result.set_ms (l_item)
|
||||
end
|
||||
end
|
||||
|
||||
to_json (o: like object): JSON_OBJECT
|
||||
do
|
||||
create Result.make
|
||||
Result.put (json.value (o.type),type_key)
|
||||
Result.put (json.value (o.ms), ms_key)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
|
||||
type_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("type")
|
||||
end
|
||||
|
||||
ms_key: JSON_STRING
|
||||
once
|
||||
create Result.make_json ("ms")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,37 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {ENUM}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
ENUM
|
||||
|
||||
feature -- Access
|
||||
|
||||
is_valid_state: BOOLEAN
|
||||
-- Is the value of the enumeration valid?
|
||||
do
|
||||
Result := is_valid_value (value)
|
||||
end
|
||||
|
||||
value: INTEGER
|
||||
-- The current value of the enumeration.
|
||||
|
||||
set_value (a_value: INTEGER)
|
||||
require
|
||||
is_valid_value (a_value)
|
||||
do
|
||||
value := a_value
|
||||
end
|
||||
|
||||
is_valid_value (a_value: INTEGER): BOOLEAN
|
||||
-- Can `a_value' be used in a `set_value' feature call?
|
||||
deferred
|
||||
end
|
||||
|
||||
invariant
|
||||
is_valid_state
|
||||
|
||||
end -- class ENUM
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {HTTP_METHODS}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
HTTP_METHODS
|
||||
|
||||
feature -- Method Names
|
||||
OPTIONS : STRING_32 = "OPTIONS"
|
||||
GET : STRING_32 = "GET"
|
||||
HEAD : STRING_32 = "HEAD"
|
||||
POST : STRING_32 = "POST"
|
||||
PUT : STRING_32 = "PUT"
|
||||
DELETE : STRING_32 = "DELETE"
|
||||
TRACE : STRING_32 = "TRACE"
|
||||
CONNECT : STRING_32 = "CONNECT"
|
||||
end
|
||||
@@ -1,101 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {JSON_HELPER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
JSON_HELPER
|
||||
inherit
|
||||
|
||||
SHARED_EJSON
|
||||
|
||||
feature -- Access
|
||||
to_json (an_object : ANY) :detachable JSON_VALUE
|
||||
local
|
||||
parser: JSON_PARSER
|
||||
do
|
||||
initialize_converters (json)
|
||||
if attached json.value (an_object) as lv then
|
||||
Result := lv
|
||||
end
|
||||
end
|
||||
|
||||
string_to_json ( str: STRING_32): detachable JSON_VALUE
|
||||
local
|
||||
parser: JSON_PARSER
|
||||
do
|
||||
initialize_converters (json)
|
||||
create parser.make_parser (str)
|
||||
if attached parser.parse as st and parser.is_parsed then
|
||||
Result := st
|
||||
end
|
||||
end
|
||||
|
||||
json_to_se_status (post: STRING_32): detachable SE_STATUS
|
||||
local
|
||||
parser: JSON_PARSER
|
||||
do
|
||||
initialize_converters (json)
|
||||
create parser.make_parser (post)
|
||||
if attached parser.parse_object as st and parser.is_parsed then
|
||||
if attached {SE_STATUS} json.object (st, "SE_STATUS") as l_status then
|
||||
Result := l_status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json_to_se_capabilities (post: STRING_32): detachable SE_CAPABILITIES
|
||||
local
|
||||
parser: JSON_PARSER
|
||||
do
|
||||
initialize_converters (json)
|
||||
create parser.make_parser (post)
|
||||
if attached parser.parse_object as st and parser.is_parsed then
|
||||
if attached {SE_CAPABILITIES} json.object (st, "SE_CAPABILITIES") as l_capabilities then
|
||||
Result := l_capabilities
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json_to_se_response (post: STRING_32): detachable SE_RESPONSE
|
||||
local
|
||||
parser: JSON_PARSER
|
||||
do
|
||||
initialize_converters (json)
|
||||
create parser.make_parser (post)
|
||||
if attached parser.parse_object as st and parser.is_parsed then
|
||||
if attached {SE_RESPONSE} json.object (st, "SE_RESPONSE") as l_response then
|
||||
Result := l_response
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
json_to_se_cookie (post: STRING_32): detachable SE_COOKIE
|
||||
local
|
||||
parser: JSON_PARSER
|
||||
do
|
||||
initialize_converters (json)
|
||||
create parser.make_parser (post)
|
||||
if attached parser.parse_object as st and parser.is_parsed then
|
||||
if attached {SE_COOKIE} json.object (st, "SE_COOKIE") as l_cookie then
|
||||
Result := l_cookie
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
initialize_converters (j: like json)
|
||||
-- Initialize json converters
|
||||
do
|
||||
j.add_converter (create {SE_STATUS_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_BUILD_VALUE_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_JAVA_VALUE_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_OS_VALUE_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_STATUS_VALUE_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_CAPABILITIES_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_RESPONSE_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_TIMEOUT_TYPE_JSON_CONVERTER}.make)
|
||||
j.add_converter (create {SE_COOKIE_JSON_CONVERTER}.make)
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,675 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_JSON_WIRE_PROTOCOL_COMMANDS}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_JSON_WIRE_PROTOCOL_COMMANDS
|
||||
|
||||
feature
|
||||
|
||||
cmd_ping: STRING = ""
|
||||
--GET / expected a 200 ok
|
||||
|
||||
cmd_status: STRING = "status"
|
||||
--GET /status Query the server's current status.
|
||||
|
||||
cmd_new_session: STRING = "session"
|
||||
--POST /session Create a new session.
|
||||
|
||||
cmd_sessions: STRING = "sessions"
|
||||
--GET /sessions Returns a list of the currently active sessions.
|
||||
|
||||
cmd_session_by_id_tmpl: STRING = "session/$id"
|
||||
|
||||
cmd_session_by_id (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_by_id_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_timeouts_tmpl: STRING_32 = "[
|
||||
session/$id/timeouts
|
||||
]"
|
||||
|
||||
cmd_session_timeouts (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_timeouts_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_timeouts_async_script_tmpl: STRING = "session/$id/timeouts/async_script"
|
||||
|
||||
cmd_session_timeouts_async_script (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_timeouts_async_script_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_timeouts_implicit_wait_tmpl: STRING = "session/$id/timeouts/implicit_wait"
|
||||
|
||||
cmd_session_timeouts_implicit_wait (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_timeouts_implicit_wait_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_window_handle_tmpl: STRING = "session/$id/window_handle"
|
||||
|
||||
cmd_session_window_handle (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_window_handle_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_window_handles_tmpl: STRING = "session/$id/window_handles"
|
||||
|
||||
cmd_session_window_handles (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_window_handles_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_url_tmpl: STRING = "session/$id/url"
|
||||
|
||||
cmd_session_url (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_url_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_forward_tmpl: STRING = "session/$id/forward"
|
||||
|
||||
cmd_session_forward (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_forward_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_back_tmpl: STRING = "session/$id/back"
|
||||
|
||||
cmd_session_back (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_back_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_refresh_tmpl: STRING = "session/$id/refresh"
|
||||
|
||||
cmd_session_refresh (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_refresh_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_execute_tmpl: STRING = "session/$id/execute"
|
||||
|
||||
cmd_session_execute (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_execute_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_execute_async_tmpl: STRING = "session/$id/execute_async"
|
||||
|
||||
cmd_session_execute_async (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_execute_async_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_screenshot_tmpl: STRING = "session/$id/screenshot"
|
||||
|
||||
cmd_session_screenshot (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_screenshot_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_ime_available_engines_tmpl: STRING = "session/$id/ime/available_engines"
|
||||
|
||||
cmd_session_ime_available (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_ime_available_engines_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_ime_active_engine_tmpl: STRING = "session/$id/ime/active_engine"
|
||||
|
||||
cmd_session_ime_active_engine (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_ime_active_engine_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_ime_activated_tmpl: STRING = "session/$id/ime/activated"
|
||||
|
||||
cmd_session_ime_activated (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_ime_activated_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_ime_deactivate_tmpl: STRING = "session/$id/ime/deactivate"
|
||||
|
||||
cmd_session_ime_deactivate (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_ime_deactivate_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_ime_activate_tmpl: STRING = "session/$id/ime/activate"
|
||||
|
||||
cmd_session_ime_activate (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_ime_activate_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
--POST /session/:sessionId/frame Change focus to another frame on the page.
|
||||
|
||||
cmd_session_frame_tmpl: STRING = "session/$id/frame"
|
||||
|
||||
cmd_session_frame (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_frame_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
|
||||
cmd_session_window_tmpl: STRING = "session/$id/window"
|
||||
|
||||
cmd_session_window (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_window_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_window_size_tmpl: STRING = "session/$id/window/$windowHandle/size"
|
||||
|
||||
cmd_session_window_size (id: STRING_32; window_handle: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_window_size_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$windowHandle", window_handle)
|
||||
end
|
||||
|
||||
cmd_session_window_position_tmpl: STRING = "session/$id/window/$windowHandle/position"
|
||||
|
||||
cmd_session_window_position (id: STRING_32; window_handle: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_window_position_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$windowHandle", window_handle)
|
||||
end
|
||||
|
||||
cmd_session_window_maximize_tmpl: STRING = "session/$id/window/$windowHandle/maximize"
|
||||
|
||||
cmd_session_window_maximize (id: STRING_32; window_handle: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_window_maximize_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$windowHandle", window_handle)
|
||||
end
|
||||
|
||||
cmd_session_cookie_tmpl: STRING = "session/$id/cookie"
|
||||
|
||||
cmd_session_cookie (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_cookie_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_cookie_delte_tmpl: STRING = "session/$id/cookie/$name"
|
||||
|
||||
cmd_session_cookie_delete (id: STRING_32; name: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_cookie_delte_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$name", name)
|
||||
end
|
||||
|
||||
cmd_session_source_tmpl: STRING = "session/$id/source"
|
||||
|
||||
cmd_session_source (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_source_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_title_tmpl: STRING = "session/$id/title"
|
||||
|
||||
cmd_session_title (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_title_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_tmpl: STRING = "session/$id/element"
|
||||
|
||||
cmd_session_element (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_elements_tmpl: STRING = "session/$id/elements"
|
||||
|
||||
cmd_session_elements (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_elements_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_active_tmpl: STRING = "session/$id/element/active"
|
||||
|
||||
cmd_session_element_active (id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_active_tmpl)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_id_tmpl: STRING = "session/$sessionId/element/$id"
|
||||
|
||||
cmd_session_element_id (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_id_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
--GET /session/:sessionId/element/:id Describe the identified element.
|
||||
|
||||
cmd_session_element_id_element_tmpl: STRING = "session/$sessionId/element/$id/element"
|
||||
|
||||
cmd_session_element_id_element (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_id_element_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_id_elements_tmpl: STRING = "session/$sessionId/element/$id/elements"
|
||||
|
||||
cmd_session_element_id_elements (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_id_elements_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_click_tmpl: STRING = "session/$sessionId/element/$id/click"
|
||||
|
||||
cmd_session_element_click (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_click_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_submit_tmpl: STRING = "session/$sessionId/element/$id/submit"
|
||||
|
||||
cmd_session_element_submit (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_submit_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_text_tmpl: STRING = "session/$sessionId/element/$id/text"
|
||||
|
||||
cmd_session_element_text (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_text_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_event_tmpl: STRING = "session/$sessionId/element/$id/value"
|
||||
|
||||
cmd_session_element_event (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_event_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_keys_tmpl: STRING = "session/$sessionId/keys"
|
||||
|
||||
cmd_session_keys (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_keys_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_element_name_tmpl: STRING = "session/$sessionId/element/$id/name"
|
||||
|
||||
cmd_session_element_name (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_name_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_clear_tmpl: STRING = "session/$sessionId/element/$id/clear"
|
||||
|
||||
cmd_session_element_clear (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_name_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_selected_tmpl: STRING = "session/$sessionId/element/$id/selected"
|
||||
|
||||
cmd_session_element_selected (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_selected_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_enabled_tmpl: STRING = "session/$sessionId/element/$id/enabled"
|
||||
|
||||
cmd_session_element_enabled (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_enabled_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_attribute_name_tmpl: STRING = "session/$sessionId/element/$id/attribute/$name"
|
||||
|
||||
cmd_session_element_attribute_name (sessionId: STRING_32; id: STRING_32; name: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_attribute_name_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$name", name)
|
||||
end
|
||||
|
||||
cmd_session_element_equals_tmpl: STRING = "session/$sessionId/element/$id/equals/$other"
|
||||
|
||||
cmd_session_element_equals (sessionId: STRING_32; id: STRING_32; other: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_equals_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$other", other)
|
||||
end
|
||||
|
||||
cmd_session_element_displayed_tmpl: STRING = "session/$sessionId/element/$id/displayed"
|
||||
|
||||
cmd_session_element_displayed (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_displayed_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_location_tmpl: STRING = "session/$sessionId/element/$id/location"
|
||||
|
||||
cmd_session_element_location (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_location_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_location_in_view_tmpl: STRING = "session/$sessionId/element/$id/location_in_view"
|
||||
|
||||
cmd_session_element_location_in_view (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_location_in_view_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_size_tmpl: STRING = "session/$sessionId/element/$id/size"
|
||||
|
||||
cmd_session_element_size (sessionId: STRING_32; id: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_size_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
end
|
||||
|
||||
cmd_session_element_css_value_tmpl: STRING = "session/$sessionId/element/$id/css/$propertyName"
|
||||
|
||||
cmd_session_element_css_value (sessionId: STRING_32; id: STRING_32; property_name: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_element_css_value_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$id", id)
|
||||
Result.replace_substring_all ("$propertyName", property_name)
|
||||
end
|
||||
|
||||
cmd_session_browser_orientation_tmpl: STRING = "session/$sessionId/orientation"
|
||||
|
||||
cmd_session_browser_orientation (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_browser_orientation_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_alert_text_tmpl: STRING = "session/$sessionId/alert_text"
|
||||
|
||||
cmd_session_alert_text (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_alert_text_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_accept_alert_tmpl: STRING = "session/$sessionId/accept_alert"
|
||||
|
||||
cmd_session_accept_alert (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_accept_alert_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_dismiss_alert_tmpl: STRING = "session/$sessionId/dismiss_alert"
|
||||
|
||||
cmd_session_dismiss_alert (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_dismiss_alert_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_move_to_tmpl: STRING = "session/$sessionId/move_to"
|
||||
|
||||
cmd_session_move_to (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_move_to_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
|
||||
cmd_session_modifier_tmpl : STRING = "/session/$sessionId/modifier"
|
||||
cmd_session_modifier (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_modifier_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
|
||||
cmd_session_click_tmpl: STRING = "session/$sessionId/click"
|
||||
|
||||
cmd_session_click (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_click_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_buttondown_tmpl: STRING = "session/$sessionId/buttondown"
|
||||
|
||||
cmd_session_buttondown (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_buttondown_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_buttonup_tmpl: STRING = "session/$sessionId/buttonup"
|
||||
|
||||
cmd_session_buttonup (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_buttonup_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_doubleclick_tmpl: STRING = "session/$sessionId/doubleclick"
|
||||
|
||||
cmd_session_double_click (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_doubleclick_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_click_tmpl: STRING = "session/$sessionId/touch/click"
|
||||
|
||||
cmd_session_touch_click (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_click_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_down_tmpl: STRING = "session/$sessionId/touch/down"
|
||||
|
||||
cmd_session_touch_down (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_down_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_up_tmpl: STRING = "session/$sessionId/touch/up"
|
||||
|
||||
cmd_session_touch_up (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_up_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_move_tmpl: STRING = "session/$sessionId/touch/move"
|
||||
|
||||
cmd_session_touch_move (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_move_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_scroll_tmpl: STRING = "session/$sessionId/touch/scroll"
|
||||
|
||||
cmd_session_touch_scroll (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_scroll_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_double_click_tmpl: STRING = "session/$sessionId/touch/doubleclick"
|
||||
|
||||
cmd_session_touch_double_click (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_double_click_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_long_click_tmpl: STRING = "session/$sessionId/touch/longclick"
|
||||
|
||||
cmd_session_touch_long_click (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_long_click_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_touch_flick_tmpl: STRING = "session/$sessionId/touch/flick"
|
||||
|
||||
cmd_session_touch_flick (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_touch_flick_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_geo_location_tmpl: STRING = "session/$sessionId/location"
|
||||
|
||||
cmd_session_geo_location (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_geo_location_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_local_storage_tmpl: STRING = "session/$sessionId/local_storage"
|
||||
|
||||
cmd_session_local_storage (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_local_storage_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_local_storage_key_tmpl: STRING = "session/$sessionId/local_storage/key/$key"
|
||||
|
||||
cmd_session_local_storage_key (sessionId: STRING_32; key : STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_local_storage_key_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$key", key)
|
||||
end
|
||||
|
||||
cmd_session_local_storage_size_tmpl: STRING = "session/$sessionId/local_storage/size"
|
||||
|
||||
cmd_session_local_storage_size (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_local_storage_size_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_storage_tmpl: STRING = "session/$sessionId/session_storage"
|
||||
|
||||
cmd_session_storage (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_storage_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_storage_key_tmpl: STRING = "session/$sessionId/session_storage/key/$key"
|
||||
|
||||
cmd_session_storage_key (sessionId: STRING_32; key : STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_storage_key_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
Result.replace_substring_all ("$key", key)
|
||||
end
|
||||
|
||||
cmd_session_storage_size_tmpl: STRING = "session/$sessionId/session_storage/size"
|
||||
|
||||
cmd_session_storage_size (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_storage_size_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_log_tmpl: STRING = "session/$sessionId/log"
|
||||
|
||||
cmd_session_log (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_log_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_log_types_tmpl: STRING = "session/$sessionId/log/types"
|
||||
|
||||
cmd_session_log_types (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_log_types_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
cmd_session_application_cache_tmpl: STRING = "session/$sessionId/application_cache/status"
|
||||
|
||||
cmd_session_application_cache (sessionId: STRING_32): STRING_32
|
||||
do
|
||||
create Result.make_from_string (cmd_session_application_cache_tmpl)
|
||||
Result.replace_substring_all ("$sessionId", sessionId)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,63 +0,0 @@
|
||||
note
|
||||
description: "Object that describe the build information from the current server"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_BUILD_VALUE
|
||||
|
||||
create
|
||||
make,
|
||||
make_empty
|
||||
|
||||
feature{NONE} -- Initialization
|
||||
make ( a_version : STRING_32; a_revision: STRING_32; a_time: STRING_32)
|
||||
do
|
||||
set_version(a_version)
|
||||
set_revision (a_revision)
|
||||
set_time (a_time)
|
||||
end
|
||||
|
||||
make_empty
|
||||
do
|
||||
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
version : detachable STRING_32
|
||||
-- A generic release label (i.e. "2.0rc3")
|
||||
|
||||
revision : detachable STRING_32
|
||||
--The revision of the local source control client from which the server was built
|
||||
|
||||
time : detachable STRING_32
|
||||
--A timestamp from when the server was built.
|
||||
|
||||
feature -- Change Element
|
||||
set_version (a_version : STRING_32)
|
||||
-- Set version with `a_version'
|
||||
do
|
||||
version := a_version
|
||||
ensure
|
||||
version_assigned : version ~ a_version
|
||||
end
|
||||
|
||||
|
||||
set_revision (a_revision : STRING_32)
|
||||
-- Set revision with `a_revision'
|
||||
do
|
||||
revision := a_revision
|
||||
ensure
|
||||
revision_assigned : revision ~ a_revision
|
||||
end
|
||||
|
||||
|
||||
set_time (a_time : STRING_32)
|
||||
-- Set time with `a_time'
|
||||
do
|
||||
time := a_time
|
||||
ensure
|
||||
time_assigned : time ~ a_time
|
||||
end
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
note
|
||||
description: "Object that describe the current verion of Java"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_JAVA_VALUE
|
||||
|
||||
create
|
||||
make,
|
||||
make_empty
|
||||
|
||||
feature -- Initialization
|
||||
make ( a_version : STRING_32)
|
||||
do
|
||||
set_version (a_version)
|
||||
end
|
||||
make_empty
|
||||
do
|
||||
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
version : detachable STRING_32
|
||||
-- current Java version
|
||||
|
||||
feature -- Change Element
|
||||
set_version (a_version: STRING_32)
|
||||
--Set version with `a_version'
|
||||
do
|
||||
version := a_version
|
||||
ensure
|
||||
version_assigned : version ~ a_version
|
||||
end
|
||||
end
|
||||
@@ -1,64 +0,0 @@
|
||||
note
|
||||
description: "Object that describe the OS information from the current server"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_OS_VALUE
|
||||
|
||||
create
|
||||
make,
|
||||
make_empty
|
||||
|
||||
|
||||
feature{NONE} -- Initialization
|
||||
make ( an_architecture : STRING_32; a_name: STRING_32; a_version: STRING_32)
|
||||
do
|
||||
set_version(a_version)
|
||||
set_name (a_name)
|
||||
set_architecture (an_architecture)
|
||||
end
|
||||
|
||||
make_empty
|
||||
do
|
||||
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
architecture : detachable STRING_32
|
||||
-- The current system architecture.
|
||||
|
||||
name : detachable STRING_32
|
||||
-- The name of the operating system the server is currently running on: "windows", "linux", etc.
|
||||
|
||||
version : detachable STRING_32
|
||||
--The operating system version.
|
||||
|
||||
feature -- Change Element
|
||||
set_version (a_version : STRING_32)
|
||||
-- Set version with `a_version'
|
||||
do
|
||||
version := a_version
|
||||
ensure
|
||||
version_assigned : version ~ a_version
|
||||
end
|
||||
|
||||
|
||||
set_name (a_name : STRING_32)
|
||||
-- Set name with `a_name'
|
||||
do
|
||||
name := a_name
|
||||
ensure
|
||||
name_assigned : name ~ a_name
|
||||
end
|
||||
|
||||
|
||||
set_architecture (an_architecture : STRING_32)
|
||||
-- Set architecture with `an_architecture'
|
||||
do
|
||||
architecture := an_architecture
|
||||
ensure
|
||||
architecture_assigned : architecture ~ an_architecture
|
||||
end
|
||||
end
|
||||
@@ -1,61 +0,0 @@
|
||||
note
|
||||
description: "Object that represent Command responses from Seleniun JSONWireProtocol"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
EIS: "name=SELINIUM", "protocol=JsonWireProtocol", "src=https://code.google.com/p/selenium/wiki/JsonWireProtocol#Responses"
|
||||
|
||||
class
|
||||
SE_RESPONSE
|
||||
|
||||
create
|
||||
make,
|
||||
make_empty
|
||||
|
||||
feature -- Initialization
|
||||
make (a_session_id : STRING_32; a_status: INTEGER_32; a_value : STRING_32)
|
||||
do
|
||||
session_id := a_session_id
|
||||
status := a_status
|
||||
value := a_value
|
||||
end
|
||||
|
||||
make_empty
|
||||
do
|
||||
|
||||
end
|
||||
feature -- Access
|
||||
session_id : detachable STRING_32
|
||||
-- An opaque handle used by the server to determine where to route session-specific commands.
|
||||
-- This ID should be included in all future session-commands in place of the :sessionId path segment variable.
|
||||
|
||||
status : INTEGER_32
|
||||
-- A status code summarizing the result of the command. A non-zero value indicates that the command failed.
|
||||
|
||||
value : detachable STRING_32
|
||||
-- The response JSON value.
|
||||
|
||||
feature -- Change Element
|
||||
set_session_id ( a_session_id : STRING_32)
|
||||
do
|
||||
session_id := a_session_id
|
||||
end
|
||||
|
||||
set_status ( a_status : INTEGER_32)
|
||||
do
|
||||
status := a_status
|
||||
end
|
||||
|
||||
set_value (a_value : STRING_32)
|
||||
do
|
||||
value := a_value
|
||||
end
|
||||
|
||||
feature -- JSON Response
|
||||
json_response : detachable STRING_32
|
||||
|
||||
set_json_response ( a_response : STRING_32)
|
||||
do
|
||||
json_response := a_response
|
||||
end
|
||||
end
|
||||
@@ -1,98 +0,0 @@
|
||||
note
|
||||
description: "Object representation of JSON response describing the state of the server"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
EIS: "name=status", "protocol=http", "src=https://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/status"
|
||||
|
||||
class
|
||||
SE_STATUS
|
||||
inherit
|
||||
ANY
|
||||
redefine
|
||||
out
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
status: INTEGER_32
|
||||
session_id: detachable STRING_32
|
||||
state: detachable STRING_32
|
||||
class_name: detachable STRING_32
|
||||
value : detachable SE_STATUS_VALUE
|
||||
hash_code: detachable STRING_32
|
||||
|
||||
feature -- Change Element
|
||||
set_status (a_status : INTEGER_32)
|
||||
do
|
||||
status := a_status
|
||||
end
|
||||
|
||||
set_session_id (a_session_id : STRING_32)
|
||||
do
|
||||
session_id := a_session_id
|
||||
end
|
||||
|
||||
set_state (a_state : STRING_32)
|
||||
do
|
||||
state := a_state
|
||||
end
|
||||
|
||||
set_class_name (a_class_name : STRING_32)
|
||||
do
|
||||
class_name := a_class_name
|
||||
end
|
||||
|
||||
set_value (a_value : SE_STATUS_VALUE)
|
||||
do
|
||||
value := a_value
|
||||
end
|
||||
|
||||
set_hash_code (a_hash_code : STRING_32)
|
||||
do
|
||||
hash_code := a_hash_code
|
||||
end
|
||||
|
||||
out : STRING
|
||||
do
|
||||
create Result.make_from_string ("Response : ")
|
||||
Result.append ("[Status:")
|
||||
Result.append (status.out)
|
||||
Result.append ("]")
|
||||
Result.append (" ")
|
||||
|
||||
if attached session_id as l_session_id then
|
||||
Result.append ("[SessionId:")
|
||||
Result.append (l_session_id.out)
|
||||
Result.append ("]")
|
||||
Result.append (" ")
|
||||
end
|
||||
if attached state as l_state then
|
||||
Result.append ("[State:")
|
||||
Result.append (l_state.out)
|
||||
Result.append ("]")
|
||||
Result.append (" ")
|
||||
end
|
||||
if attached value as l_value then
|
||||
Result.append ("[value:")
|
||||
Result.append (l_value.out)
|
||||
Result.append ("]")
|
||||
Result.append (" ")
|
||||
end
|
||||
|
||||
if attached class_name as l_class_name then
|
||||
Result.append ("[Class Name:")
|
||||
Result.append (l_class_name.out)
|
||||
Result.append ("]")
|
||||
Result.append (" ")
|
||||
end
|
||||
|
||||
if attached hash_code as l_hash_code then
|
||||
Result.append ("[hCode:")
|
||||
Result.append (l_hash_code.out)
|
||||
Result.append ("]")
|
||||
Result.append (" ")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,53 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {STATUS}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_STATUS_VALUE
|
||||
create
|
||||
make,
|
||||
make_empty
|
||||
|
||||
feature {NONE}-- Initialization
|
||||
make (an_os_value : SE_OS_VALUE; a_java_value :SE_JAVA_VALUE; a_build_value: SE_BUILD_VALUE )
|
||||
do
|
||||
set_os_value (an_os_value)
|
||||
set_java_value (a_java_value)
|
||||
set_build_value (a_build_value)
|
||||
end
|
||||
|
||||
make_empty
|
||||
do
|
||||
|
||||
end
|
||||
feature -- Access
|
||||
os_value: detachable SE_OS_VALUE
|
||||
|
||||
java_value : detachable SE_JAVA_VALUE
|
||||
|
||||
build_value : detachable SE_BUILD_VALUE
|
||||
|
||||
feature -- Change Element
|
||||
set_os_value (an_os_value : SE_OS_VALUE)
|
||||
-- Set os_value with `an_os_value'
|
||||
do
|
||||
os_value := an_os_value
|
||||
end
|
||||
|
||||
set_build_value (a_build_value : SE_BUILD_VALUE)
|
||||
-- Set build_value with `a_build_value'
|
||||
do
|
||||
build_value := a_build_value
|
||||
end
|
||||
|
||||
set_java_value (a_java_value : SE_JAVA_VALUE)
|
||||
-- Set java_value with `a_java_value'
|
||||
do
|
||||
|
||||
java_value := a_java_value
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,95 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_BUTTON}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_BUTTON
|
||||
inherit {NONE}
|
||||
ENUM
|
||||
|
||||
|
||||
create
|
||||
make_left,
|
||||
make_middle,
|
||||
make_right
|
||||
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make_left
|
||||
do
|
||||
set_left
|
||||
end
|
||||
|
||||
make_middle
|
||||
do
|
||||
set_middle
|
||||
end
|
||||
|
||||
make_right
|
||||
do
|
||||
set_right
|
||||
end
|
||||
|
||||
|
||||
feature -- Access
|
||||
|
||||
is_valid_value (a_value: INTEGER): BOOLEAN
|
||||
-- Can `a_value' be used in a `set_value' feature call?
|
||||
do
|
||||
Result := (a_value = left_value) or else
|
||||
(a_value = middle_value) or else
|
||||
(a_value = right_value)
|
||||
end
|
||||
|
||||
feature -- Element Change
|
||||
|
||||
set_left
|
||||
do
|
||||
value := left_value
|
||||
end
|
||||
|
||||
set_middle
|
||||
do
|
||||
value := middle_value
|
||||
end
|
||||
|
||||
set_right
|
||||
do
|
||||
value := right_value
|
||||
end
|
||||
|
||||
|
||||
feature -- Query
|
||||
|
||||
is_left : BOOLEAN
|
||||
-- is the current value left?
|
||||
do
|
||||
Result := (value = left_value)
|
||||
end
|
||||
|
||||
is_middle : BOOLEAN
|
||||
-- is the current value middle?
|
||||
do
|
||||
Result := (value = middle_value)
|
||||
end
|
||||
|
||||
|
||||
is_right : BOOLEAN
|
||||
-- is the current value right?
|
||||
do
|
||||
Result := (value = right_value)
|
||||
end
|
||||
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
-- {LEFT = 0, MIDDLE = 1 , RIGHT = 2}
|
||||
left_value :INTEGER = 0
|
||||
middle_value : INTEGER = 1
|
||||
right_value : INTEGER = 2
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
note
|
||||
description: "Objects used to locate elements within a document"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_BY
|
||||
inherit
|
||||
JSON_HELPER
|
||||
SE_LOCATOR_STRATEGY_CONSTANTS
|
||||
|
||||
create default_create
|
||||
|
||||
feature -- Access
|
||||
id ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `id' and value `value'
|
||||
-- { "using" : "id", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_id)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_id_strategy : has_correct_stategy (Result, se_id)
|
||||
end
|
||||
|
||||
name ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `name' and value `value'
|
||||
-- { "using" : "name", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_name)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_name_strategy : has_correct_stategy (Result, se_name)
|
||||
end
|
||||
|
||||
class_name ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `class name' and value `value'
|
||||
-- { "using" : "class name", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_class_name)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_class_name_strategy : has_correct_stategy (Result, se_class_name)
|
||||
end
|
||||
|
||||
|
||||
css_selector ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `css selector' and value `value'
|
||||
-- { "using" : "css selector", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_css_selector)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_css_selector_strategy : has_correct_stategy (Result, se_css_selector)
|
||||
end
|
||||
|
||||
link_text ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `link text' and value `value'
|
||||
-- { "using" : "link text", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_link_text)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_link_text_strategy : has_correct_stategy (Result, se_link_text)
|
||||
end
|
||||
|
||||
|
||||
partial_link_text ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `partial link text' and value `value'
|
||||
-- { "using" : "partial link text", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_partial_link_text)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_partial_link_text_strategy : has_correct_stategy (Result, se_partial_link_text)
|
||||
end
|
||||
|
||||
tag_name ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `tag name' and value `value'
|
||||
-- { "using" : "tag name", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_tag_name)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_tag_name_strategy : has_correct_stategy (Result, se_tag_name)
|
||||
end
|
||||
|
||||
|
||||
xpath ( value : STRING_32 ) : STRING_32
|
||||
-- return a STRING representing a JSON
|
||||
-- with strategy by `xpath' and value `value'
|
||||
-- { "using" : "xpath", "value":value }
|
||||
do
|
||||
create Result.make_from_string (json_template)
|
||||
Result.replace_substring_all ("$using", se_xpath)
|
||||
Result.replace_substring_all ("$value", value)
|
||||
ensure
|
||||
has_xpath_strategy : has_correct_stategy (Result, se_xpath)
|
||||
end
|
||||
|
||||
|
||||
feature -- Query
|
||||
has_correct_stategy (data: STRING_32; strategy : STRING_32) : BOOLEAN
|
||||
do
|
||||
if attached {JSON_OBJECT} string_to_json(data) as l_json then
|
||||
if attached l_json.item ("using") as l_using then
|
||||
Result := (l_using.representation).is_case_insensitive_equal_general ("%""+strategy+"%"")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
is_valid_strategy (data : STRING_32) : BOOLEAN
|
||||
-- if data is using on of the following strategies
|
||||
-- class name
|
||||
-- css selector
|
||||
-- id
|
||||
-- name
|
||||
-- link text
|
||||
-- partial link text
|
||||
-- tag name
|
||||
-- xpath
|
||||
-- return True in othercase False
|
||||
do
|
||||
Result := has_correct_stategy (data, se_class_name) or else
|
||||
has_correct_stategy (data, se_css_selector) or else
|
||||
has_correct_stategy (data, se_id) or else
|
||||
has_correct_stategy (data, se_link_text) or else
|
||||
has_correct_stategy (data, se_name) or else
|
||||
has_correct_stategy (data, se_partial_link_text) or else
|
||||
has_correct_stategy (data, se_tag_name) or else
|
||||
has_correct_stategy (data, se_xpath)
|
||||
end
|
||||
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
json_template : String = "[
|
||||
{"using" :"$using",
|
||||
"value" : "$value"}
|
||||
]"
|
||||
end
|
||||
@@ -1,149 +0,0 @@
|
||||
note
|
||||
description: "Object that describe available features a client can submit in a WebDriver session. Not all server implementations will support every WebDriver feature."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
EIS: "name=Capabilities", "protocl=http", "src=https://code.google.com/p/selenium/wiki/JsonWireProtocol#Desired_Capabilities"
|
||||
class
|
||||
SE_CAPABILITIES
|
||||
|
||||
create
|
||||
make
|
||||
feature -- Initialization
|
||||
make
|
||||
-- defaults initializations
|
||||
do
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
browser_name : detachable STRING_32
|
||||
--The name of the browser being used; should be one of {chrome|firefox|htmlunit|internet explorer|iphone}
|
||||
|
||||
version : detachable STRING_32
|
||||
-- The browser version, or the empty string if unknown.
|
||||
|
||||
platform : detachable STRING_32
|
||||
-- A key specifying which platform the browser is running on. This value should be one of {WINDOWS|XP|VISTA|MAC|LINUX|UNIX}.
|
||||
-- When requesting a new session, the client may specify ANY to indicate any available platform may be used.
|
||||
|
||||
is_javascript_enabled : BOOLEAN
|
||||
--Whether the session supports executing user supplied JavaScript in the context of the current page.
|
||||
|
||||
takes_screenshot : BOOLEAN
|
||||
--Whether the session supports taking screenshots of the current page.
|
||||
|
||||
handles_alerts : BOOLEAN
|
||||
--Whether the session can interact with modal popups, such as window.alert and window.confirm.
|
||||
|
||||
is_database_enabled : BOOLEAN
|
||||
--Whether the session can interact database storage.
|
||||
|
||||
is_location_context_enabled : BOOLEAN
|
||||
--Whether the session can set and query the browser's location context.
|
||||
|
||||
is_application_cache_enabled : BOOLEAN
|
||||
--Whether the session can interact with the application cache.
|
||||
|
||||
is_browser_connection_enabled : BOOLEAN
|
||||
--Whether the session can query for the browser's connectivity and disable it if desired.
|
||||
|
||||
is_css_selectors_enabled : BOOLEAN
|
||||
--Whether the session supports CSS selectors when searching for elements.
|
||||
|
||||
is_web_storage_enabled : BOOLEAN
|
||||
--Whether the session supports interactions with storage objects.
|
||||
|
||||
is_rotatable : BOOLEAN
|
||||
--Whether the session can rotate the current page's current layout between portrait and landscape orientations (only applies to mobile platforms).
|
||||
|
||||
accept_ssl_certs : BOOLEAN
|
||||
--Whether the session should accept all SSL certs by default.
|
||||
|
||||
native_events : BOOLEAN
|
||||
--Whether the session is capable of generating native events when simulating user input.
|
||||
|
||||
proxy : detachable WEB_DRIVER_PROXY
|
||||
--Details of any proxy to use. If no proxy is specified, whatever the system's current or default state is used. The format is specified under Proxy JSON Object.
|
||||
|
||||
feature -- Change Elemenet
|
||||
set_browser_name (a_browser_name : STRING_32)
|
||||
do
|
||||
browser_name := a_browser_name
|
||||
end
|
||||
|
||||
set_version (a_version : STRING_32)
|
||||
do
|
||||
version := a_version
|
||||
end
|
||||
|
||||
set_platform (a_platform : STRING_32)
|
||||
do
|
||||
platform := a_platform
|
||||
end
|
||||
|
||||
set_javascript_enabled ( value : BOOLEAN)
|
||||
do
|
||||
is_javascript_enabled := value
|
||||
end
|
||||
|
||||
set_takes_screenshot (value : BOOLEAN)
|
||||
do
|
||||
takes_screenshot := value
|
||||
end
|
||||
|
||||
set_handles_alerts ( value: BOOLEAN)
|
||||
do
|
||||
handles_alerts := value
|
||||
end
|
||||
|
||||
set_database_enabled (value : BOOLEAN)
|
||||
do
|
||||
is_database_enabled := value
|
||||
end
|
||||
|
||||
set_location_context_enabled (value:BOOLEAN)
|
||||
do
|
||||
is_location_context_enabled := value
|
||||
end
|
||||
|
||||
set_application_cache_enabled (value : BOOLEAN)
|
||||
do
|
||||
is_application_cache_enabled := value
|
||||
end
|
||||
|
||||
set_browser_connection_enabled (value : BOOLEAN)
|
||||
do
|
||||
is_browser_connection_enabled := value
|
||||
end
|
||||
|
||||
set_css_selectors_enabled (value : BOOLEAN)
|
||||
do
|
||||
is_css_selectors_enabled := value
|
||||
end
|
||||
|
||||
set_web_storage_enabled (value : BOOLEAN)
|
||||
do
|
||||
is_web_storage_enabled := value
|
||||
end
|
||||
|
||||
set_rotatable (value : BOOLEAN)
|
||||
do
|
||||
is_rotatable := value
|
||||
end
|
||||
|
||||
set_accept_ssl_certs (value : BOOLEAN)
|
||||
do
|
||||
accept_ssl_certs := value
|
||||
end
|
||||
|
||||
set_native_events ( value : BOOLEAN)
|
||||
do
|
||||
native_events := value
|
||||
end
|
||||
|
||||
set_proxy ( a_proxy : WEB_DRIVER_PROXY)
|
||||
do
|
||||
proxy := a_proxy
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,96 +0,0 @@
|
||||
note
|
||||
description: "Objects that describe a cookie. When returning Cookie objects, the server should only omit an optional field if it is incapable of providing the information."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_COOKIE
|
||||
|
||||
create
|
||||
default_create, make_with_values
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make_with_values (a_name: STRING_32; a_value: STRING_32; a_path: STRING_32; a_domain: STRING_32)
|
||||
do
|
||||
set_name (a_name)
|
||||
set_path (a_path)
|
||||
set_value (a_value)
|
||||
set_domain (a_domain)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
name: detachable STRING_32
|
||||
--The name of the cookie.
|
||||
|
||||
value: detachable STRING_32
|
||||
-- The cookie value.
|
||||
|
||||
path: detachable STRING_32
|
||||
--(Optional) The cookie path
|
||||
|
||||
domain: detachable STRING_32
|
||||
--(Optional) The domain the cookie is visible to.
|
||||
|
||||
is_secure: BOOLEAN
|
||||
--(Optional) Whether the cookie is a secure cookie
|
||||
|
||||
expiry: NATURAL_32
|
||||
-- (Optional) When the cookie expires, specified in seconds since midnight, January 1, 1970 UTC.1
|
||||
|
||||
feature -- Change Element
|
||||
|
||||
set_name (a_name: STRING_32)
|
||||
do
|
||||
name := a_name
|
||||
ensure
|
||||
assigned_name: name ~ a_name
|
||||
end
|
||||
|
||||
set_value (a_value: STRING_32)
|
||||
do
|
||||
value := a_value
|
||||
ensure
|
||||
assigned_value: value ~ a_value
|
||||
end
|
||||
|
||||
set_path (a_path: STRING_32)
|
||||
do
|
||||
path := a_path
|
||||
ensure
|
||||
assigned_path: path ~ a_path
|
||||
end
|
||||
|
||||
set_domain (a_domain: STRING_32)
|
||||
do
|
||||
domain := a_domain
|
||||
ensure
|
||||
assigned_domain: domain ~ a_domain
|
||||
end
|
||||
|
||||
secure
|
||||
-- set the cookie as secure
|
||||
do
|
||||
is_secure := True
|
||||
ensure
|
||||
is_secure: is_secure
|
||||
end
|
||||
|
||||
insecure
|
||||
-- set the cookie as insecure
|
||||
do
|
||||
is_secure := False
|
||||
ensure
|
||||
is_not_secure: not is_secure
|
||||
end
|
||||
|
||||
set_expiry (an_expiry: NATURAL)
|
||||
do
|
||||
expiry := an_expiry
|
||||
ensure
|
||||
assigned_expiry: expiry ~ an_expiry
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_DIMENSION}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_DIMENSION
|
||||
create
|
||||
default_create,
|
||||
make_with_values
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make_with_values (a_width : NATURAL_32; a_height : NATURAL_32)
|
||||
do
|
||||
set_width (a_width)
|
||||
set_height (a_height)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
--{ width: number, height: number} The size of the window.
|
||||
width : NATURAL_32
|
||||
height : NATURAL_32
|
||||
-- The width and height of the element, in pixels.
|
||||
|
||||
|
||||
feature -- Change Element
|
||||
set_width (a_width : NATURAL_32)
|
||||
--Set width to `a_width'
|
||||
do
|
||||
width := a_width
|
||||
ensure
|
||||
width_set : width = a_width
|
||||
end
|
||||
|
||||
set_height (a_height : NATURAL_32)
|
||||
do
|
||||
height := a_height
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_ERROR}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_ERROR
|
||||
|
||||
create
|
||||
make
|
||||
feature -- Initialization
|
||||
make (a_code : INTEGER_32; a_summary : STRING_32; a_detail : STRING_32)
|
||||
do
|
||||
code := a_code
|
||||
summary := a_summary
|
||||
detail := a_detail
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
code : INTEGER_32
|
||||
summary : STRING_32
|
||||
detail : STRING_32
|
||||
|
||||
feature -- Report
|
||||
full_message : STRING_32
|
||||
-- Full error description
|
||||
do
|
||||
create Result.make_empty
|
||||
Result.append ("code : " + code.out + " - summary:" + summary + " - detail:" + detail)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,128 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_KEY_CONSTANTS}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_KEY_CONSTANTS
|
||||
|
||||
feature -- Access
|
||||
|
||||
Null_key: STRING_32 = "\uE000"
|
||||
|
||||
Cancel_key: STRING_32 = "\uE001"
|
||||
|
||||
Help_key: STRING_32 = "\uE002"
|
||||
|
||||
Backspace_key: STRING_32 = "\uE003"
|
||||
|
||||
Tab_key: STRING_32 = "\uE004"
|
||||
|
||||
Clear_key: STRING_32 = "\uE005"
|
||||
|
||||
Return_key: STRING_32 = "\uE006"
|
||||
|
||||
Enter_key: STRING_32 = "\uE007"
|
||||
|
||||
Shift_key: STRING_32 = "\uE008"
|
||||
|
||||
Control_key: STRING_32 = "\uE009"
|
||||
|
||||
Alt_key: STRING_32 = "\uE00A"
|
||||
|
||||
Pause_key: STRING_32 = "\uE00B"
|
||||
|
||||
Escape_key: STRING_32 = "\uE00C"
|
||||
|
||||
Space_key: STRING_32 = "\uE00D"
|
||||
|
||||
PageUp_key: STRING_32 = "\uE00E"
|
||||
|
||||
PageDown_key: STRING_32 = "\uE00F"
|
||||
|
||||
End_key: STRING_32 = "\uE010"
|
||||
|
||||
Home_key: STRING_32 = "\uE011"
|
||||
|
||||
LeftArrow_key: STRING_32 = "\uE012"
|
||||
|
||||
UpArrow_key: STRING_32 = "\uE013"
|
||||
|
||||
RightArrow_key: STRING_32 = "\uE014"
|
||||
|
||||
DownArrow_key: STRING_32 = "\uE015"
|
||||
|
||||
Insert_key: STRING_32 = "\uE016"
|
||||
|
||||
Delete_key: STRING_32 = "\uE017"
|
||||
|
||||
Semicolon_key: STRING_32 = "\uE018"
|
||||
|
||||
Equals_key: STRING_32 = "\uE019"
|
||||
|
||||
Numpad0_key: STRING_32 = "\uE01A"
|
||||
|
||||
Numpad1_key: STRING_32 = "\uE01B"
|
||||
|
||||
Numpad2_key: STRING_32 = "\uE01C"
|
||||
|
||||
Numpad3_key: STRING_32 = "\uE01D"
|
||||
|
||||
Numpad4_key: STRING_32 = "\uE01E"
|
||||
|
||||
Numpad5_key: STRING_32 = "\uE01F"
|
||||
|
||||
Numpad6_key: STRING_32 = "\uE020"
|
||||
|
||||
Numpad7_key: STRING_32 = "\uE021"
|
||||
|
||||
Numpad8_key: STRING_32 = "\uE022"
|
||||
|
||||
Numpad9_key: STRING_32 = "\uE023"
|
||||
|
||||
Multiply_key: STRING_32 = "\uE024"
|
||||
|
||||
Add_key: STRING_32 = "\uE025"
|
||||
|
||||
Separator_key: STRING_32 = "\uE026"
|
||||
|
||||
Subtract_key: STRING_32 = "\uE027"
|
||||
|
||||
Decimal_key: STRING_32 = "\uE028"
|
||||
|
||||
Divide_key: STRING_32 = "\uE029"
|
||||
|
||||
F1_key: STRING_32 = "\uE031"
|
||||
|
||||
F2_key: STRING_32 = "\uE032"
|
||||
|
||||
F3_key: STRING_32 = "\uE033"
|
||||
|
||||
F4_key: STRING_32 = "\uE034"
|
||||
|
||||
F5_key: STRING_32 = "\uE035"
|
||||
|
||||
F6_key: STRING_32 = "\uE036"
|
||||
|
||||
F7_key: STRING_32 = "\uE037"
|
||||
|
||||
F8_key: STRING_32 = "\uE038"
|
||||
|
||||
F9_key: STRING_32 = "\uE039"
|
||||
|
||||
F10_key: STRING_32 = "\uE03A"
|
||||
|
||||
F11_key: STRING_32 = "\uE03B"
|
||||
|
||||
F12_key: STRING_32 = "\uE03C"
|
||||
|
||||
Command_key: STRING_32 = "\uE03D"
|
||||
|
||||
Meta_key: STRING_32 = "\uE03D"
|
||||
|
||||
keys: ARRAY [STRING_32]
|
||||
once
|
||||
Result := <<Null_key, Cancel_key, Help_key, Backspace_key, Tab_key, Clear_key, Return_key, Enter_key, Shift_key, Control_key, Alt_key, Pause_key, Escape_key, Space_key, PageUp_key, PageDown_key, End_key, Home_key, LeftArrow_key, UpArrow_key, RightArrow_key, DownArrow_key, Insert_key, Delete_key, Semicolon_key, Equals_key, Numpad0_key, Numpad1_key, Numpad2_key, Numpad3_key, Numpad4_key, Numpad5_key, Numpad6_key, Numpad7_key, Numpad8_key, Numpad9_key, Multiply_key, Add_key, Separator_key, Subtract_key, Decimal_key, Divide_key, F1_key, F2_key, F3_key, F4_key, F5_key, F6_key, F7_key, F8_key, F9_key, F10_key, F11_key, F12_key, Command_key, Meta_key>>
|
||||
end
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_KEY_STROKE}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_KEY_STROKE
|
||||
|
||||
inherit
|
||||
|
||||
SE_KEY_CONSTANTS
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_key: STRING_32)
|
||||
require
|
||||
is_valid: keys.has (a_key)
|
||||
do
|
||||
set_key (a_key)
|
||||
ensure
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
key: STRING_32
|
||||
-- current key
|
||||
|
||||
feature -- Change Element
|
||||
|
||||
set_key (a_key: STRING_32)
|
||||
--Set `key' to `a_key'
|
||||
require
|
||||
is_valid: keys.has (a_key)
|
||||
do
|
||||
key := a_key
|
||||
ensure
|
||||
key_set: key = a_key
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,63 +0,0 @@
|
||||
note
|
||||
description: "Objects representing basic keyboards operations"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_KEYBOARD
|
||||
|
||||
create
|
||||
make
|
||||
feature {NONE} -- Initialization
|
||||
make ( a_web_driver : like driver)
|
||||
-- Create an object se_keyboard with his driver
|
||||
do
|
||||
driver := a_web_driver
|
||||
ensure
|
||||
web_driver_set : driver = a_web_driver
|
||||
end
|
||||
|
||||
feature --Access
|
||||
send_keys (keys : ARRAY[STRING_32])
|
||||
do
|
||||
if attached driver.active_element as l_active_element then
|
||||
l_active_element.send_keys (keys)
|
||||
end
|
||||
end
|
||||
|
||||
press_key ( key : SE_KEY_STROKE)
|
||||
local
|
||||
l_data : STRING_32
|
||||
do
|
||||
create l_data.make_from_string (json_template)
|
||||
l_data.replace_substring_all ("$value", key.key)
|
||||
l_data.replace_substring_all ("$boolean", "True")
|
||||
if attached driver.session as l_session then
|
||||
driver.api.modifier (l_session.session_id, l_data)
|
||||
end
|
||||
end
|
||||
|
||||
release_key ( key : SE_KEY_STROKE)
|
||||
local
|
||||
l_data : STRING_32
|
||||
do
|
||||
create l_data.make_from_string (json_template)
|
||||
l_data.replace_substring_all ("$value", key.key)
|
||||
l_data.replace_substring_all ("$boolean", "False")
|
||||
if attached driver.session as l_session then
|
||||
driver.api.modifier (l_session.session_id, l_data )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
driver : WEB_DRIVER
|
||||
-- web_driver
|
||||
|
||||
json_template : String = "[
|
||||
{"value" :"$value",
|
||||
"isdown" : $boolean}
|
||||
]"
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_LOCATOR_STRATEGY_CONSTANTS}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
SE_LOCATOR_STRATEGY_CONSTANTS
|
||||
|
||||
feature -- Constants
|
||||
se_class_name : STRING_32 = "class name"
|
||||
|
||||
se_css_selector : STRING_32 = "css selector"
|
||||
|
||||
se_id : STRING_32 = "id"
|
||||
|
||||
se_name : STRING_32 = "name"
|
||||
|
||||
se_link_text : STRING_32 = "link text"
|
||||
|
||||
se_partial_link_text : STRING_32 = "partial link text"
|
||||
|
||||
se_tag_name : STRING_32 = "tag name"
|
||||
|
||||
se_xpath : STRING_32 = "xpath"
|
||||
|
||||
|
||||
end
|
||||
@@ -1,11 +0,0 @@
|
||||
note
|
||||
|
||||
description: "Summary description for {SE_MOUSE}."
|
||||
|
||||
author: ""
|
||||
|
||||
date: "$Date$"
|
||||
|
||||
revision: "$Revision$"
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_POINT}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_POINT
|
||||
|
||||
create
|
||||
default_create,
|
||||
make_with_values
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make_with_values (new_x : INTEGER_32; new_y : INTEGER_32)
|
||||
do
|
||||
set_x (new_x)
|
||||
set_y (new_y)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
x : INTEGER_32
|
||||
y : INTEGER_32
|
||||
|
||||
-- The X and Y coordinates for the element.
|
||||
|
||||
feature -- Change Element
|
||||
|
||||
set_x (an_x : INTEGER_32)
|
||||
do
|
||||
x := an_x
|
||||
end
|
||||
|
||||
set_y (an_y : INTEGER_32)
|
||||
do
|
||||
y := an_y
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,12 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_SCREEN_ORIENTATION}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_SCREEN_ORIENTATION
|
||||
|
||||
|
||||
-- {LANDSCAPE|PORTRAIT}
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
note
|
||||
description: "Object that represent an active session"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_SESSION
|
||||
|
||||
create
|
||||
make
|
||||
feature -- Initializaton
|
||||
make (a_session_id : STRING_32; a_capabilities: SE_CAPABILITIES)
|
||||
do
|
||||
session_id := a_session_id
|
||||
capabilities := a_capabilities
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
session_id : STRING_32
|
||||
-- The session id.
|
||||
|
||||
capabilities : SE_CAPABILITIES
|
||||
-- An object describing the session's capabilities.
|
||||
|
||||
end
|
||||
@@ -1,46 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {SE_TIMEOUT_TYPE}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
SE_TIMEOUT_TYPE
|
||||
|
||||
-- TODO add contracts to validate the timeout types.
|
||||
create
|
||||
make,
|
||||
make_empty
|
||||
|
||||
feature -- Initialization
|
||||
make (a_type : STRING_32; a_ms : INTEGER_32)
|
||||
do
|
||||
set_type (a_type)
|
||||
set_ms (a_ms)
|
||||
end
|
||||
|
||||
make_empty
|
||||
do
|
||||
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
type : detachable STRING_32
|
||||
-- The type of operation to set the timeout for.
|
||||
-- Valid values are: "script" for script timeouts,
|
||||
-- "implicit" for modifying the implicit wait timeout and
|
||||
-- "page load" for setting a page load timeout.
|
||||
ms : INTEGER_32
|
||||
-- The amount of time, in milliseconds, that time-limited commands are permitted to run.
|
||||
|
||||
feature -- Change Element
|
||||
set_type (a_type : STRING_32)
|
||||
do
|
||||
type := a_type
|
||||
end
|
||||
|
||||
set_ms (a_ms : INTEGER_32)
|
||||
do
|
||||
ms := a_ms
|
||||
end
|
||||
end
|
||||
@@ -1,486 +0,0 @@
|
||||
note
|
||||
description: "Objects that represent a Web Browser"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_DRIVER
|
||||
|
||||
inherit
|
||||
|
||||
EXCEPTIONS
|
||||
|
||||
create
|
||||
make, make_with_host
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
create api.make
|
||||
end
|
||||
|
||||
make_with_host (a_host: STRING)
|
||||
do
|
||||
create api.make_with_host (a_host)
|
||||
end
|
||||
|
||||
feature -- Initialize Session
|
||||
|
||||
start_session_firefox
|
||||
local
|
||||
l_capabilities: SE_CAPABILITIES
|
||||
do
|
||||
create l_capabilities.make
|
||||
l_capabilities.set_browser_name ("firefox")
|
||||
session := api.create_session_with_desired_capabilities (l_capabilities)
|
||||
end
|
||||
|
||||
start_session_firefox_with_desired_capabilities (a_desired_capabilities: SE_CAPABILITIES)
|
||||
require
|
||||
browser_name_firefox: attached a_desired_capabilities.browser_name as l_browser_name and then l_browser_name ~ "firefox"
|
||||
do
|
||||
session := api.create_session_with_desired_capabilities (a_desired_capabilities)
|
||||
end
|
||||
|
||||
start_session_chrome
|
||||
local
|
||||
l_capabilities: SE_CAPABILITIES
|
||||
env: EXECUTION_ENVIRONMENT
|
||||
retried: BOOLEAN
|
||||
do
|
||||
create l_capabilities.make
|
||||
l_capabilities.set_browser_name ("chrome")
|
||||
if not retried then
|
||||
session := api.create_session_with_desired_capabilities (l_capabilities)
|
||||
if not is_session_active then
|
||||
raise ("Session not active")
|
||||
end
|
||||
else
|
||||
session := api.create_session_with_desired_capabilities (l_capabilities)
|
||||
end
|
||||
rescue
|
||||
retried := true
|
||||
create env
|
||||
env.sleep (1000)
|
||||
retry
|
||||
end
|
||||
|
||||
start_session_chrome_with_desired_capabilities (a_desired_capabilities: SE_CAPABILITIES)
|
||||
require
|
||||
browser_name_chrome: attached a_desired_capabilities.browser_name as l_browser_name and then l_browser_name ~ "chrome"
|
||||
local
|
||||
env: EXECUTION_ENVIRONMENT
|
||||
retried: BOOLEAN
|
||||
do
|
||||
if not retried then
|
||||
session := api.create_session_with_desired_capabilities (a_desired_capabilities)
|
||||
if not is_session_active then
|
||||
raise ("Session not active")
|
||||
end
|
||||
else
|
||||
session := api.create_session_with_desired_capabilities (a_desired_capabilities)
|
||||
end
|
||||
rescue
|
||||
retried := true
|
||||
create env
|
||||
env.sleep (1000)
|
||||
retry
|
||||
end
|
||||
|
||||
start_session_ie
|
||||
local
|
||||
l_capabilities: SE_CAPABILITIES
|
||||
do
|
||||
create l_capabilities.make
|
||||
l_capabilities.set_browser_name ("internet explorer")
|
||||
session := api.create_session_with_desired_capabilities (l_capabilities)
|
||||
end
|
||||
|
||||
start_session_ie_with_desired_capabilities (a_desired_capabilities: SE_CAPABILITIES)
|
||||
require
|
||||
browser_name_chrome: attached a_desired_capabilities.browser_name as l_browser_name and then l_browser_name ~ "internet explorer"
|
||||
do
|
||||
session := api.create_session_with_desired_capabilities (a_desired_capabilities)
|
||||
end
|
||||
|
||||
--|TODO add create session with desired and required capabilities
|
||||
--| add other drivers.
|
||||
--| think about pre and postconditions
|
||||
|
||||
feature -- Query
|
||||
|
||||
is_session_active: BOOLEAN
|
||||
-- exist a valid session?
|
||||
do
|
||||
Result := attached session
|
||||
end
|
||||
|
||||
feature -- Ime Handler
|
||||
|
||||
activate_engine (engine: STRING_32)
|
||||
-- Make an engines that is available (appears on the list returned by getAvailableEngines) active.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.ime_activate (l_session.session_id, engine)
|
||||
end
|
||||
end
|
||||
|
||||
deactivate
|
||||
-- De-activates the currently-active IME engine.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.ime_deactivate (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
available_engines: detachable LIST [STRING_32]
|
||||
-- List all available engines on the machine. To use an engine, it has to be present in this list.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.ime_available_engines (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
is_activated: BOOLEAN
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.ime_activated (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Navigation
|
||||
|
||||
back
|
||||
-- Navigate backwards in the browser history, if possible.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.back (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
forward
|
||||
-- Navigate forwards in the browser history, if possible.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.forward (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
refresh
|
||||
--
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.refresh (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
to_url (an_url: STRING_32)
|
||||
-- Navigate to a new URL.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.navigate_to_url (l_session.session_id, an_url)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Options
|
||||
-- Stuff you would do in a browser menu
|
||||
|
||||
add_cookie (cookie: SE_COOKIE)
|
||||
-- Set a cookie. If the cookie path is not specified, it should be set to "/".
|
||||
-- Likewise, if the domain is omitted, it should default to the current page's domain.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.set_cookie (l_session.session_id, cookie)
|
||||
end
|
||||
end
|
||||
|
||||
delete_all_cookies
|
||||
-- Delete all cookies visible to the current page.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.delete_cookies (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
delete_cookie (cookie: SE_COOKIE)
|
||||
-- Delete the cookie with the given name.
|
||||
-- This command should be a no-op if there is no such cookie visible to the current page.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session and then attached cookie.name as l_name then
|
||||
api.delete_cookie_by_name (l_session.session_id, l_name)
|
||||
end
|
||||
end
|
||||
|
||||
get_cookies: detachable LIST [SE_COOKIE]
|
||||
-- Retrieve all cookies visible to the current page.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.retrieve_cookies (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
get_cookie (name: STRING_32): detachable SE_COOKIE
|
||||
-- Get a cookie with a given name
|
||||
require
|
||||
exist_session: is_session_active
|
||||
local
|
||||
found: BOOLEAN
|
||||
do
|
||||
if attached session as l_session then
|
||||
if attached api.retrieve_cookies (l_session.session_id) as l_list then
|
||||
from
|
||||
l_list.start
|
||||
until
|
||||
l_list.after or found
|
||||
loop
|
||||
if attached l_list.item.name as l_name and then l_name.is_case_insensitive_equal (name) then
|
||||
found := true
|
||||
Result := l_list.item
|
||||
end
|
||||
l_list.forth
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Target Locator
|
||||
|
||||
active_element: detachable WEB_ELEMENT
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.element_active (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
default_content
|
||||
-- The server switch to the page's default content.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.frame (l_session.session_id, Void)
|
||||
end
|
||||
end
|
||||
|
||||
frame_by_index (index: INTEGER)
|
||||
-- Select a frame by index `index'
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.frame (l_session.session_id, index.out)
|
||||
end
|
||||
end
|
||||
|
||||
frame_by_name (name: STRING_32)
|
||||
-- Select a frame by name `name'
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.frame (l_session.session_id, name)
|
||||
end
|
||||
end
|
||||
|
||||
frame_by_web_element (element: WEB_ELEMENT)
|
||||
-- Select a frame by name `name'
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.frame (l_session.session_id, element.element)
|
||||
end
|
||||
end
|
||||
|
||||
window (name: STRING_32)
|
||||
-- Change focus to another window.
|
||||
-- The window to change focus to may be specified by its server assigned window handle, or by the value of its name attribute.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.change_focus_window (l_session.session_id, name)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Window
|
||||
|
||||
window_position: SE_POINT
|
||||
-- Get the position of the current window.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
create Result
|
||||
if attached session as l_session then
|
||||
Result := api.window_position (l_session.session_id, "current")
|
||||
end
|
||||
end
|
||||
|
||||
window_size: SE_DIMENSION
|
||||
--Get the size of the current window.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
create Result
|
||||
if attached session as l_session then
|
||||
Result := api.size_window (l_session.session_id, "current")
|
||||
end
|
||||
end
|
||||
|
||||
window_maximize
|
||||
--Maximizes the current window if it is not already maximized
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.window_maximize (l_session.session_id, "current")
|
||||
end
|
||||
end
|
||||
|
||||
set_window_position (target_position: SE_POINT)
|
||||
-- Set the position of the current window.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.change_window_position (l_session.session_id, "current", target_position.x, target_position.y)
|
||||
end
|
||||
end
|
||||
|
||||
set_window_size (target_size: SE_DIMENSION)
|
||||
--Set the size of the current window.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.change_size_window (l_session.session_id, "current", target_size.width, target_size.height)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Common
|
||||
|
||||
window_close
|
||||
--Close the current window, quitting the browser if it's the last window currently open.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.close_window (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
find_element (by: STRING_32): detachable WEB_ELEMENT
|
||||
-- Find the first WebElement using the given strategy.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
valid_strategy: (create {SE_BY}).is_valid_strategy (by)
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.search_element (l_session.session_id, by)
|
||||
end
|
||||
end
|
||||
|
||||
find_elements (by: STRING_32): detachable LIST [WEB_ELEMENT]
|
||||
-- Find all elements within the current page using the given mechanism..
|
||||
require
|
||||
exist_session: is_session_active
|
||||
valid_strategy: (create {SE_BY}).is_valid_strategy (by)
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.search_elements (l_session.session_id, by)
|
||||
end
|
||||
end
|
||||
|
||||
get_current_url: detachable STRING_32
|
||||
-- Retrieve the URL of the current page.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.retrieve_url (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
get_page_source: detachable STRING_32
|
||||
-- Get the current page source.
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.page_source (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
get_page_tile: detachable STRING_32
|
||||
--Get the current page title
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.page_title (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
get_window_handle: detachable STRING_32
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.retrieve_window_handle (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
get_window_handles: detachable LIST [STRING_32]
|
||||
require
|
||||
exist_session: is_session_active
|
||||
do
|
||||
if attached session as l_session then
|
||||
Result := api.retrieve_window_handles (l_session.session_id)
|
||||
end
|
||||
end
|
||||
|
||||
feature {WEB_DRIVER, WEB_DRIVER_WAIT}
|
||||
|
||||
session_wait (duration: INTEGER_64)
|
||||
do
|
||||
if attached session as l_session then
|
||||
api.set_session_timeouts_async_script (l_session.session_id, duration.as_integer_32)
|
||||
end
|
||||
end
|
||||
|
||||
feature {SE_KEYBOARD} -- Implementation
|
||||
|
||||
session: detachable SE_SESSION
|
||||
|
||||
status: BOOLEAN
|
||||
api: SE_JSON_WIRE_PROTOCOL
|
||||
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
note
|
||||
description: "Object describing a log entry"
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_DRIVER_LOG
|
||||
feature
|
||||
|
||||
timestamp : NATURAL_32
|
||||
--The timestamp of the entry.
|
||||
|
||||
level : detachable STRING_32
|
||||
--The log level of the entry, for example, "INFO" (see log levels).
|
||||
--ALL All log messages. Used for fetching of logs and configuration of logging.
|
||||
--DEBUG Messages for debugging.
|
||||
--INFO Messages with user information.
|
||||
--WARNING Messages corresponding to non-critical problems.
|
||||
--SEVERE Messages corresponding to critical errors.
|
||||
--OFF No log messages. Used for configuration of logging.
|
||||
|
||||
message : detachable STRING_32
|
||||
--The log message.
|
||||
|
||||
end
|
||||
@@ -1,47 +0,0 @@
|
||||
note
|
||||
description: "A JSON object describing a Proxy configuration."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_DRIVER_PROXY
|
||||
create
|
||||
make
|
||||
|
||||
feature -- Initialization
|
||||
make (a_proxy_type : STRING_32)
|
||||
do
|
||||
set_proxy_type(a_proxy_type)
|
||||
end
|
||||
feature -- Access
|
||||
|
||||
proxy_type: STRING_32
|
||||
--(Required) The type of proxy being used.
|
||||
--Possible values are:
|
||||
-- direct - A direct connection -
|
||||
-- no proxy in use,
|
||||
-- manual - Manual proxy settings configured,
|
||||
-- e.g. setting a proxy for HTTP, a proxy for FTP, etc,
|
||||
-- pac - Proxy autoconfiguration from a URL),
|
||||
-- autodetect (proxy autodetection, probably with WPAD,
|
||||
-- system - Use system settings
|
||||
|
||||
proxy_auto_config_url : detachable STRING_32
|
||||
--(Required if proxyType == pac, Ignored otherwise)
|
||||
-- Specifies the URL to be used for proxy autoconfiguration. Expected format example: http://hostname.com:1234/pacfile
|
||||
|
||||
ftp_proxy : detachable STRING_32
|
||||
http_proxy: detachable STRING_32
|
||||
ssl_Proxy : detachable STRING_32
|
||||
--(Optional, Ignored if proxyType != manual) Specifies the proxies to be used for FTP, HTTP and HTTPS requests respectively.
|
||||
--Behaviour is undefined if a request is made, where the proxy for the particular protocol is undefined, if proxyType is manual.
|
||||
--Expected format example: hostname.com:1234
|
||||
|
||||
|
||||
feature -- Element Change
|
||||
set_proxy_type (a_proxy_type : STRING_32)
|
||||
do
|
||||
proxy_type := a_proxy_type
|
||||
end
|
||||
end
|
||||
@@ -1,61 +0,0 @@
|
||||
note
|
||||
description: "Summary description for {WEB_DRIVER_WAIT}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_DRIVER_WAIT
|
||||
inherit
|
||||
SHARED_EXECUTION_ENVIRONMENT
|
||||
create
|
||||
make
|
||||
feature {NONE} -- Initialization
|
||||
make ( driver : like web_driver; a_duration : INTEGER_64)
|
||||
do
|
||||
web_driver := driver
|
||||
duration := a_duration
|
||||
initialize
|
||||
ensure
|
||||
driver_set : driver = web_driver
|
||||
duration_set : duration = a_duration
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
-- create another feature to accept a predicate
|
||||
until_when (condition : PREDICATE[ANY, TUPLE])
|
||||
--Evaluate the condition until it's true or timing out .
|
||||
local
|
||||
found : BOOLEAN
|
||||
l_time1, l_time2 : TIME
|
||||
l_duration : TIME_DURATION
|
||||
do
|
||||
|
||||
create l_time1.make_now
|
||||
create l_duration.make_by_seconds (duration.as_integer_32)
|
||||
|
||||
from
|
||||
create l_time2.make_now
|
||||
if condition.item([]) then
|
||||
found := True
|
||||
end
|
||||
until
|
||||
found or
|
||||
l_time2.relative_duration (l_time1).fine_seconds_count > l_duration.fine_seconds_count
|
||||
loop
|
||||
if condition.item([]) then
|
||||
found := True
|
||||
end
|
||||
l_time2.make_now
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE}-- Implementation
|
||||
web_driver : WEB_DRIVER
|
||||
duration : INTEGER_64
|
||||
|
||||
initialize
|
||||
do
|
||||
web_driver.session_wait (duration)
|
||||
end
|
||||
end
|
||||
@@ -1,127 +0,0 @@
|
||||
note
|
||||
description: "An object in the WebDriver API that represents a DOM element on the page."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WEB_ELEMENT
|
||||
create
|
||||
make
|
||||
feature
|
||||
make ( an_element : STRING_32 ; an_api : like api; a_session_id : STRING_32)
|
||||
do
|
||||
set_element (an_element)
|
||||
api := an_api
|
||||
session_id := a_session_id
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
element : STRING_32
|
||||
--The opaque ID assigned to the element by the server.
|
||||
--This ID should be used in all subsequent commands issued against the element.
|
||||
|
||||
feature -- Change Element
|
||||
set_element (an_element : STRING_32)
|
||||
do
|
||||
element := an_element
|
||||
end
|
||||
|
||||
feature -- Web Element API
|
||||
clear
|
||||
-- Clear a TEXTAREA or text INPUT element's value.
|
||||
do
|
||||
api.clear_element (session_id, element)
|
||||
end
|
||||
|
||||
click
|
||||
-- Click on an element.
|
||||
do
|
||||
api.element_click (session_id, element)
|
||||
end
|
||||
|
||||
find_element (by : STRING_32) : detachable WEB_ELEMENT
|
||||
-- Find the first WebElement using the given method.
|
||||
do
|
||||
Result := api.search_element (session_id,by)
|
||||
end
|
||||
|
||||
find_elements (by : STRING_32) : detachable LIST[WEB_ELEMENT]
|
||||
-- Find all elements within the current context using the given mechanism.
|
||||
do
|
||||
Result := api.search_elements (session_id,by)
|
||||
end
|
||||
|
||||
get_attribute (name : STRING_32) : detachable STRING_32
|
||||
-- Get the value of an element's attribute.
|
||||
do
|
||||
Result := api.element_value (session_id, element, name)
|
||||
end
|
||||
|
||||
get_css_value (name : STRING_32) : detachable STRING_32
|
||||
-- Get the value of an element's attribute.
|
||||
do
|
||||
Result := api.element_css_value (session_id, element, name)
|
||||
end
|
||||
|
||||
get_location : SE_POINT
|
||||
-- Determine an element's location on the page. The point (0, 0) refers to the upper-left corner of the page.
|
||||
do
|
||||
Result := api.element_location (session_id, element)
|
||||
end
|
||||
|
||||
|
||||
get_size : SE_DIMENSION
|
||||
-- Determine an element's size in pixels. The size will be returned as a JSON object with width and height properties.
|
||||
do
|
||||
Result := api.element_size (session_id, element)
|
||||
end
|
||||
|
||||
get_tag_name : detachable STRING_32
|
||||
-- The element's tag name, as a lowercase string.
|
||||
do
|
||||
Result := api.query_by_tag_name (session_id, element)
|
||||
end
|
||||
|
||||
|
||||
get_text : detachable STRING_32
|
||||
-- Returns the visible text for the element.
|
||||
do
|
||||
Result := api.element_text (session_id, element)
|
||||
end
|
||||
|
||||
is_displayed : BOOLEAN
|
||||
-- Determine if an element is currently displayed.
|
||||
do
|
||||
Result := api.is_displayed (session_id, element)
|
||||
end
|
||||
|
||||
is_enabled : BOOLEAN
|
||||
-- Determine if an element is currently enabled.
|
||||
do
|
||||
Result := api.is_enabled (session_id, element)
|
||||
end
|
||||
|
||||
is_selected : BOOLEAN
|
||||
-- Determine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected.
|
||||
do
|
||||
Result := api.is_selected (session_id, element)
|
||||
end
|
||||
|
||||
send_keys (keys : ARRAY[STRING_32])
|
||||
-- Send a sequence of key strokes to an element.
|
||||
do
|
||||
api.send_event (session_id, element, keys)
|
||||
end
|
||||
|
||||
submit
|
||||
-- Submit a FORM element. The submit command may also be applied to any element that is a descendant of a FORM element.
|
||||
do
|
||||
api.element_submit (session_id, element)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
api : SE_JSON_WIRE_PROTOCOL
|
||||
session_id : STRING_32
|
||||
end
|
||||
@@ -1,214 +0,0 @@
|
||||
note
|
||||
description: "test application root class"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
APPLICATION
|
||||
|
||||
inherit
|
||||
|
||||
ARGUMENTS
|
||||
|
||||
|
||||
-- TODO start and stop selenium server from Eiffel.
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
-- test_back_forward_refesh
|
||||
-- test_status_sessions_timeout
|
||||
test_ime_actions
|
||||
end
|
||||
|
||||
|
||||
test_ime_actions
|
||||
local
|
||||
web_driver: SE_JSON_WIRE_PROTOCOL
|
||||
capabilities: SE_CAPABILITIES
|
||||
timeout: SE_TIMEOUT_TYPE
|
||||
|
||||
do
|
||||
-- check if the selenium Remote WebDriver is up and running.
|
||||
create web_driver.make
|
||||
if attached web_driver.status as l_status then
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached web_driver.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
print ("%NSessionId:" + l_session.session_id)
|
||||
-- available engines
|
||||
if attached web_driver.ime_available_engines (l_session.session_id) as l_available then
|
||||
check
|
||||
has_no_error : not web_driver.has_error
|
||||
end
|
||||
else
|
||||
check has_error : web_driver.has_error end
|
||||
-- ime_active_engine
|
||||
check
|
||||
no_active_engine : web_driver.ime_active_engine (l_session.session_id) = Void
|
||||
has_error : web_driver.has_error
|
||||
end
|
||||
-- ime_activated
|
||||
check
|
||||
no_active: not web_driver.ime_activated (l_session.session_id)
|
||||
has_error : web_driver.has_error
|
||||
end
|
||||
-- ime_deactivate
|
||||
web_driver.ime_deactivate (l_session.session_id)
|
||||
check
|
||||
has_error : web_driver.has_error
|
||||
end
|
||||
|
||||
-- ime_activate
|
||||
web_driver.ime_activate (l_session.session_id,"UNKown")
|
||||
check
|
||||
has_error : web_driver.has_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("firefox")
|
||||
if attached web_driver.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
print ("%NSessionId:" + l_session.session_id)
|
||||
check
|
||||
no_error_firefox: not web_driver.has_error
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
test_status_sessions_timeout
|
||||
local
|
||||
web_driver: SE_JSON_WIRE_PROTOCOL
|
||||
capabilities: SE_CAPABILITIES
|
||||
timeout: SE_TIMEOUT_TYPE
|
||||
do
|
||||
-- check if the selenium Remote WebDriver is up and running.
|
||||
create web_driver.make
|
||||
if attached web_driver.status as l_status then
|
||||
print (l_status)
|
||||
-- create a new session
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached web_driver.create_session_with_desired_capabilities (capabilities) as l_session2 then
|
||||
print ("%NSessionId:" + l_session2.session_id)
|
||||
end
|
||||
|
||||
-- retrieve sessions
|
||||
if attached web_driver.sessions as l_session then
|
||||
across
|
||||
l_session as l_item
|
||||
loop
|
||||
print (l_item)
|
||||
end
|
||||
end
|
||||
if attached web_driver.create_session_with_desired_capabilities (capabilities) as l_session2 then
|
||||
print ("%NSessionId:" + l_session2.session_id)
|
||||
create timeout.make ("script", 1)
|
||||
web_driver.set_session_timeouts (l_session2.session_id, timeout)
|
||||
end
|
||||
|
||||
else
|
||||
print ("The selenium server is not accesible")
|
||||
end
|
||||
end
|
||||
|
||||
test_back_forward_refesh
|
||||
local
|
||||
web_driver: SE_JSON_WIRE_PROTOCOL
|
||||
capabilities: SE_CAPABILITIES
|
||||
file : RAW_FILE
|
||||
do
|
||||
create web_driver.make
|
||||
-- create a new session
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached web_driver.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
print ("%NSessionId:" + l_session.session_id)
|
||||
web_driver.navigate_to_url (l_session.session_id, "http://www.google.com/")
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
web_driver.navigate_to_url (l_session.session_id, "http://www.infoq.com/")
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
web_driver.navigate_to_url (l_session.session_id, "http://www.yahoo.com/")
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
|
||||
--back
|
||||
web_driver.back (l_session.session_id)
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
if attached web_driver.retrieve_url (l_session.session_id) as l_back_url then
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
check
|
||||
expected_infoq: "http://www.infoq.com/" ~ l_back_url.out
|
||||
end
|
||||
end
|
||||
|
||||
-- forward
|
||||
web_driver.forward (l_session.session_id)
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
if attached web_driver.retrieve_url (l_session.session_id) as l_forward_url then
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
check
|
||||
expected_yahoo: "http://www.yahoo.com/" ~ l_forward_url.out
|
||||
end
|
||||
end
|
||||
|
||||
-- refresh
|
||||
web_driver.refresh (l_session.session_id)
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
if attached web_driver.screenshot (l_session.session_id) as l_screenshot then
|
||||
check
|
||||
Has_no_error: not web_driver.has_error
|
||||
end
|
||||
create file.make_with_name ("screenshot_"+l_session.session_id+".png")
|
||||
file.open_write
|
||||
file.putstring (l_screenshot)
|
||||
file.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test_session
|
||||
local
|
||||
h: LIBCURL_HTTP_CLIENT
|
||||
session: HTTP_CLIENT_SESSION
|
||||
resp: detachable HTTP_CLIENT_RESPONSE
|
||||
context: HTTP_CLIENT_REQUEST_CONTEXT
|
||||
s: READABLE_STRING_8
|
||||
do
|
||||
create h.make
|
||||
s := "[
|
||||
{
|
||||
"desiredCapabilities" : {
|
||||
"browserName":"firefox"
|
||||
}
|
||||
}
|
||||
]"
|
||||
session := h.new_session ("http://localhost:4444/wd/hub/")
|
||||
create context.make
|
||||
context.headers.put ("application/json;charset=UTF-8", "Content-Type")
|
||||
context.headers.put ("application/json;charset=UTF-8", "Accept")
|
||||
resp := session.post ("session", context, s)
|
||||
print (resp)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
test: system execution failed.
|
||||
Following is the set of recorded exceptions:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Class / Object Routine Nature of exception Effect
|
||||
-------------------------------------------------------------------------------
|
||||
JSON_PARSER make_parser @1 json_not_empty:
|
||||
<00000000029AAD48> Precondition violated. Fail
|
||||
-------------------------------------------------------------------------------
|
||||
SE_JSON_WIRE_PROTOCOL
|
||||
string_to_json @2
|
||||
<00000000029705E8> (From JSON_HELPER) Routine failure. Fail
|
||||
-------------------------------------------------------------------------------
|
||||
SE_JSON_WIRE_PROTOCOL
|
||||
build_session @1
|
||||
<00000000029705E8> Routine failure. Fail
|
||||
-------------------------------------------------------------------------------
|
||||
SE_JSON_WIRE_PROTOCOL
|
||||
create_session_with_desired_capabilities @5
|
||||
<00000000029705E8> Routine failure. Fail
|
||||
-------------------------------------------------------------------------------
|
||||
APPLICATION make @6
|
||||
<00000000029705A8> Routine failure. Fail
|
||||
-------------------------------------------------------------------------------
|
||||
APPLICATION root's creation
|
||||
<00000000029705A8> Routine failure. Exit
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="test" uuid="A72A4B9B-EB95-4CD8-BEE4-47A7F0FEA6F9">
|
||||
<target name="test">
|
||||
<root class="APPLICATION" feature="make"/>
|
||||
<option warning="true" is_attached_by_default="false" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="http_client" location="$EIFFEL_LIBRARY\EWF\library\network\http_client\http_client-safe.ecf"/>
|
||||
<library name="selenium" location="..\selenium-safe.ecf"/>
|
||||
<library name="testing" location="$ISE_LIBRARY\library\testing\testing.ecf"/>
|
||||
<cluster name="test" location=".\" recursive="true">
|
||||
<file_rule>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
</cluster>
|
||||
</target>
|
||||
</system>
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1 "This Program was made using EiffelStudio using Visual Studio C++"
|
||||
END
|
||||
@@ -1,302 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Eiffel tests that can be executed by testing tool.
|
||||
]"
|
||||
author: "EiffelStudio test wizard"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
testing: "type/manual"
|
||||
|
||||
class
|
||||
TEST_JSON_WIRE_PROTOCOL
|
||||
|
||||
inherit
|
||||
|
||||
EQA_TEST_SET
|
||||
redefine
|
||||
on_prepare,
|
||||
on_clean
|
||||
end
|
||||
|
||||
feature {NONE} -- Events
|
||||
|
||||
on_prepare
|
||||
local
|
||||
capabilities: SE_CAPABILITIES
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
session_id := l_session.session_id
|
||||
end
|
||||
end
|
||||
|
||||
on_clean
|
||||
-- <Precursor>
|
||||
do
|
||||
if attached session_id as l_session_id then
|
||||
wire_protocol.delete_session (session_id)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Test routines
|
||||
|
||||
test_status
|
||||
--
|
||||
do
|
||||
if attached {SE_STATUS} wire_protocol.status as l_status then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
assert ("Expected status 0", l_status.status = 0)
|
||||
assert ("Expected sessionId", l_status.session_id = Void)
|
||||
end
|
||||
end
|
||||
|
||||
test_seleniun_server_host_not_available
|
||||
--
|
||||
local
|
||||
l_wire_protocol: SE_JSON_WIRE_PROTOCOL
|
||||
do
|
||||
create l_wire_protocol.make_with_host ("http://127.0.0.1:4443/wd/hub/status")
|
||||
assert ("expected void", l_wire_protocol.status = Void)
|
||||
end
|
||||
|
||||
test_create_valid_new_session
|
||||
local
|
||||
capabilities: SE_CAPABILITIES
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
end
|
||||
end
|
||||
|
||||
test_create_invalid_new_session
|
||||
local
|
||||
capabilities: SE_CAPABILITIES
|
||||
session: detachable SE_SESSION
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("invalid")
|
||||
session := wire_protocol.create_session_with_desired_capabilities (capabilities)
|
||||
assert ("Expected error", wire_protocol.has_error)
|
||||
assert ("Expected void", session = Void)
|
||||
end
|
||||
|
||||
test_retrieve_sessions
|
||||
local
|
||||
sessions: detachable LIST [SE_SESSION]
|
||||
do
|
||||
sessions := wire_protocol.sessions
|
||||
assert ("Not void", sessions /= Void)
|
||||
assert ("One or more items:", sessions.count >= 1)
|
||||
end
|
||||
|
||||
|
||||
test_delete_session
|
||||
local
|
||||
capabilities: SE_CAPABILITIES
|
||||
session : detachable SE_SESSION
|
||||
pre_session, post_session : INTEGER
|
||||
do
|
||||
-- if attached wire_protocol.sessions as l_sessions then
|
||||
-- pre_session := l_sessions.count
|
||||
-- end
|
||||
|
||||
-- if attached session_id as l_session_id then
|
||||
-- wire_protocol.delete_session (session_id)
|
||||
-- end
|
||||
|
||||
-- if attached wire_protocol.sessions as l_sessions then
|
||||
-- post_session := l_sessions.count
|
||||
-- end
|
||||
|
||||
-- assert ("After delete Pre sesssion - 1 is equal to post_session", (pre_session - 1) = post_session)
|
||||
end
|
||||
|
||||
test_valid_session_timeouts
|
||||
local
|
||||
l_timeout :SE_TIMEOUT_TYPE
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
create l_timeout.make ("script", 1)
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
wire_protocol.set_session_timeouts (l_session.session_id, l_timeout)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
end
|
||||
end
|
||||
|
||||
test_invalid_session_timeouts
|
||||
local
|
||||
l_timeout :SE_TIMEOUT_TYPE
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
create l_timeout.make ("tes", 1)
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
wire_protocol.set_session_timeouts (l_session.session_id, l_timeout)
|
||||
assert ("Has error", wire_protocol.has_error)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
test_valid_session_async_script_timeouts
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
wire_protocol.set_session_timeouts_async_script (l_session.session_id, 1)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test_valid_session_implicit_wait_timeouts
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
wire_protocol.set_session_timeouts_implicit_wait (l_session.session_id, 1)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test_retrieve_window_handle
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
window_handle : detachable STRING_32
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
window_handle := wire_protocol.retrieve_window_handle (l_session.session_id)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
assert ("Windows handle not void", attached window_handle = True)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test_retrieve_window_handles
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
window_handles : detachable LIST[STRING_32]
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
window_handles := wire_protocol.retrieve_window_handles (l_session.session_id)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
assert ("Windows handleS not void", attached window_handles = True)
|
||||
end
|
||||
end
|
||||
|
||||
test_retrieve_url
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
url : detachable STRING_32
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
url := wire_protocol.retrieve_url (session_id)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
assert ("url not void", attached url = True)
|
||||
end
|
||||
end
|
||||
|
||||
test_navigate_to_url
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
wire_protocol.navigate_to_url (session_id,"http://www.google.com/")
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
if attached wire_protocol.retrieve_url (session_id) as l_url then
|
||||
assert("Expected url", "http://www.google.com/" ~ l_url.out)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test_back_and_forward
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
create capabilities.make
|
||||
capabilities.set_browser_name ("chrome")
|
||||
capabilities.set_takes_screenshot (True)
|
||||
if attached wire_protocol.create_session_with_desired_capabilities (capabilities) as l_session then
|
||||
assert ("No error", not wire_protocol.has_error)
|
||||
wire_protocol.navigate_to_url (l_session.session_id,"http://www.google.com/")
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
wire_protocol.navigate_to_url (l_session.session_id,"http://www.infoq.com/")
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
wire_protocol.navigate_to_url (l_session.session_id,"http://www.yahoo.com/")
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
|
||||
--back
|
||||
wire_protocol.back (l_session.session_id)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
|
||||
if attached wire_protocol.retrieve_url (l_session.session_id) as l_back_url then
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
assert ("Expected infoq", "http://www.infoq.com/" ~ l_back_url.out)
|
||||
end
|
||||
|
||||
-- forward
|
||||
wire_protocol.forward (l_session.session_id)
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
|
||||
if attached wire_protocol.retrieve_url (l_session.session_id) as l_forward_url then
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
assert ("Expected yahoo", "http://www.yahoo.com/" ~ l_forward_url.out)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
test_ime_available_engines
|
||||
local
|
||||
capabilities : SE_CAPABILITIES
|
||||
do
|
||||
if attached wire_protocol.ime_available_engines (session_id) as l_ime_available_engines then
|
||||
assert ("Has no error", not wire_protocol.has_error)
|
||||
across l_ime_available_engines as item loop
|
||||
print (item)
|
||||
end
|
||||
else
|
||||
assert ("Has error :", wire_protocol.has_error)
|
||||
if attached wire_protocol.last_error as l_error then
|
||||
assert ("Status 13", l_error.code = 13)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
feature {NONE}-- Implementation
|
||||
wire_protocol: SE_JSON_WIRE_PROTOCOL
|
||||
once
|
||||
create Result.make
|
||||
end
|
||||
|
||||
session_id: detachable STRING_32
|
||||
|
||||
end
|
||||
@@ -1,69 +0,0 @@
|
||||
note
|
||||
description: "[
|
||||
Eiffel tests that can be executed by testing tool.
|
||||
]"
|
||||
author: "EiffelStudio test wizard"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
testing: "type/manual"
|
||||
|
||||
class
|
||||
TEST_SE_BY
|
||||
|
||||
inherit
|
||||
EQA_TEST_SET
|
||||
redefine
|
||||
on_prepare,
|
||||
on_clean
|
||||
end
|
||||
|
||||
feature {NONE} -- Events
|
||||
|
||||
on_prepare
|
||||
-- <Precursor>
|
||||
do
|
||||
-- assert ("not_implemented", False)
|
||||
end
|
||||
|
||||
on_clean
|
||||
-- <Precursor>
|
||||
do
|
||||
-- assert ("not_implemented", False)
|
||||
end
|
||||
|
||||
feature -- Test routines
|
||||
|
||||
test_valid_strategy_id
|
||||
local
|
||||
l_data : STRING_32
|
||||
do
|
||||
l_data := "[
|
||||
{"using":"id", "value":"test"}
|
||||
]"
|
||||
assert ("Expected true", (create {SE_BY}).is_valid_strategy (l_data))
|
||||
end
|
||||
|
||||
test_valid_strategy_name
|
||||
local
|
||||
l_data : STRING_32
|
||||
do
|
||||
l_data := "[
|
||||
{"using":"name", "value":"test"}
|
||||
]"
|
||||
assert ("Expected true", (create {SE_BY}).is_valid_strategy (l_data))
|
||||
end
|
||||
|
||||
test_wrong_strategy
|
||||
local
|
||||
l_data : STRING_32
|
||||
do
|
||||
l_data := "[
|
||||
{"using":"wrong", "value":"test"}
|
||||
]"
|
||||
assert ("Expected False", not (create {SE_BY}).is_valid_strategy (l_data))
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user