awetestlib 0.1.28 → 0.1.29pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/.gitattributes +22 -22
  2. data/.gitignore +69 -69
  3. data/.yardopts +7 -7
  4. data/README.md +108 -108
  5. data/awetestlib.gemspec +57 -57
  6. data/awetestlib.windows.gemspec +41 -41
  7. data/awetestlib_notes.txt +4 -4
  8. data/awetestlib_osx.gemspec +47 -48
  9. data/bin/awetestlib +99 -99
  10. data/bin/awetestlib-android-setup.rb +26 -26
  11. data/bin/awetestlib-cucumber-setup.rb +28 -28
  12. data/bin/awetestlib-driver-setup.rb +21 -21
  13. data/bin/awetestlib-helpers.rb +41 -41
  14. data/bin/awetestlib-mobile-app-setup.rb +31 -31
  15. data/bin/awetestlib-netbeans-setup.rb +58 -58
  16. data/bin/awetestlib-regression-setup.rb +15 -15
  17. data/bin/awetestlib-rubymine-setup.rb +39 -39
  18. data/drivers/chromedriver.exe +0 -0
  19. data/ext/Rakefile +1 -1
  20. data/ext/mkrf_conf.rb +27 -27
  21. data/lib/awetestlib/html_report.rb +142 -142
  22. data/lib/awetestlib/logging.rb +366 -366
  23. data/lib/awetestlib/regression/browser.rb +1380 -1375
  24. data/lib/awetestlib/regression/drag_and_drop.rb +421 -420
  25. data/lib/awetestlib/regression/find.rb +345 -345
  26. data/lib/awetestlib/regression/legacy.rb +1187 -1187
  27. data/lib/awetestlib/regression/page_data.rb +191 -191
  28. data/lib/awetestlib/regression/runner.rb +307 -307
  29. data/lib/awetestlib/regression/tables.rb +627 -619
  30. data/lib/awetestlib/regression/user_input.rb +576 -576
  31. data/lib/awetestlib/regression/utilities.rb +1046 -988
  32. data/lib/awetestlib/regression/validations.rb +1093 -1074
  33. data/lib/awetestlib/regression/waits.rb +470 -470
  34. data/lib/awetestlib/runner.rb +18 -18
  35. data/lib/awetestlib.rb +41 -41
  36. data/lib/patches/README +2 -2
  37. data/lib/patches/firewatir.rb +106 -106
  38. data/lib/patches/watir.rb +175 -175
  39. data/lib/version.rb +2 -2
  40. data/license.txt +13 -13
  41. data/netbeans_setup.md +29 -29
  42. data/rdoc_test.bat +1 -1
  43. data/rubymine_setup.md +23 -23
  44. data/setup_samples/sample_android/features/dk.mejer.hansen.control.FlyingColorsPlayerAidActivity.apk +0 -0
  45. data/setup_samples/sample_android/features/sample_android.feature +5 -5
  46. data/setup_samples/sample_android/features/step_definitions/calabash_steps.rb +1 -1
  47. data/setup_samples/sample_android/features/support/app_installation_hooks.rb +36 -36
  48. data/setup_samples/sample_android/features/support/app_life_cycle_hooks.rb +14 -14
  49. data/setup_samples/sample_android/features/test_servers/8ba795a0288381ae346b67867b586881_0.3.2.apk +0 -0
  50. data/setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb +76 -76
  51. data/setup_samples/sample_cucumber/features/yahoo_mail.feature +11 -11
  52. data/setup_samples/sample_mobile_app/features/my_first.feature +14 -14
  53. data/setup_samples/sample_mobile_app/features/step_definitions/predefined_webview_steps.rb +80 -80
  54. data/setup_samples/sample_mobile_app/features/support/env.rb +2 -2
  55. data/setup_samples/sample_netbeans/demo.rb +86 -86
  56. data/setup_samples/sample_netbeans/nbproject/configs/Demo.properties +2 -2
  57. data/setup_samples/sample_netbeans/nbproject/private/config.properties +1 -1
  58. data/setup_samples/sample_netbeans/nbproject/private/configs/Demo.properties +2 -2
  59. data/setup_samples/sample_netbeans/nbproject/private/private.properties +2 -2
  60. data/setup_samples/sample_netbeans/nbproject/project.properties +5 -5
  61. data/setup_samples/sample_netbeans/nbproject/project.xml +13 -13
  62. data/setup_samples/sample_rubymine/.idea/encodings.xml +5 -5
  63. data/setup_samples/sample_rubymine/.idea/misc.xml +5 -5
  64. data/setup_samples/sample_rubymine/.idea/modules.xml +9 -9
  65. data/setup_samples/sample_rubymine/.idea/sample_rubymine.iml +9 -9
  66. data/setup_samples/sample_rubymine/.idea/scopes/scope_settings.xml +4 -4
  67. data/setup_samples/sample_rubymine/.idea/vcs.xml +7 -7
  68. data/setup_samples/sample_rubymine/.idea/workspace.xml +213 -213
  69. data/setup_samples/sample_rubymine/demo.rb +86 -86
  70. data/test/create_zoho.rb +66 -66
  71. data/test/create_zoho_account1.rb +68 -68
  72. data/test/create_zoho_account2.rb +72 -72
  73. data/test/demo.rb +87 -87
  74. data/test/google_search1.rb +16 -16
  75. data/test/google_search2.rb +19 -19
  76. data/test/login_1.rb +37 -37
  77. data/test/login_1a.rb +37 -37
  78. data/test/login_2.rb +32 -32
  79. data/test/zoho_exercise.rb +21 -21
  80. data/test/zoho_util.rb +487 -487
  81. data/tmp/placeholder.html +71 -71
  82. metadata +18 -49
