websautotest 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,2 +1,3 @@
1
1
  0.1.0 inital move all the pagepattern to one module and start using autoload in the websautotest.rb
2
- 0.1.1 add dashboard_page and shopcart_page
2
+ 0.1.1 add dashboard_page and shopcart_page
3
+ 0.1.2 add sitebuilder finch into the gem class name is sitebuilderfinch_page.rb
data/README CHANGED
@@ -10,6 +10,7 @@ lib/pagepattern/portal_page.rb
10
10
  lib/pagepattern/shopcart_page.rb
11
11
  lib/pagepattern/signup_page.rb
12
12
  lib/pagepattern/sitebuilder_page.rb
13
+ lib/pagepattern/sitebuilderfinch_page.rb
13
14
  lib/websautotest.rb
14
15
 
15
16
  it has been published to the https://rubygems.org/ already
@@ -11,29 +11,29 @@ module Websautotest
11
11
  end
12
12
 
13
13
  def clickstarted_goto_signup
14
- @session.find("//div[contains(@style,'display: block')]/descendant::input[contains(@id,'signup_button')]").click
14
+ @session.find("//div[contains(@class,'gwo_streamlined_signup with_type')]/descendant::input[contains(@id,'signup_button')]").click
15
15
  @Signup=Signup.new(@session)
16
16
  end
17
17
 
18
18
  def emailsignup(repeattimes)
19
- lookfor_signuppage(repeattimes,"//div[contains(@class,'gwo_streamlined_signup with_type hidden') and contains(@style,'display: block')]")
19
+ lookfor_signuppage(repeattimes,"//div[contains(@class,'gwo_streamlined_signup with_type')]")
20
20
  end
21
21
 
22
22
  def fill_email(email)
23
- @session.within("//div[contains(@class,'gwo_streamlined_signup with_type hidden') and contains(@style,'display: block')]") do
23
+ @session.within("//div[contains(@class,'gwo_streamlined_signup with_type')]") do
24
24
  @session.fill_in "email_address", :with =>email
25
25
  end
26
26
  end
27
27
 
28
28
  def fill_password(password)
29
- @session.within("//div[contains(@class,'gwo_streamlined_signup with_type hidden') and contains(@style,'display: block')]") do
29
+ @session.within("//div[contains(@class,'gwo_streamlined_signup with_type')]") do
30
30
  @session.fill_in "register_password", :with => password
31
31
  end
32
32
  end
33
33
 
34
34
  def select_webstype(type)
35
- @session.find("//div[contains(@style,'display: block')]/descendant::div[@class='select_selected']").click
36
- @session.find("//div[contains(@style,'display: block')]/descendant::li[contains(text(),'#{type}')]").click
35
+ @session.find("//div[contains(@class,'gwo_streamlined_signup with_type')]/descendant::div[@class='select_selected']").click
36
+ @session.find("//div[contains(@class,'gwo_streamlined_signup with_type')]/descendant::li[contains(text(),'#{type}')]").click
37
37
  end
38
38
 
39
39
  def lookfor_signuppage(repeattime,xpath)
@@ -0,0 +1,41 @@
1
+ module Websautotest
2
+ module Pagepattern
3
+ class Sitebuilderfinch
4
+ include Websautotest::CommonPageOperation
5
+ def dragelement_into_iframe(modulename,iframe)
6
+ srclocation=nil
7
+ @session.within_frame(iframe) do
8
+ srclocation=@session.driver.browser.find_element(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']").location
9
+ end
10
+ targetlocation=@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']").location
11
+ offsetwidth=@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']").style("width").to_i
12
+ offsetheight=@session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']").style("height").to_i
13
+ right=srclocation.x- targetlocation.x+offsetwidth
14
+ down= srclocation.y - targetlocation.y+offsetheight
15
+ @session.driver.browser.find_element(:xpath,"//div[@data-moduletype='#{modulename}']/descendant::*/span").drag_and_drop_by(right,down)
16
+ end
17
+
18
+ def assertdroppedelement(modulename,iframe)
19
+ @session.within_frame(iframe) do
20
+ @session.should have_xpath("//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']")
21
+ end
22
+ end
23
+
24
+ def editText(modulename,context,iframe)
25
+ @session.within_frame(iframe) do
26
+ @session.driver.browser.find_element(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']").click
27
+ @session.driver.browser.find_element(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']").send_keys context
28
+ end
29
+ end
30
+
31
+ def assertnewText(modulename,context,iframe)
32
+ @session.within_frame(iframe) do
33
+ @session.find(:xpath,"//div[@id='secondary']/descendant::*/div[@class='bldr-container']/h3[@class='webs-#{modulename}']").text.should include(context)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+
41
+
data/lib/websautotest.rb CHANGED
@@ -10,5 +10,6 @@ module Websautotest
10
10
  autoload :Sitebuilder, 'pagepattern/sitebuilder_page'
11
11
  autoload :Dashboard, 'pagepattern/dashboard_page'
12
12
  autoload :Shopcart, 'pagepattern/shopcart_page'
13
+ autoload :Sitebuilderfinch, 'pagepattern/sitebuilderfinch_page'
13
14
  end
14
15
  end
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websautotest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
6
+ - 0
7
+ - 1
8
+ - 2
9
+ version: 0.1.2
11
10
  platform: ruby
12
11
  authors:
13
- - Ryo HANG
12
+ - Ryo HANG
14
13
  autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-06-10 00:00:00 Z
17
+ date: 2011-07-06 00:00:00 -04:00
18
+ default_executable:
19
19
  dependencies: []
20
20
 
21
21
  description: Wrap up webs page object into the gem file
@@ -27,16 +27,18 @@ extensions: []
27
27
  extra_rdoc_files: []
28
28
 
29
29
  files:
30
- - README
31
- - Changelog
32
- - lib/websautotest.rb
33
- - lib/module/commonmethod.rb
34
- - lib/pagepattern/co-reg_page.rb
35
- - lib/pagepattern/dashboard_page.rb
36
- - lib/pagepattern/portal_page.rb
37
- - lib/pagepattern/shopcart_page.rb
38
- - lib/pagepattern/signup_page.rb
39
- - lib/pagepattern/sitebuilder_page.rb
30
+ - README
31
+ - Changelog
32
+ - lib/websautotest.rb
33
+ - lib/module/commonmethod.rb
34
+ - lib/pagepattern/co-reg_page.rb
35
+ - lib/pagepattern/dashboard_page.rb
36
+ - lib/pagepattern/portal_page.rb
37
+ - lib/pagepattern/shopcart_page.rb
38
+ - lib/pagepattern/signup_page.rb
39
+ - lib/pagepattern/sitebuilder_page.rb
40
+ - lib/pagepattern/sitebuilderfinch_page.rb
41
+ has_rdoc: true
40
42
  homepage: http://www.webs.com/
41
43
  licenses: []
42
44
 
@@ -44,29 +46,25 @@ post_install_message:
44
46
  rdoc_options: []
45
47
 
46
48
  require_paths:
47
- - lib
49
+ - lib
48
50
  required_ruby_version: !ruby/object:Gem::Requirement
49
- none: false
50
51
  requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- hash: 3
54
- segments:
55
- - 0
56
- version: "0"
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ version: "0"
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
- none: false
59
58
  requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
- version: "0"
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ segments:
62
+ - 0
63
+ version: "0"
66
64
  requirements: []
67
65
 
68
66
  rubyforge_project:
69
- rubygems_version: 1.8.5
67
+ rubygems_version: 1.3.6
70
68
  signing_key:
71
69
  specification_version: 3
72
70
  summary: the gem contains all the page object and ui element ,functionality