awetestlib 0.1.28 → 0.1.29pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitattributes +22 -22
- data/.gitignore +69 -69
- data/.yardopts +7 -7
- data/README.md +108 -108
- data/awetestlib.gemspec +57 -57
- data/awetestlib.windows.gemspec +41 -41
- data/awetestlib_notes.txt +4 -4
- data/awetestlib_osx.gemspec +47 -48
- data/bin/awetestlib +99 -99
- data/bin/awetestlib-android-setup.rb +26 -26
- data/bin/awetestlib-cucumber-setup.rb +28 -28
- data/bin/awetestlib-driver-setup.rb +21 -21
- data/bin/awetestlib-helpers.rb +41 -41
- data/bin/awetestlib-mobile-app-setup.rb +31 -31
- data/bin/awetestlib-netbeans-setup.rb +58 -58
- data/bin/awetestlib-regression-setup.rb +15 -15
- data/bin/awetestlib-rubymine-setup.rb +39 -39
- data/drivers/chromedriver.exe +0 -0
- data/ext/Rakefile +1 -1
- data/ext/mkrf_conf.rb +27 -27
- data/lib/awetestlib/html_report.rb +142 -142
- data/lib/awetestlib/logging.rb +366 -366
- data/lib/awetestlib/regression/browser.rb +1380 -1375
- data/lib/awetestlib/regression/drag_and_drop.rb +421 -420
- data/lib/awetestlib/regression/find.rb +345 -345
- data/lib/awetestlib/regression/legacy.rb +1187 -1187
- data/lib/awetestlib/regression/page_data.rb +191 -191
- data/lib/awetestlib/regression/runner.rb +307 -307
- data/lib/awetestlib/regression/tables.rb +627 -619
- data/lib/awetestlib/regression/user_input.rb +576 -576
- data/lib/awetestlib/regression/utilities.rb +1046 -988
- data/lib/awetestlib/regression/validations.rb +1093 -1074
- data/lib/awetestlib/regression/waits.rb +470 -470
- data/lib/awetestlib/runner.rb +18 -18
- data/lib/awetestlib.rb +41 -41
- data/lib/patches/README +2 -2
- data/lib/patches/firewatir.rb +106 -106
- data/lib/patches/watir.rb +175 -175
- data/lib/version.rb +2 -2
- data/license.txt +13 -13
- data/netbeans_setup.md +29 -29
- data/rdoc_test.bat +1 -1
- data/rubymine_setup.md +23 -23
- data/setup_samples/sample_android/features/dk.mejer.hansen.control.FlyingColorsPlayerAidActivity.apk +0 -0
- data/setup_samples/sample_android/features/sample_android.feature +5 -5
- data/setup_samples/sample_android/features/step_definitions/calabash_steps.rb +1 -1
- data/setup_samples/sample_android/features/support/app_installation_hooks.rb +36 -36
- data/setup_samples/sample_android/features/support/app_life_cycle_hooks.rb +14 -14
- data/setup_samples/sample_android/features/test_servers/8ba795a0288381ae346b67867b586881_0.3.2.apk +0 -0
- data/setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb +76 -76
- data/setup_samples/sample_cucumber/features/yahoo_mail.feature +11 -11
- data/setup_samples/sample_mobile_app/features/my_first.feature +14 -14
- data/setup_samples/sample_mobile_app/features/step_definitions/predefined_webview_steps.rb +80 -80
- data/setup_samples/sample_mobile_app/features/support/env.rb +2 -2
- data/setup_samples/sample_netbeans/demo.rb +86 -86
- data/setup_samples/sample_netbeans/nbproject/configs/Demo.properties +2 -2
- data/setup_samples/sample_netbeans/nbproject/private/config.properties +1 -1
- data/setup_samples/sample_netbeans/nbproject/private/configs/Demo.properties +2 -2
- data/setup_samples/sample_netbeans/nbproject/private/private.properties +2 -2
- data/setup_samples/sample_netbeans/nbproject/project.properties +5 -5
- data/setup_samples/sample_netbeans/nbproject/project.xml +13 -13
- data/setup_samples/sample_rubymine/.idea/encodings.xml +5 -5
- data/setup_samples/sample_rubymine/.idea/misc.xml +5 -5
- data/setup_samples/sample_rubymine/.idea/modules.xml +9 -9
- data/setup_samples/sample_rubymine/.idea/sample_rubymine.iml +9 -9
- data/setup_samples/sample_rubymine/.idea/scopes/scope_settings.xml +4 -4
- data/setup_samples/sample_rubymine/.idea/vcs.xml +7 -7
- data/setup_samples/sample_rubymine/.idea/workspace.xml +213 -213
- data/setup_samples/sample_rubymine/demo.rb +86 -86
- data/test/create_zoho.rb +66 -66
- data/test/create_zoho_account1.rb +68 -68
- data/test/create_zoho_account2.rb +72 -72
- data/test/demo.rb +87 -87
- data/test/google_search1.rb +16 -16
- data/test/google_search2.rb +19 -19
- data/test/login_1.rb +37 -37
- data/test/login_1a.rb +37 -37
- data/test/login_2.rb +32 -32
- data/test/zoho_exercise.rb +21 -21
- data/test/zoho_util.rb +487 -487
- data/tmp/placeholder.html +71 -71
- metadata +18 -49
@@ -1,76 +1,76 @@
|
|
1
|
-
When /^I open a new browser$/ do
|
2
|
-
if @params
|
3
|
-
case @params["browser"]
|
4
|
-
when "FF"; @browser = Watir::Browser.new :firefox
|
5
|
-
when "IE"; @browser = Watir::Browser.new :ie
|
6
|
-
when "C", "GC"; @browser = Watir::Browser.new :chrome
|
7
|
-
end
|
8
|
-
else
|
9
|
-
@browser = Watir::Browser.new
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
Given /^I open a firefox browser$/ do
|
14
|
-
@browser = Watir::Browser.new :firefox
|
15
|
-
end
|
16
|
-
|
17
|
-
Given /^I open a chrome browser$/ do
|
18
|
-
@browser = Watir::Browser.new :chrome
|
19
|
-
end
|
20
|
-
|
21
|
-
Given /^I open an internet explorer browser$/ do
|
22
|
-
@browser = Watir::Browser.new :ie
|
23
|
-
end
|
24
|
-
|
25
|
-
Then /^I navigate to the environment url$/ do
|
26
|
-
url = @params['environment']['url']
|
27
|
-
@browser.goto url
|
28
|
-
end
|
29
|
-
|
30
|
-
Then /^I go to the url "(.*?)"$/ do |url|
|
31
|
-
@browser.goto url
|
32
|
-
end
|
33
|
-
|
34
|
-
Then /^I click "(.*?)"$/ do |element_text|
|
35
|
-
sleep 1
|
36
|
-
@browser.element(:text, element_text).click
|
37
|
-
end
|
38
|
-
|
39
|
-
Then /^I click the button "(.*?)"$/ do |element_text|
|
40
|
-
sleep 1
|
41
|
-
@browser.button(:text, element_text).click
|
42
|
-
end
|
43
|
-
|
44
|
-
Then /^I click the element with "(.*?)" "(.*?)"$/ do |arg1, arg2|
|
45
|
-
@browser.element(arg1.to_sym, arg2)
|
46
|
-
end
|
47
|
-
|
48
|
-
Then /^I should see "(.*?)"$/ do |text|
|
49
|
-
sleep 1
|
50
|
-
stm = @browser.text.include? text
|
51
|
-
if stm
|
52
|
-
true
|
53
|
-
else
|
54
|
-
fail("Did not find text #{text}")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
Then /^I should not see "(.*?)"$/ do |text|
|
59
|
-
stm = @browser.text.include? text
|
60
|
-
if stm
|
61
|
-
fail("Found text #{text}")
|
62
|
-
else
|
63
|
-
true
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
Then /^I fill in "(.*?)" with "(.*?)"$/ do |field, value| #assumes u have label
|
68
|
-
associated_label = @browser.label(:text, field).attribute_value("for")
|
69
|
-
#associated_label = @browser.element(:xpath, '//label[contains(text(),"#{arg1}")]').attribute_value("for"))
|
70
|
-
@browser.text_field(:id, associated_label).set value
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
When /^I wait (\d+) seconds?$/ do |seconds|
|
75
|
-
sleep seconds.to_i
|
76
|
-
end
|
1
|
+
When /^I open a new browser$/ do
|
2
|
+
if @params
|
3
|
+
case @params["browser"]
|
4
|
+
when "FF"; @browser = Watir::Browser.new :firefox
|
5
|
+
when "IE"; @browser = Watir::Browser.new :ie
|
6
|
+
when "C", "GC"; @browser = Watir::Browser.new :chrome
|
7
|
+
end
|
8
|
+
else
|
9
|
+
@browser = Watir::Browser.new
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Given /^I open a firefox browser$/ do
|
14
|
+
@browser = Watir::Browser.new :firefox
|
15
|
+
end
|
16
|
+
|
17
|
+
Given /^I open a chrome browser$/ do
|
18
|
+
@browser = Watir::Browser.new :chrome
|
19
|
+
end
|
20
|
+
|
21
|
+
Given /^I open an internet explorer browser$/ do
|
22
|
+
@browser = Watir::Browser.new :ie
|
23
|
+
end
|
24
|
+
|
25
|
+
Then /^I navigate to the environment url$/ do
|
26
|
+
url = @params['environment']['url']
|
27
|
+
@browser.goto url
|
28
|
+
end
|
29
|
+
|
30
|
+
Then /^I go to the url "(.*?)"$/ do |url|
|
31
|
+
@browser.goto url
|
32
|
+
end
|
33
|
+
|
34
|
+
Then /^I click "(.*?)"$/ do |element_text|
|
35
|
+
sleep 1
|
36
|
+
@browser.element(:text, element_text).click
|
37
|
+
end
|
38
|
+
|
39
|
+
Then /^I click the button "(.*?)"$/ do |element_text|
|
40
|
+
sleep 1
|
41
|
+
@browser.button(:text, element_text).click
|
42
|
+
end
|
43
|
+
|
44
|
+
Then /^I click the element with "(.*?)" "(.*?)"$/ do |arg1, arg2|
|
45
|
+
@browser.element(arg1.to_sym, arg2)
|
46
|
+
end
|
47
|
+
|
48
|
+
Then /^I should see "(.*?)"$/ do |text|
|
49
|
+
sleep 1
|
50
|
+
stm = @browser.text.include? text
|
51
|
+
if stm
|
52
|
+
true
|
53
|
+
else
|
54
|
+
fail("Did not find text #{text}")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Then /^I should not see "(.*?)"$/ do |text|
|
59
|
+
stm = @browser.text.include? text
|
60
|
+
if stm
|
61
|
+
fail("Found text #{text}")
|
62
|
+
else
|
63
|
+
true
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
Then /^I fill in "(.*?)" with "(.*?)"$/ do |field, value| #assumes u have label
|
68
|
+
associated_label = @browser.label(:text, field).attribute_value("for")
|
69
|
+
#associated_label = @browser.element(:xpath, '//label[contains(text(),"#{arg1}")]').attribute_value("for"))
|
70
|
+
@browser.text_field(:id, associated_label).set value
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
When /^I wait (\d+) seconds?$/ do |seconds|
|
75
|
+
sleep seconds.to_i
|
76
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
Feature:
|
2
|
-
I want to test cucumber
|
3
|
-
|
4
|
-
Scenario:
|
5
|
-
When I open a new browser
|
6
|
-
Then I go to the url "http://mail.yahoo.com"
|
7
|
-
Then I should see "Sign in to Yahoo!"
|
8
|
-
When I fill in "Yahoo! ID" with "automationtester88"
|
9
|
-
Then I fill in "Password" with "password1"
|
10
|
-
Then I click the button "Sign In"
|
11
|
-
Then I should see "Invalid ID or password."
|
1
|
+
Feature:
|
2
|
+
I want to test cucumber
|
3
|
+
|
4
|
+
Scenario:
|
5
|
+
When I open a new browser
|
6
|
+
Then I go to the url "http://mail.yahoo.com"
|
7
|
+
Then I should see "Sign in to Yahoo!"
|
8
|
+
When I fill in "Yahoo! ID" with "automationtester88"
|
9
|
+
Then I fill in "Password" with "password1"
|
10
|
+
Then I click the button "Sign In"
|
11
|
+
Then I should see "Invalid ID or password."
|
@@ -1,14 +1,14 @@
|
|
1
|
-
Feature:
|
2
|
-
I want to test cucumber
|
3
|
-
|
4
|
-
Scenario:
|
5
|
-
|
6
|
-
When I touch "Number"
|
7
|
-
Then I should see "Sorted by Atomic Number"
|
8
|
-
When I touch "Symbol"
|
9
|
-
Then I should see "Sorted by Atomic Symbol"
|
10
|
-
When I touch "State"
|
11
|
-
Then I should see "Grouped by State"
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
Feature:
|
2
|
+
I want to test cucumber
|
3
|
+
|
4
|
+
Scenario:
|
5
|
+
|
6
|
+
When I touch "Number"
|
7
|
+
Then I should see "Sorted by Atomic Number"
|
8
|
+
When I touch "Symbol"
|
9
|
+
Then I should see "Sorted by Atomic Symbol"
|
10
|
+
When I touch "State"
|
11
|
+
Then I should see "Grouped by State"
|
12
|
+
|
13
|
+
|
14
|
+
|
@@ -1,80 +1,80 @@
|
|
1
|
-
Then /^let me debug$/ do
|
2
|
-
binding.pry
|
3
|
-
end
|
4
|
-
|
5
|
-
Then /^I swipe "(.*?)" from the "(.*?)" label$/ do |dir, ele| #Then I swipe "up" from the "Locations" label
|
6
|
-
query("view:'UILabel' marked:'#{ele}' first", "swipeInDirection:", dir)
|
7
|
-
end
|
8
|
-
|
9
|
-
Then /^I use the keyboard to fill in the textfield marked "(.*?)" with "(.*?)"$/ do |text_field_mark, text_to_type|
|
10
|
-
query( "view marked:'#{text_field_mark}'", 'setText:', text_to_type )
|
11
|
-
end
|
12
|
-
|
13
|
-
Then /^I touch the switch with index "(.*?)"$/ do |idx| #Then I touch the switch with index "1"
|
14
|
-
touch("view:'UISwitch' index:#{idx}")
|
15
|
-
end
|
16
|
-
|
17
|
-
And /I wait (\d+) seconds?/ do |seconds| #Then I wait 3 seconds
|
18
|
-
sleep(seconds.to_i)
|
19
|
-
end
|
20
|
-
|
21
|
-
Then /^I type "(.*?)" in the text field with id "(.*?)"$/ do |txt, id|
|
22
|
-
set_text("webView css:'input' id:'#{id}'", txt)
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
|
-
Then /^I touch the WebView text "(.*?)"$/ do |txt|
|
27
|
-
sleep 1
|
28
|
-
wait_for(10){element_exists("webView css:'a' textContent:'#{txt}'")}
|
29
|
-
touch("webView css:'a' textContent:'#{txt}'")
|
30
|
-
end
|
31
|
-
|
32
|
-
Then /^I touch the WebView button "(.*?)"$/ do |txt|
|
33
|
-
sleep 1
|
34
|
-
wait_for(10){element_exists("webView css:'input' textContent:'#{txt}'")}
|
35
|
-
touch("webView css:'input' textContent:'#{txt}'")
|
36
|
-
end
|
37
|
-
|
38
|
-
Then /^I should see the WebView text "(.*?)"$/ do |txt|
|
39
|
-
sleep 1
|
40
|
-
if !query("webView textContent:'#{txt}'").empty?
|
41
|
-
true
|
42
|
-
else
|
43
|
-
fail("Did not find WebView text '#{txt}")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
Then /^I should not see the WebView text "(.*?)"$/ do |txt|
|
48
|
-
sleep 1
|
49
|
-
if query("webView textContent:'#{txt}'").empty?
|
50
|
-
true
|
51
|
-
else
|
52
|
-
fail("Found WebView text '#{txt}'")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
Then /^I touch the WebView button with value "(.*?)"$/ do |val|
|
57
|
-
wait_for(10){element_exists("webView css:'input' value:'#{val}'")}
|
58
|
-
touch("webView css:'input' value:'#{val}'")
|
59
|
-
end
|
60
|
-
|
61
|
-
When /^I touch the WebView link with index "(.*?)"$/ do |idx|
|
62
|
-
wait_for(10){element_exists("webView css:'a' index:#{idx}")}
|
63
|
-
touch("webView css:'a' index:#{idx}")
|
64
|
-
end
|
65
|
-
|
66
|
-
def send_command ( command )
|
67
|
-
%x{osascript<<APPLESCRIPT
|
68
|
-
tell application "System Events"
|
69
|
-
tell application "iPhone Simulator" to activate
|
70
|
-
keystroke "#{command}"
|
71
|
-
delay 1
|
72
|
-
key code 36
|
73
|
-
end tell
|
74
|
-
APPLESCRIPT}
|
75
|
-
end
|
76
|
-
|
77
|
-
When /^I send the command "([^\\"]*)"$/ do |cmd|
|
78
|
-
send_command(cmd)
|
79
|
-
end
|
80
|
-
|
1
|
+
Then /^let me debug$/ do
|
2
|
+
binding.pry
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^I swipe "(.*?)" from the "(.*?)" label$/ do |dir, ele| #Then I swipe "up" from the "Locations" label
|
6
|
+
query("view:'UILabel' marked:'#{ele}' first", "swipeInDirection:", dir)
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^I use the keyboard to fill in the textfield marked "(.*?)" with "(.*?)"$/ do |text_field_mark, text_to_type|
|
10
|
+
query( "view marked:'#{text_field_mark}'", 'setText:', text_to_type )
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^I touch the switch with index "(.*?)"$/ do |idx| #Then I touch the switch with index "1"
|
14
|
+
touch("view:'UISwitch' index:#{idx}")
|
15
|
+
end
|
16
|
+
|
17
|
+
And /I wait (\d+) seconds?/ do |seconds| #Then I wait 3 seconds
|
18
|
+
sleep(seconds.to_i)
|
19
|
+
end
|
20
|
+
|
21
|
+
Then /^I type "(.*?)" in the text field with id "(.*?)"$/ do |txt, id|
|
22
|
+
set_text("webView css:'input' id:'#{id}'", txt)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
Then /^I touch the WebView text "(.*?)"$/ do |txt|
|
27
|
+
sleep 1
|
28
|
+
wait_for(10){element_exists("webView css:'a' textContent:'#{txt}'")}
|
29
|
+
touch("webView css:'a' textContent:'#{txt}'")
|
30
|
+
end
|
31
|
+
|
32
|
+
Then /^I touch the WebView button "(.*?)"$/ do |txt|
|
33
|
+
sleep 1
|
34
|
+
wait_for(10){element_exists("webView css:'input' textContent:'#{txt}'")}
|
35
|
+
touch("webView css:'input' textContent:'#{txt}'")
|
36
|
+
end
|
37
|
+
|
38
|
+
Then /^I should see the WebView text "(.*?)"$/ do |txt|
|
39
|
+
sleep 1
|
40
|
+
if !query("webView textContent:'#{txt}'").empty?
|
41
|
+
true
|
42
|
+
else
|
43
|
+
fail("Did not find WebView text '#{txt}")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Then /^I should not see the WebView text "(.*?)"$/ do |txt|
|
48
|
+
sleep 1
|
49
|
+
if query("webView textContent:'#{txt}'").empty?
|
50
|
+
true
|
51
|
+
else
|
52
|
+
fail("Found WebView text '#{txt}'")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
Then /^I touch the WebView button with value "(.*?)"$/ do |val|
|
57
|
+
wait_for(10){element_exists("webView css:'input' value:'#{val}'")}
|
58
|
+
touch("webView css:'input' value:'#{val}'")
|
59
|
+
end
|
60
|
+
|
61
|
+
When /^I touch the WebView link with index "(.*?)"$/ do |idx|
|
62
|
+
wait_for(10){element_exists("webView css:'a' index:#{idx}")}
|
63
|
+
touch("webView css:'a' index:#{idx}")
|
64
|
+
end
|
65
|
+
|
66
|
+
def send_command ( command )
|
67
|
+
%x{osascript<<APPLESCRIPT
|
68
|
+
tell application "System Events"
|
69
|
+
tell application "iPhone Simulator" to activate
|
70
|
+
keystroke "#{command}"
|
71
|
+
delay 1
|
72
|
+
key code 36
|
73
|
+
end tell
|
74
|
+
APPLESCRIPT}
|
75
|
+
end
|
76
|
+
|
77
|
+
When /^I send the command "([^\\"]*)"$/ do |cmd|
|
78
|
+
send_command(cmd)
|
79
|
+
end
|
80
|
+
|
@@ -1,3 +1,3 @@
|
|
1
|
-
require 'calabash-cucumber/cucumber'
|
2
|
-
require 'calabash-cucumber/calabash_steps'
|
1
|
+
require 'calabash-cucumber/cucumber'
|
2
|
+
require 'calabash-cucumber/calabash_steps'
|
3
3
|
require 'pry'
|
@@ -1,86 +1,86 @@
|
|
1
|
-
module Demo
|
2
|
-
def run
|
3
|
-
browser = open_browser
|
4
|
-
login(browser)
|
5
|
-
test_zoho(browser)
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_account_lookup(browser)
|
9
|
-
mark_testlevel('Account Lookup', 1)
|
10
|
-
browser.image(:title, 'Account Name Lookup').click
|
11
|
-
sleep_for(5)
|
12
|
-
popup = attach_browser_by_url(browser, /Parent/)
|
13
|
-
# TODO: This should be transparent:
|
14
|
-
if @browserAbbrev == "FF"
|
15
|
-
popup = browser
|
16
|
-
end
|
17
|
-
set_textfield_by_name(popup, 'fldValue', 'test')
|
18
|
-
click_button_by_value(popup, 'Go')
|
19
|
-
popup.link(:text, /Test Account/).click
|
20
|
-
#browser = attach_browser_by_url(browser, /ShowHomePage/)
|
21
|
-
#validate_textfield_value_by_name(browser, /Parent Account/, 'Test Account #007')
|
22
|
-
end
|
23
|
-
|
24
|
-
def login(browser)
|
25
|
-
mark_testlevel('Zoho Login', 2)
|
26
|
-
user = "joeklienwatir@gmail.com" #@zohologin.cell(2,2)
|
27
|
-
password = "watir001" #@zohologin.cell(2,3)
|
28
|
-
go_to_url(browser, "https://accounts.zoho.com/login?serviceurl=https://www.zoho.com/&hide_signup=true&css=https://www.zoho.com/css/login.css")
|
29
|
-
#browser.goto("https://accounts.zoho.com/login?serviceurl=https://www.zoho.com/&hide_signup=true&css=https://www.zoho.com/css/login.css")
|
30
|
-
set_textfield_by_name(browser, 'lid', user)
|
31
|
-
set_textfield_by_name(browser, 'pwd', password)
|
32
|
-
click_button_by_value(browser, 'Sign In')
|
33
|
-
go_to_url(browser, url = 'https://crm.zoho.com/crm/ShowHomePage.do')
|
34
|
-
validate_text(browser, 'Welcome joeklienwatir at Software')
|
35
|
-
#click_text(browser, 'Old Version')
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def navigate_to_crm(browser)
|
40
|
-
mark_testlevel('Navigate to CRM', 1)
|
41
|
-
click_text(browser, 'CRM')
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_zoho(browser)
|
45
|
-
#get_variables("#{@myRoot}/zoho_variables.xls")
|
46
|
-
navigate_to_crm(browser) #In Project Util
|
47
|
-
create_account(browser)
|
48
|
-
#create_blank_new_account(browser)
|
49
|
-
#export_accounts(browser)
|
50
|
-
#import_accounts(browser)
|
51
|
-
#signout(browser)
|
52
|
-
end
|
53
|
-
|
54
|
-
def create_account(browser)
|
55
|
-
mark_testlevel('Create New Account', 3)
|
56
|
-
sleep_for(3)
|
57
|
-
click_link(browser, 'Accounts')
|
58
|
-
sleep_for(3)
|
59
|
-
click_button_by_value(browser, 'New Account')
|
60
|
-
sleep_for(5)
|
61
|
-
# Watir::Waiter::wait_until { browser.text_field(:name, /Account Name/).exist? }
|
62
|
-
# Watir::Waiter::wait_until { browser.text_field(:name, /Account Name/).visible? }
|
63
|
-
set_textfield_by_name(browser, /Account Name/, "Test Account #1")
|
64
|
-
set_textfield_by_name(browser, /Phone/, "415-333-2311")
|
65
|
-
|
66
|
-
test_account_lookup(browser) #In Project Util
|
67
|
-
browser = attach_browser_by_url(browser, /ShowHomePage/)
|
68
|
-
select_option_by_name_and_option_text(browser, /Account Type/, "Analyst")
|
69
|
-
select_option_by_name_and_option_text(browser, /Industry/, "ASP")
|
70
|
-
set_textfield_by_name(browser, /Billing Street/, "201 Main St")
|
71
|
-
set_textfield_by_name(browser, /Billing City/, "San Francisco")
|
72
|
-
set_textfield_by_name(browser, /Billing State/, "CA")
|
73
|
-
set_textfield_by_name(browser, /Billing Code/, "94102")
|
74
|
-
set_textfield_by_name(browser, /Billing Country/, "USA")
|
75
|
-
#browser.cell(:text, 'Billing to Shipping').click
|
76
|
-
click_button_by_id(browser, 'copyAddress')
|
77
|
-
sleep_for(5)
|
78
|
-
click_button_by_value(browser, 'Save')
|
79
|
-
|
80
|
-
sleep_for(8)
|
81
|
-
#wait_until_by_text(browser, 'Test Account #1')
|
82
|
-
validate_text(browser, "Test Account #1")
|
83
|
-
validate_text(browser, "random")
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
1
|
+
module Demo
|
2
|
+
def run
|
3
|
+
browser = open_browser
|
4
|
+
login(browser)
|
5
|
+
test_zoho(browser)
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_account_lookup(browser)
|
9
|
+
mark_testlevel('Account Lookup', 1)
|
10
|
+
browser.image(:title, 'Account Name Lookup').click
|
11
|
+
sleep_for(5)
|
12
|
+
popup = attach_browser_by_url(browser, /Parent/)
|
13
|
+
# TODO: This should be transparent:
|
14
|
+
if @browserAbbrev == "FF"
|
15
|
+
popup = browser
|
16
|
+
end
|
17
|
+
set_textfield_by_name(popup, 'fldValue', 'test')
|
18
|
+
click_button_by_value(popup, 'Go')
|
19
|
+
popup.link(:text, /Test Account/).click
|
20
|
+
#browser = attach_browser_by_url(browser, /ShowHomePage/)
|
21
|
+
#validate_textfield_value_by_name(browser, /Parent Account/, 'Test Account #007')
|
22
|
+
end
|
23
|
+
|
24
|
+
def login(browser)
|
25
|
+
mark_testlevel('Zoho Login', 2)
|
26
|
+
user = "joeklienwatir@gmail.com" #@zohologin.cell(2,2)
|
27
|
+
password = "watir001" #@zohologin.cell(2,3)
|
28
|
+
go_to_url(browser, "https://accounts.zoho.com/login?serviceurl=https://www.zoho.com/&hide_signup=true&css=https://www.zoho.com/css/login.css")
|
29
|
+
#browser.goto("https://accounts.zoho.com/login?serviceurl=https://www.zoho.com/&hide_signup=true&css=https://www.zoho.com/css/login.css")
|
30
|
+
set_textfield_by_name(browser, 'lid', user)
|
31
|
+
set_textfield_by_name(browser, 'pwd', password)
|
32
|
+
click_button_by_value(browser, 'Sign In')
|
33
|
+
go_to_url(browser, url = 'https://crm.zoho.com/crm/ShowHomePage.do')
|
34
|
+
validate_text(browser, 'Welcome joeklienwatir at Software')
|
35
|
+
#click_text(browser, 'Old Version')
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
def navigate_to_crm(browser)
|
40
|
+
mark_testlevel('Navigate to CRM', 1)
|
41
|
+
click_text(browser, 'CRM')
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_zoho(browser)
|
45
|
+
#get_variables("#{@myRoot}/zoho_variables.xls")
|
46
|
+
navigate_to_crm(browser) #In Project Util
|
47
|
+
create_account(browser)
|
48
|
+
#create_blank_new_account(browser)
|
49
|
+
#export_accounts(browser)
|
50
|
+
#import_accounts(browser)
|
51
|
+
#signout(browser)
|
52
|
+
end
|
53
|
+
|
54
|
+
def create_account(browser)
|
55
|
+
mark_testlevel('Create New Account', 3)
|
56
|
+
sleep_for(3)
|
57
|
+
click_link(browser, 'Accounts')
|
58
|
+
sleep_for(3)
|
59
|
+
click_button_by_value(browser, 'New Account')
|
60
|
+
sleep_for(5)
|
61
|
+
# Watir::Waiter::wait_until { browser.text_field(:name, /Account Name/).exist? }
|
62
|
+
# Watir::Waiter::wait_until { browser.text_field(:name, /Account Name/).visible? }
|
63
|
+
set_textfield_by_name(browser, /Account Name/, "Test Account #1")
|
64
|
+
set_textfield_by_name(browser, /Phone/, "415-333-2311")
|
65
|
+
|
66
|
+
test_account_lookup(browser) #In Project Util
|
67
|
+
browser = attach_browser_by_url(browser, /ShowHomePage/)
|
68
|
+
select_option_by_name_and_option_text(browser, /Account Type/, "Analyst")
|
69
|
+
select_option_by_name_and_option_text(browser, /Industry/, "ASP")
|
70
|
+
set_textfield_by_name(browser, /Billing Street/, "201 Main St")
|
71
|
+
set_textfield_by_name(browser, /Billing City/, "San Francisco")
|
72
|
+
set_textfield_by_name(browser, /Billing State/, "CA")
|
73
|
+
set_textfield_by_name(browser, /Billing Code/, "94102")
|
74
|
+
set_textfield_by_name(browser, /Billing Country/, "USA")
|
75
|
+
#browser.cell(:text, 'Billing to Shipping').click
|
76
|
+
click_button_by_id(browser, 'copyAddress')
|
77
|
+
sleep_for(5)
|
78
|
+
click_button_by_value(browser, 'Save')
|
79
|
+
|
80
|
+
sleep_for(8)
|
81
|
+
#wait_until_by_text(browser, 'Test Account #1')
|
82
|
+
validate_text(browser, "Test Account #1")
|
83
|
+
validate_text(browser, "random")
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
main.file=awetestlib
|
2
|
-
ruby.options=-rubygems
|
1
|
+
main.file=awetestlib
|
2
|
+
ruby.options=-rubygems
|
@@ -1 +1 @@
|
|
1
|
-
config=Demo
|
1
|
+
config=Demo
|
@@ -1,2 +1,2 @@
|
|
1
|
-
application.args=SAMPLE-SCRIPT -b FF
|
2
|
-
work.dir=WORK-DIR
|
1
|
+
application.args=SAMPLE-SCRIPT -b FF
|
2
|
+
work.dir=WORK-DIR
|
@@ -1,2 +1,2 @@
|
|
1
|
-
file.reference.Ruby187-bin=BIN-DIR
|
2
|
-
platform.active=Ruby
|
1
|
+
file.reference.Ruby187-bin=BIN-DIR
|
2
|
+
platform.active=Ruby
|
@@ -1,5 +1,5 @@
|
|
1
|
-
javac.classpath=
|
2
|
-
main.file=
|
3
|
-
platform.active=Ruby
|
4
|
-
source.encoding=UTF-8
|
5
|
-
src.dir=${file.reference.Ruby187-bin}
|
1
|
+
javac.classpath=
|
2
|
+
main.file=
|
3
|
+
platform.active=Ruby
|
4
|
+
source.encoding=UTF-8
|
5
|
+
src.dir=${file.reference.Ruby187-bin}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
-
<type>org.netbeans.modules.ruby.rubyproject</type>
|
4
|
-
<configuration>
|
5
|
-
<data xmlns="http://www.netbeans.org/ns/ruby-project/1">
|
6
|
-
<name>PROJECT-NAME</name>
|
7
|
-
<source-roots>
|
8
|
-
<root id="src.dir"/>
|
9
|
-
</source-roots>
|
10
|
-
<test-roots/>
|
11
|
-
</data>
|
12
|
-
</configuration>
|
13
|
-
</project>
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
+
<type>org.netbeans.modules.ruby.rubyproject</type>
|
4
|
+
<configuration>
|
5
|
+
<data xmlns="http://www.netbeans.org/ns/ruby-project/1">
|
6
|
+
<name>PROJECT-NAME</name>
|
7
|
+
<source-roots>
|
8
|
+
<root id="src.dir"/>
|
9
|
+
</source-roots>
|
10
|
+
<test-roots/>
|
11
|
+
</data>
|
12
|
+
</configuration>
|
13
|
+
</project>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
4
|
-
</project>
|
5
|
-
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
4
|
+
</project>
|
5
|
+
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectRootManager" version="2" project-jdk-name="ruby-1.8.7-p352" project-jdk-type="RUBY_SDK" />
|
4
|
-
</project>
|
5
|
-
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="ruby-1.8.7-p352" project-jdk-type="RUBY_SDK" />
|
4
|
+
</project>
|
5
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/sample_rubymine.iml" filepath="$PROJECT_DIR$/.idea/sample_rubymine.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|
9
|
-
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/sample_rubymine.iml" filepath="$PROJECT_DIR$/.idea/sample_rubymine.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
9
|
+
|