@@ -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
data/test/create_zoho.rb CHANGED
@@ -1,66 +1,66 @@
1
- $watir_script = true
2
- module CreateZohoAccount1
3
-
4
- def run_test(browser)
5
- create_account_scenario_1(browser)
6
- create_account_scenario_2(browser)
7
- end
8
-
9
- def create_account_scenario_1(browser)
10
- create_account(browser)
11
- create_blank_new_account(browser)
12
- export_accounts(browser)
13
- import_accounts(browser)
14
- signout(browser)
15
- end
16
-
17
- def create_account_scenario_2(browser)
18
- create_blank_new_account(browser)
19
- reports(browser)
20
- clone_account(browser)
21
- pagination(browser)
22
- verify_accounts(browser)
23
- search_accounts(browser)
24
- signout(browser)
25
- end
26
-
27
- def create_account(browser)
28
- mark_testlevel('Create New Account', 1)
29
- sleep_for(3)
30
- click_text(browser, 'New Account')
31
- wait_until_ready(browser, :name, /Account Name/)
32
- set_textfield_by_name(browser, /Account Name/, "Test Account #1")
33
- set_textfield_by_name(browser, /Phone/, "415-333-2311")
34
-
35
- test_account_lookup(browser) #In Project Util
36
- browser = attach_browser_by_url(browser, /ShowHomePage/)
37
- select_option_by_name_and_option_text(browser, /Account Type/, "Analyst")
38
- select_option_by_name_and_option_text(browser, /Industry/, "ASP")
39
- set_textfield_by_name(browser, /Billing Street/, "201 Main St")
40
- set_textfield_by_name(browser, /Billing City/, "San Francisco")
41
- set_textfield_by_name(browser, /Billing State/, "CA")
42
- set_textfield_by_name(browser, /Billing Code/, "94102")
43
- set_textfield_by_name(browser, /Billing Country/, "USA")
44
- #browser.cell(:text, 'Billing to Shipping').click
45
- click(browser, :cell, :text, 'Billing to Shipping')
46
- click_button_by_value(browser, 'Save')
47
-
48
- wait_until_by_text(browser, 'Test Account #1')
49
- validate_text(browser, "Test Account #1")
50
- validate_text(browser, "random")
51
- end
52
-
53
- def test_account_lookup(browser)
54
- mark_testlevel('Account Lookup', 1)
55
- click(browser, :image, :title, 'Account Name Lookup')
56
- sleep_for(5)
57
- popup = attach_browser_by_url(browser, /Parent Account/)
58
- set_textfield_by_name(popup, 'fldValue', 'test account #00')
59
- click_button_by_value(popup, 'Go')
60
- click(popup, :link, :text, 'Test Account #007')
61
- browser = attach_browser_by_url(browser, /ShowHomePage/)
62
- validate_textfield_value_by_name(browser, /Parent Account/, 'Test Account #007')
63
- end
64
-
65
-
66
- end
1
+ $watir_script = true
2
+ module CreateZohoAccount1
3
+
4
+ def run_test(browser)
5
+ create_account_scenario_1(browser)
6
+ create_account_scenario_2(browser)
7
+ end
8
+
9
+ def create_account_scenario_1(browser)
10
+ create_account(browser)
11
+ create_blank_new_account(browser)
12
+ export_accounts(browser)
13
+ import_accounts(browser)
14
+ signout(browser)
15
+ end
16
+
17
+ def create_account_scenario_2(browser)
18
+ create_blank_new_account(browser)
19
+ reports(browser)
20
+ clone_account(browser)
21
+ pagination(browser)
22
+ verify_accounts(browser)
23
+ search_accounts(browser)
24
+ signout(browser)
25
+ end
26
+
27
+ def create_account(browser)
28
+ mark_testlevel('Create New Account', 1)
29
+ sleep_for(3)
30
+ click_text(browser, 'New Account')
31
+ wait_until_ready(browser, :name, /Account Name/)
32
+ set_textfield_by_name(browser, /Account Name/, "Test Account #1")
33
+ set_textfield_by_name(browser, /Phone/, "415-333-2311")
34
+
35
+ test_account_lookup(browser) #In Project Util
36
+ browser = attach_browser_by_url(browser, /ShowHomePage/)
37
+ select_option_by_name_and_option_text(browser, /Account Type/, "Analyst")
38
+ select_option_by_name_and_option_text(browser, /Industry/, "ASP")
39
+ set_textfield_by_name(browser, /Billing Street/, "201 Main St")
40
+ set_textfield_by_name(browser, /Billing City/, "San Francisco")
41
+ set_textfield_by_name(browser, /Billing State/, "CA")
42
+ set_textfield_by_name(browser, /Billing Code/, "94102")
43
+ set_textfield_by_name(browser, /Billing Country/, "USA")
44
+ #browser.cell(:text, 'Billing to Shipping').click
45
+ click(browser, :cell, :text, 'Billing to Shipping')
46
+ click_button_by_value(browser, 'Save')
47
+
48
+ wait_until_by_text(browser, 'Test Account #1')
49
+ validate_text(browser, "Test Account #1")
50
+ validate_text(browser, "random")
51
+ end
52
+
53
+ def test_account_lookup(browser)
54
+ mark_testlevel('Account Lookup', 1)
55
+ click(browser, :image, :title, 'Account Name Lookup')
56
+ sleep_for(5)
57
+ popup = attach_browser_by_url(browser, /Parent Account/)
58
+ set_textfield_by_name(popup, 'fldValue', 'test account #00')
59
+ click_button_by_value(popup, 'Go')
60
+ click(popup, :link, :text, 'Test Account #007')
61
+ browser = attach_browser_by_url(browser, /ShowHomePage/)
62
+ validate_textfield_value_by_name(browser, /Parent Account/, 'Test Account #007')
63
+ end
64
+
65
+
66
+ end
@@ -1,68 +1,68 @@
1
- #include 'pry'
2
- $watir_script = true
3
- module CreateZohoAccount1
4
-
5
- def run_test(browser)
6
- create_account_scenario_1(browser)
7
- create_account_scenario_2(browser)
8
- end
9
-
10
- def create_account_scenario_1(browser)
11
- create_account(browser)
12
- create_blank_new_account(browser)
13
- export_accounts(browser)
14
- import_accounts(browser)
15
- signout(browser)
16
- end
17
-
18
- def create_account_scenario_2(browser)
19
- create_blank_new_account(browser)
20
- reports(browser)
21
- clone_account(browser)
22
- pagination(browser)
23
- verify_accounts(browser)
24
- search_accounts(browser)
25
- signout(browser)
26
- end
27
-
28
- def create_account(browser)
29
- mark_testlevel('Create New Account', 1)
30
- sleep_for(3)
31
- click(browser, :link, :text, 'New Account')
32
- wait_until_ready(browser, :name, /Account Name/)
33
- set_textfield_by_name(browser, /Account Name/, "Test Account #1")
34
- set_textfield_by_name(browser, /Phone/, "415-333-2311")
35
-
36
- test_account_lookup(browser) #In Project Util
37
- browser = attach_browser_by_url(browser, /ShowHomePage/)
38
- select_option_by_name_and_option_text(browser, /Account Type/, "Analyst")
39
- select_option_by_name_and_option_text(browser, /Industry/, "ASP")
40
- set_textfield_by_name(browser, /Billing Street/, "201 Main St")
41
- set_textfield_by_name(browser, /Billing City/, "San Francisco")
42
- set_textfield_by_name(browser, /Billing State/, "CA")
43
- set_textfield_by_name(browser, /Billing Code/, "94102")
44
- set_textfield_by_name(browser, /Billing Country/, "USA")
45
- #browser.cell(:text, 'Billing to Shipping').click
46
- click(browser, :cell, :text, 'Billing to Shipping')
47
- click_button_by_value(browser, 'Save')
48
-
49
- wait_until_by_text(browser, 'Test Account #1')
50
- validate_text(browser, "Test Account #1")
51
- validate_text(browser, "random")
52
- end
53
-
54
- def test_account_lookup(browser)
55
- mark_testlevel('Account Lookup', 1)
56
- click(browser, :image, :title, 'Account Name Lookup')
57
- sleep_for(5)
58
- popup = attach_browser_by_url(browser, /Parent Account/)
59
- set_textfield_by_name(popup, 'fldValue', 'test account #00')
60
- click_button_by_value(popup, 'Go')
61
- click(popup, :link, :text, 'Test Account #007')
62
- # TODO: This next line is currently required for Firefox and Chrome to return to original browser window browser = attach_browser_by_url(browser, /ShowHomePage/)
63
- browser = attach_browser_by_url(browser, /ShowHomePage/)
64
- validate_textfield_value_by_name(browser, /Parent Account/, 'Test Account #007')
65
- end
66
-
67
-
68
- end
1
+ #include 'pry'
2
+ $watir_script = true
3
+ module CreateZohoAccount1
4
+
5
+ def run_test(browser)
6
+ create_account_scenario_1(browser)
7
+ create_account_scenario_2(browser)
8
+ end
9
+
10
+ def create_account_scenario_1(browser)
11
+ create_account(browser)
12
+ create_blank_new_account(browser)
13
+ export_accounts(browser)
14
+ import_accounts(browser)
15
+ signout(browser)
16
+ end
17
+
18
+ def create_account_scenario_2(browser)
19
+ create_blank_new_account(browser)
20
+ reports(browser)
21
+ clone_account(browser)
22
+ pagination(browser)
23
+ verify_accounts(browser)
24
+ search_accounts(browser)
25
+ signout(browser)
26
+ end
27
+
28
+ def create_account(browser)
29
+ mark_testlevel('Create New Account', 1)
30
+ sleep_for(3)
31
+ click(browser, :link, :text, 'New Account')
32
+ wait_until_ready(browser, :name, /Account Name/)
33
+ set_textfield_by_name(browser, /Account Name/, "Test Account #1")
34
+ set_textfield_by_name(browser, /Phone/, "415-333-2311")
35
+
36
+ test_account_lookup(browser) #In Project Util
37
+ browser = attach_browser_by_url(browser, /ShowHomePage/)
38
+ select_option_by_name_and_option_text(browser, /Account Type/, "Analyst")
39
+ select_option_by_name_and_option_text(browser, /Industry/, "ASP")
40
+ set_textfield_by_name(browser, /Billing Street/, "201 Main St")
41
+ set_textfield_by_name(browser, /Billing City/, "San Francisco")
42
+ set_textfield_by_name(browser, /Billing State/, "CA")
43
+ set_textfield_by_name(browser, /Billing Code/, "94102")
44
+ set_textfield_by_name(browser, /Billing Country/, "USA")
45
+ #browser.cell(:text, 'Billing to Shipping').click
46
+ click(browser, :cell, :text, 'Billing to Shipping')
47
+ click_button_by_value(browser, 'Save')
48
+
49
+ wait_until_by_text(browser, 'Test Account #1')
50
+ validate_text(browser, "Test Account #1")
51
+ validate_text(browser, "random")
52
+ end
53
+
54
+ def test_account_lookup(browser)
55
+ mark_testlevel('Account Lookup', 1)
56
+ click(browser, :image, :title, 'Account Name Lookup')
57
+ sleep_for(5)
58
+ popup = attach_browser_by_url(browser, /Parent Account/)
59
+ set_textfield_by_name(popup, 'fldValue', 'test account #00')
60
+ click_button_by_value(popup, 'Go')
61
+ click(popup, :link, :text, 'Test Account #007')
62
+ # TODO: This next line is currently required for Firefox and Chrome to return to original browser window browser = attach_browser_by_url(browser, /ShowHomePage/)
63
+ browser = attach_browser_by_url(browser, /ShowHomePage/)
64
+ validate_textfield_value_by_name(browser, /Parent Account/, 'Test Account #007')
65
+ end
66
+
67
+
68
+ end
@@ -1,72 +1,72 @@
1
- $watir_script = true
2
- module CreateZohoAccount2
3
-
4
- def run_test(browser)
5
- create_account_scenario_1(browser)
6
- create_account_scenario_2(browser)
7
- end
8
-
9
- def create_account_scenario_1(browser)
10
- mark_testlevel("#{__method__.to_s.titleize}", 1)
11
- create_account(browser)
12
- create_blank_new_account(browser)
13
- export_accounts(browser)
14
- import_accounts(browser)
15
- signout(browser)
16
- end
17
-
18
- def create_account_scenario_2(browser)
19
- mark_testlevel("#{__method__.to_s.titleize}", 1)
20
- create_blank_new_account(browser)
21
- reports(browser)
22
- clone_account(browser)
23
- pagination(browser)
24
- verify_accounts(browser)
25
- search_accounts(browser)
26
- signout(browser)
27
- end
28
-
29
- def create_account(browser)
30
- mark_testlevel("#{__method__.to_s.titleize}", 1)
31
- sleep_for(3)
32
- click_text(browser, 'New Account')
33
- wait_until_ready(browser, :name, /Account Name/)
34
- set_textfield_by_name(browser, /Account Name/, @var['account_name'], "*** cza007 ***")
35
- set_textfield_by_name(browser, /Phone/, @var['account_phone'], "*** cza007 ***")
36
-
37
- test_account_lookup(browser)
38
- browser = attach_browser_by_url(browser, /ShowHomePage/)
39
-
40
- select_option_by_name_and_option_text(browser, /Account Type/, @var['account_type'], "*** cza003a ***")
41
- select_option_by_name_and_option_text(browser, /Industry/, @var['account_industry'], "*** cza003b ***")
42
- set_textfield_by_name(browser, /Billing Street/, @var['account_billing_street'], "*** cza003c ***")
43
- set_textfield_by_name(browser, /Billing City/, @var['account_billing_city'], "*** cza003d ***")
44
- set_textfield_by_name(browser, /Billing State/, @var['account_billing_state'], "*** cza003e ***")
45
- set_textfield_by_name(browser, /Billing Code/, @var['account_billing_zipcode'], "*** cza003f ***")
46
- set_textfield_by_name(browser, /Billing Country/, @var['account_country'], "*** cza003g ***")
47
-
48
- #browser.cell(:text, 'Billing to Shipping').click
49
- click(browser, :cell, :text, 'Billing to Shipping', "*** cza004 ***")
50
- click_button_by_value(browser, 'Save')
51
-
52
- wait_until_by_text(browser, @var['account_name'])
53
- validate_text(browser, @var['account_name'], "*** cza005 ***")
54
- validate_text(browser, "random", "*** cza006 ***")
55
- end
56
-
57
- def test_account_lookup(browser)
58
- mark_testlevel("#{__method__.to_s.titleize}", 1)
59
- click(browser, :image, :title, 'Account Name Lookup')
60
- #sleep_for(5)
61
- popup = attach_browser_by_url(browser, /Parent Account/, "*** cza001 ***")
62
- if popup
63
- set_textfield_by_name(popup, 'fldValue', @var['parent_account_pattern'])
64
- click_button_by_value(popup, 'Go')
65
- click(popup, :link, :text, @var['parent_account'])
66
- # TODO: This next line is currently required for Firefox and Chrome to return to original browser window
67
- browser = attach_browser_by_url(browser, /ShowHomePage/)
68
- validate_textfield_value_by_name(browser, /Parent Account/, @var['parent_account'], "*** cza002 ***")
69
- end
70
- end
71
-
72
- end
1
+ $watir_script = true
2
+ module CreateZohoAccount2
3
+
4
+ def run_test(browser)
5
+ create_account_scenario_1(browser)
6
+ create_account_scenario_2(browser)
7
+ end
8
+
9
+ def create_account_scenario_1(browser)
10
+ mark_testlevel("#{__method__.to_s.titleize}", 1)
11
+ create_account(browser)
12
+ create_blank_new_account(browser)
13
+ export_accounts(browser)
14
+ import_accounts(browser)
15
+ signout(browser)
16
+ end
17
+
18
+ def create_account_scenario_2(browser)
19
+ mark_testlevel("#{__method__.to_s.titleize}", 1)
20
+ create_blank_new_account(browser)
21
+ reports(browser)
22
+ clone_account(browser)
23
+ pagination(browser)
24
+ verify_accounts(browser)
25
+ search_accounts(browser)
26
+ signout(browser)
27
+ end
28
+
29
+ def create_account(browser)
30
+ mark_testlevel("#{__method__.to_s.titleize}", 1)
31
+ sleep_for(3)
32
+ click_text(browser, 'New Account')
33
+ wait_until_ready(browser, :name, /Account Name/)
34
+ set_textfield_by_name(browser, /Account Name/, @var['account_name'], "*** cza007 ***")
35
+ set_textfield_by_name(browser, /Phone/, @var['account_phone'], "*** cza007 ***")
36
+
37
+ test_account_lookup(browser)
38
+ browser = attach_browser_by_url(browser, /ShowHomePage/)
39
+
40
+ select_option_by_name_and_option_text(browser, /Account Type/, @var['account_type'], "*** cza003a ***")
41
+ select_option_by_name_and_option_text(browser, /Industry/, @var['account_industry'], "*** cza003b ***")
42
+ set_textfield_by_name(browser, /Billing Street/, @var['account_billing_street'], "*** cza003c ***")
43
+ set_textfield_by_name(browser, /Billing City/, @var['account_billing_city'], "*** cza003d ***")
44
+ set_textfield_by_name(browser, /Billing State/, @var['account_billing_state'], "*** cza003e ***")
45
+ set_textfield_by_name(browser, /Billing Code/, @var['account_billing_zipcode'], "*** cza003f ***")
46
+ set_textfield_by_name(browser, /Billing Country/, @var['account_country'], "*** cza003g ***")
47
+
48
+ #browser.cell(:text, 'Billing to Shipping').click
49
+ click(browser, :cell, :text, 'Billing to Shipping', "*** cza004 ***")
50
+ click_button_by_value(browser, 'Save')
51
+
52
+ wait_until_by_text(browser, @var['account_name'])
53
+ validate_text(browser, @var['account_name'], "*** cza005 ***")
54
+ validate_text(browser, "random", "*** cza006 ***")
55
+ end
56
+
57
+ def test_account_lookup(browser)
58
+ mark_testlevel("#{__method__.to_s.titleize}", 1)
59
+ click(browser, :image, :title, 'Account Name Lookup')
60
+ #sleep_for(5)
61
+ popup = attach_browser_by_url(browser, /Parent Account/, "*** cza001 ***")
62
+ if popup
63
+ set_textfield_by_name(popup, 'fldValue', @var['parent_account_pattern'])
64
+ click_button_by_value(popup, 'Go')
65
+ click(popup, :link, :text, @var['parent_account'])
66
+ # TODO: This next line is currently required for Firefox and Chrome to return to original browser window
67
+ browser = attach_browser_by_url(browser, /ShowHomePage/)
68
+ validate_textfield_value_by_name(browser, /Parent Account/, @var['parent_account'], "*** cza002 ***")
69
+ end
70
+ end
71
+
72
+ end