websautotest 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +1 -0
- data/README +9 -0
- data/lib/module/commonmethod.rb +7 -0
- data/lib/pagepattern/co-reg_page.rb +26 -0
- data/lib/pagepattern/portal_page.rb +59 -0
- data/lib/pagepattern/signup_page.rb +82 -0
- data/lib/pagepattern/sitebuilder_page.rb +13 -0
- data/lib/websautotest.rb +12 -0
- metadata +72 -0
data/Changelog
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0 inital move all the pagepattern to one module and start using autoload in the websautotest.rb
|
data/README
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#require 'module/commonmethod'
|
2
|
+
#require 'sitebuilder_page'
|
3
|
+
|
4
|
+
module Websautotest
|
5
|
+
module Pagepattern
|
6
|
+
class Coreg
|
7
|
+
include Websautotest::CommonPageOperation
|
8
|
+
def assertpackageindex(*package)
|
9
|
+
package.each do |package|
|
10
|
+
@session.should have_xpath("//a[contains(@href, 'members.webs.com/premium/checkout') and contains(@href, '#{package}')]")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def clicknothanks_goto_sitebuilder(nothankstring)
|
15
|
+
if @session.has_xpath?("//div[@id='left_content']/descendant::*/img[contains(@title,'#{nothankstring}')]")
|
16
|
+
@session.find("//div[@id='left_content']/descendant::*/img[contains(@title,'#{nothankstring}')]").click
|
17
|
+
elsif @session.has_xpath?("//div[@id='left_content']/descendant::*/span[contains(text(),'#{nothankstring}')]")
|
18
|
+
@session.find("//div[@id='left_content']/descendant::*/span[contains(text(),'#{nothankstring}')]").click
|
19
|
+
end
|
20
|
+
@Sitebuilder=Sitebuilder.new(@session)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#require 'module/commonmethod'
|
2
|
+
|
3
|
+
#require 'signup_page'
|
4
|
+
|
5
|
+
module Websautotest
|
6
|
+
module Pagepattern
|
7
|
+
class Portal
|
8
|
+
include Websautotest::CommonPageOperation
|
9
|
+
# class << self;
|
10
|
+
# attr_accessor :useremail
|
11
|
+
# attr_accessor :userpass
|
12
|
+
# end
|
13
|
+
def noinfosignup(repeattimes)
|
14
|
+
lookfor_signuppage(repeattimes,"//div[contains(@id,'get_started_block') and contains(@style,'display: block')]")
|
15
|
+
end
|
16
|
+
|
17
|
+
def clickstarted_goto_signup
|
18
|
+
@session.find("//div[contains(@style,'display: block')]/descendant::input[contains(@id,'signup_button')]").click
|
19
|
+
@Signup=Signup.new(@session)
|
20
|
+
end
|
21
|
+
|
22
|
+
def emailsignup(repeattimes)
|
23
|
+
lookfor_signuppage(repeattimes,"//div[contains(@class,'gwo_streamlined_signup with_type hidden') and contains(@style,'display: block')]")
|
24
|
+
end
|
25
|
+
|
26
|
+
def fill_email(email)
|
27
|
+
@session.within("//div[contains(@class,'gwo_streamlined_signup with_type hidden') and contains(@style,'display: block')]") do
|
28
|
+
@session.fill_in "email_address", :with =>email
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def fill_password(password)
|
33
|
+
@session.within("//div[contains(@class,'gwo_streamlined_signup with_type hidden') and contains(@style,'display: block')]") do
|
34
|
+
@session.fill_in "register_password", :with => password
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def select_webstype(type)
|
39
|
+
@session.find("//div[contains(@style,'display: block')]/descendant::div[@class='select_selected']").click
|
40
|
+
@session.find("//div[contains(@style,'display: block')]/descendant::li[contains(text(),'#{type}')]").click
|
41
|
+
end
|
42
|
+
|
43
|
+
def lookfor_signuppage(repeattime,xpath)
|
44
|
+
$i=0
|
45
|
+
while $i<repeattime.to_i do
|
46
|
+
if @session.has_xpath?(xpath) then
|
47
|
+
break
|
48
|
+
end
|
49
|
+
@session.reset!
|
50
|
+
@session.visit "/"
|
51
|
+
$i+=1;
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#require 'module/commonmethod.rb'
|
2
|
+
#require 'co-reg_page.rb'
|
3
|
+
#require 'portal_page.rb'
|
4
|
+
|
5
|
+
module Websautotest
|
6
|
+
module Pagepattern
|
7
|
+
class Signup < Portal
|
8
|
+
include Websautotest::CommonPageOperation
|
9
|
+
def assertnewpage(times,step1text)
|
10
|
+
$i=0
|
11
|
+
while $i<times.to_i do
|
12
|
+
if @session.find("//div[contains(@id,'step1')]/descendant::*/span[@class='signup_bulletitle']").text == (step1text) then
|
13
|
+
break
|
14
|
+
end
|
15
|
+
noinfosignup(10)
|
16
|
+
clickstarted_goto_signup
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def assertnewsignup_fromemailsignup(times,step1text,email,username,type)
|
21
|
+
$i=0
|
22
|
+
while $i<times.to_i do
|
23
|
+
if @session.find("//div[contains(@id,'step1')]/descendant::*/span[@class='signup_bulletitle']").text == (step1text) then
|
24
|
+
break
|
25
|
+
end
|
26
|
+
emailsignup(10)
|
27
|
+
#puts email
|
28
|
+
#puts username
|
29
|
+
fill_email(email)
|
30
|
+
fill_password(username)
|
31
|
+
select_webstype(type)
|
32
|
+
clickstarted_goto_signup
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def assertthreestep(step1text,step2text,step3text)
|
37
|
+
@session.find("//div[contains(@id,'step1')]/descendant::*/span[@class='signup_bulletitle']").text.should eql(step1text)
|
38
|
+
@session.find("//div[@id='standardAccountFieldsWrapper3']/descendant::*/span[@class='signup_bulletitle']").text.should eql(step2text)
|
39
|
+
@session.find("//div[@id='choose-pages']/descendant::*/span[@class='signup_bulletitle']").text.should eql(step3text)
|
40
|
+
end
|
41
|
+
|
42
|
+
def fill_signupemail(email)
|
43
|
+
@session.fill_in "emailAddress", :with =>email
|
44
|
+
end
|
45
|
+
|
46
|
+
def fill_signuppassword(password)
|
47
|
+
@session.fill_in "password", :with => password
|
48
|
+
end
|
49
|
+
|
50
|
+
def fill_SiteAddressAndTitle(sitename)
|
51
|
+
@session.fill_in "siteAddress", :with => sitename
|
52
|
+
@session.fill_in "siteTitle", :with => sitename
|
53
|
+
end
|
54
|
+
|
55
|
+
def assert_categorytype(type)
|
56
|
+
@session.find("//div[@id='site_categories_container']/label[@class='for_category selected']").text.should include(type)
|
57
|
+
end
|
58
|
+
|
59
|
+
def select_template()
|
60
|
+
@session.find("//li[1]/div/a").click
|
61
|
+
end
|
62
|
+
|
63
|
+
def select_pages()
|
64
|
+
@session.find("//div[contains(@id,'recommended_pages')]/child::*/li[2]").check("chosenTemplateIds")
|
65
|
+
@session.find("//div[contains(@id,'recommended_pages')]/child::*/li[4]").check("chosenTemplateIds")
|
66
|
+
@session.find("//div[contains(@id,'recommended_pages')]/child::*/li[4]").check("chosenTemplateIds")
|
67
|
+
@session.find("//div[contains(@id,'recommended_pages')]/child::*/li[4]").check("chosenTemplateIds")
|
68
|
+
@session.find("//div[contains(@id,'recommended_pages')]/child::*/li[5]").check("chosenTemplateIds")
|
69
|
+
end
|
70
|
+
|
71
|
+
def clickregister_goto_coreg()
|
72
|
+
@session.find("//input[@id='register']").click
|
73
|
+
@Coreg=Coreg.new(@session)
|
74
|
+
end
|
75
|
+
|
76
|
+
def loopfor_newsignup
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#require 'module/commonmethod'
|
2
|
+
|
3
|
+
module Websautotest
|
4
|
+
module Pagepattern
|
5
|
+
class Sitebuilder
|
6
|
+
include Websautotest::CommonPageOperation
|
7
|
+
def assertpagetitle(titlestring)
|
8
|
+
@session.find("//a[contains(text(),'Site Builder')]").text.should eql titlestring
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
data/lib/websautotest.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
2
|
+
|
3
|
+
|
4
|
+
module Websautotest
|
5
|
+
autoload :CommonPageOperation, 'module/commonmethod'
|
6
|
+
module Pagepattern
|
7
|
+
autoload :Portal, 'pagepattern/portal_page'
|
8
|
+
autoload :Signup, 'pagepattern/signup_page'
|
9
|
+
autoload :Coreg, 'pagepattern/co-reg_page'
|
10
|
+
autoload :Sitebuilder, 'pagepattern/sitebuilder_page'
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: websautotest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Ryo HANG
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-06-10 00:00:00 Z
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Wrap up webs page object into the gem file
|
22
|
+
email: ryo@webs.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
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/portal_page.rb
|
36
|
+
- lib/pagepattern/signup_page.rb
|
37
|
+
- lib/pagepattern/sitebuilder_page.rb
|
38
|
+
homepage: http://www.webs.com/
|
39
|
+
licenses: []
|
40
|
+
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
|
44
|
+
require_paths:
|
45
|
+
- lib
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
hash: 3
|
52
|
+
segments:
|
53
|
+
- 0
|
54
|
+
version: "0"
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
requirements: []
|
65
|
+
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 1.8.5
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: the gem contains all the page object and ui element ,functionality
|
71
|
+
test_files: []
|
72
|
+
|