Class: Websautotest::Pagepattern::Sitebuilderfinch
- Inherits:
-
Object
- Object
- Websautotest::Pagepattern::Sitebuilderfinch
show all
- Includes:
- CommonPageOperation
- Defined in:
- lib/pagepattern/sitebuilderfinch_page.rb
Instance Method Summary
collapse
#current_url, #initialize, #visit_redirect
Instance Method Details
#assertdroppedelement(modulename, iframe) ⇒ Object
18
19
20
21
22
|
# File 'lib/pagepattern/sitebuilderfinch_page.rb', line 18
def assertdroppedelement(modulename,iframe)
@session.within_frame(iframe) do
@session.should have_xpath("//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']")
end
end
|
#assertnewText(modulename, context, iframe) ⇒ Object
31
32
33
34
35
|
# File 'lib/pagepattern/sitebuilderfinch_page.rb', line 31
def assertnewText(modulename,context,iframe)
@session.within_frame(iframe) do
@session.find(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']").text.should include(context)
end
end
|
#dragelement_into_iframe(modulename, iframe) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/pagepattern/sitebuilderfinch_page.rb', line 5
def dragelement_into_iframe(modulename,iframe)
srclocation=nil
@session.within_frame(iframe) do
srclocation=@session.driver.browser.find_element(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']").location
end
targetlocation=@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']").location
offsetwidth=@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']").style("width").to_i
offsetheight=@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']").style("height").to_i
right=srclocation.x- targetlocation.x+offsetwidth
down= srclocation.y - targetlocation.y+offsetheight
@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']/descendant::*/span").drag_and_drop_by(right,down)
end
|
#editText(modulename, context, iframe) ⇒ Object
24
25
26
27
28
29
|
# File 'lib/pagepattern/sitebuilderfinch_page.rb', line 24
def editText(modulename,context,iframe)
@session.within_frame(iframe) do
@session.driver.browser.find_element(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']").click
@session.driver.browser.find_element(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']").send_keys context
end
end
|