testcentricity 2.4.2 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +29 -0
- data/.rspec +2 -1
- data/.rubocop.yml +38 -0
- data/.ruby-version +1 -1
- data/.simplecov +9 -0
- data/.yardopts +3 -0
- data/CHANGELOG.md +275 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/{LICENSE.txt → LICENSE.md} +3 -4
- data/README.md +938 -1380
- data/Rakefile +63 -1
- data/config/cucumber.yml +145 -0
- data/config/locales/en-US.yml +56 -0
- data/config/test_data/LOCAL_data.yml +11 -0
- data/config/test_data/data.yml +10 -0
- data/features/deep_links.feature +26 -0
- data/features/login.feature +30 -0
- data/features/navigation.feature +31 -0
- data/features/step_definitions/generic_steps.rb +72 -0
- data/features/support/android/screens/about_screen.rb +11 -0
- data/features/support/android/screens/base_app_screen.rb +29 -0
- data/features/support/android/screens/checkout_address_screen.rb +17 -0
- data/features/support/android/screens/checkout_payment_screen.rb +22 -0
- data/features/support/android/screens/login_screen.rb +18 -0
- data/features/support/android/screens/products_screen.rb +13 -0
- data/features/support/android/screens/saucebot_screen.rb +16 -0
- data/features/support/android/screens/webview_screen.rb +13 -0
- data/features/support/android/sections/nav_widgets/nav_menu.rb +39 -0
- data/features/support/env.rb +61 -0
- data/features/support/hooks.rb +135 -0
- data/features/support/ios/screens/about_screen.rb +11 -0
- data/features/support/ios/screens/base_app_screen.rb +19 -0
- data/features/support/ios/screens/checkout_address_screen.rb +17 -0
- data/features/support/ios/screens/checkout_payment_screen.rb +22 -0
- data/features/support/ios/screens/login_screen.rb +18 -0
- data/features/support/ios/screens/products_screen.rb +13 -0
- data/features/support/ios/screens/saucebot_screen.rb +16 -0
- data/features/support/ios/screens/webview_screen.rb +13 -0
- data/features/support/ios/sections/list_items/product_cell_item.rb +13 -0
- data/features/support/ios/sections/modals/base_modal.rb +23 -0
- data/features/support/ios/sections/modals/logout_modal.rb +6 -0
- data/features/support/ios/sections/modals/reset_app_state_modal.rb +6 -0
- data/features/support/ios/sections/nav_widgets/nav_bar.rb +31 -0
- data/features/support/ios/sections/nav_widgets/nav_menu.rb +41 -0
- data/features/support/shared_components/screens/base_app_screen.rb +31 -0
- data/features/support/shared_components/screens/checkout_address_screen.rb +17 -0
- data/features/support/shared_components/screens/checkout_payment_screen.rb +22 -0
- data/features/support/shared_components/screens/login_screen.rb +39 -0
- data/features/support/shared_components/screens/saucebot_screen.rb +17 -0
- data/features/support/shared_components/screens/webview_screen.rb +12 -0
- data/features/support/shared_components/sections/nav_menu.rb +58 -0
- data/features/support/world_data.rb +12 -0
- data/features/support/world_pages.rb +26 -0
- data/lib/testcentricity/app_core/appium_connect_helper.rb +343 -111
- data/lib/testcentricity/app_core/screen_object.rb +252 -0
- data/lib/testcentricity/app_core/screen_objects_helper.rb +29 -201
- data/lib/testcentricity/app_core/{screen_sections_helper.rb → screen_section.rb} +40 -105
- data/lib/testcentricity/app_elements/app_element_helper.rb +17 -8
- data/lib/testcentricity/app_elements/checkbox.rb +3 -3
- data/lib/testcentricity/data_objects/environment.rb +133 -39
- data/lib/testcentricity/version.rb +1 -1
- data/lib/testcentricity.rb +4 -129
- data/reports/.keep +1 -0
- data/spec/fixtures/page_object.rb +22 -0
- data/spec/fixtures/page_section_object.rb +21 -0
- data/spec/fixtures/screen_object.rb +16 -0
- data/spec/fixtures/screen_section_object.rb +16 -0
- data/spec/spec_helper.rb +28 -9
- data/spec/testcentricity/elements/button_spec.rb +18 -0
- data/spec/testcentricity/elements/checkbox_spec.rb +28 -0
- data/spec/testcentricity/elements/image_spec.rb +13 -0
- data/spec/testcentricity/elements/label_spec.rb +18 -0
- data/spec/testcentricity/elements/list_spec.rb +13 -0
- data/spec/testcentricity/elements/ui_element_spec.rb +72 -0
- data/spec/testcentricity/mobile/appium_connect_spec.rb +117 -0
- data/spec/testcentricity/mobile/screen_object_spec.rb +63 -0
- data/spec/testcentricity/mobile/screen_section_object_spec.rb +56 -0
- data/spec/testcentricity/version_spec.rb +7 -0
- data/spec/testcentricity/web/browser_spec.rb +41 -0
- data/spec/testcentricity/web/local_webdriver_spec.rb +86 -0
- data/spec/testcentricity/web/mobile_webdriver_spec.rb +123 -0
- data/spec/testcentricity/web/page_object_spec.rb +85 -0
- data/spec/testcentricity/web/page_section_object_spec.rb +72 -0
- data/testcentricity.gemspec +28 -27
- metadata +196 -127
- data/.ruby-gemset +0 -1
- data/Gemfile.lock +0 -93
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/devices/devices.yml +0 -352
- data/lib/testcentricity/app_core/appium_server.rb +0 -69
- data/lib/testcentricity/browser_helper.rb +0 -174
- data/lib/testcentricity/data_objects/data_objects_helper.rb +0 -78
- data/lib/testcentricity/data_objects/excel_helper.rb +0 -242
- data/lib/testcentricity/exception_queue_helper.rb +0 -111
- data/lib/testcentricity/utility_helpers.rb +0 -28
- data/lib/testcentricity/web_core/drag_drop_helper.rb +0 -15
- data/lib/testcentricity/web_core/page_objects_helper.rb +0 -677
- data/lib/testcentricity/web_core/page_sections_helper.rb +0 -895
- data/lib/testcentricity/web_core/webdriver_helper.rb +0 -588
- data/lib/testcentricity/web_elements/button.rb +0 -8
- data/lib/testcentricity/web_elements/cell_button.rb +0 -8
- data/lib/testcentricity/web_elements/cell_checkbox.rb +0 -38
- data/lib/testcentricity/web_elements/cell_element.rb +0 -69
- data/lib/testcentricity/web_elements/cell_image.rb +0 -8
- data/lib/testcentricity/web_elements/cell_radio.rb +0 -31
- data/lib/testcentricity/web_elements/checkbox.rb +0 -100
- data/lib/testcentricity/web_elements/file_field.rb +0 -45
- data/lib/testcentricity/web_elements/image.rb +0 -34
- data/lib/testcentricity/web_elements/label.rb +0 -8
- data/lib/testcentricity/web_elements/link.rb +0 -8
- data/lib/testcentricity/web_elements/list.rb +0 -100
- data/lib/testcentricity/web_elements/list_button.rb +0 -8
- data/lib/testcentricity/web_elements/list_checkbox.rb +0 -38
- data/lib/testcentricity/web_elements/list_element.rb +0 -61
- data/lib/testcentricity/web_elements/list_radio.rb +0 -31
- data/lib/testcentricity/web_elements/radio.rb +0 -74
- data/lib/testcentricity/web_elements/select_list.rb +0 -208
- data/lib/testcentricity/web_elements/siebel_open_ui_helper.rb +0 -15
- data/lib/testcentricity/web_elements/table.rb +0 -612
- data/lib/testcentricity/web_elements/textfield.rb +0 -114
- data/lib/testcentricity/web_elements/ui_elements_helper.rb +0 -532
- data/lib/testcentricity/world_extensions.rb +0 -26
- data/my_templates/default/method_details/setup.rb +0 -3
- data/spec/testcentricity_spec.rb +0 -9
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe TestCentricity::Browsers, web: true do
|
4
|
+
before(:context) do
|
5
|
+
# instantiate local test environment
|
6
|
+
@environs ||= EnvironData
|
7
|
+
@environs.find_environ('LOCAL', :yaml)
|
8
|
+
ENV['WEB_BROWSER'] = 'chrome_headless'
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'web browser with multiple tabs/windows' do
|
12
|
+
it 'returns number of browser windows/tabs' do
|
13
|
+
WebDriverConnect.initialize_web_driver
|
14
|
+
Capybara.current_session.open_new_window
|
15
|
+
Capybara.current_session.open_new_window
|
16
|
+
expect(Browsers.num_browser_instances).to eql 3
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'closes original browser instance' do
|
20
|
+
WebDriverConnect.initialize_web_driver
|
21
|
+
Capybara.current_session.open_new_window
|
22
|
+
Browsers.close_old_browser_instance
|
23
|
+
expect(Browsers.num_browser_instances).to eql 1
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'closes current browser instance' do
|
27
|
+
WebDriverConnect.initialize_web_driver
|
28
|
+
Capybara.current_session.open_new_window
|
29
|
+
Browsers.switch_to_new_browser_instance
|
30
|
+
Capybara.current_session.open_new_window
|
31
|
+
Browsers.close_current_browser_instance
|
32
|
+
expect(Browsers.num_browser_instances).to eql 2
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
after(:each) do
|
37
|
+
Browsers.close_all_browser_instances
|
38
|
+
Capybara.current_session.quit
|
39
|
+
Environ.session_state = :quit
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe TestCentricity::WebDriverConnect, web: true do
|
4
|
+
before(:context) do
|
5
|
+
# instantiate local test environment
|
6
|
+
@environs ||= EnvironData
|
7
|
+
@environs.find_environ('LOCAL', :yaml)
|
8
|
+
ENV['SELENIUM'] = ''
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'local web browser instances' do
|
12
|
+
it 'connects to a local Firefox browser' do
|
13
|
+
ENV['WEB_BROWSER'] = 'firefox'
|
14
|
+
WebDriverConnect.initialize_web_driver
|
15
|
+
verify_local_browser(browser = :firefox, platform = :desktop, headless = false)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'connects to a local Safari browser' do
|
19
|
+
ENV['WEB_BROWSER'] = 'safari'
|
20
|
+
WebDriverConnect.initialize_web_driver
|
21
|
+
verify_local_browser(browser = :safari, platform = :desktop, headless = false)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'connects to a local Chrome browser' do
|
25
|
+
ENV['WEB_BROWSER'] = 'chrome'
|
26
|
+
WebDriverConnect.initialize_web_driver
|
27
|
+
Browsers.suppress_js_leave_page_modal
|
28
|
+
verify_local_browser(browser = :chrome, platform = :desktop, headless = false)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'connects to a local Edge browser' do
|
32
|
+
ENV['WEB_BROWSER'] = 'edge'
|
33
|
+
WebDriverConnect.initialize_web_driver
|
34
|
+
Browsers.suppress_js_alerts
|
35
|
+
verify_local_browser(browser = :edge, platform = :desktop, headless = false)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'connects to a local emulated mobile web browser' do
|
39
|
+
ENV['WEB_BROWSER'] = 'ipad_pro_12_9'
|
40
|
+
ENV['HOST_BROWSER'] = 'chrome'
|
41
|
+
ENV['ORIENTATION'] = 'portrait'
|
42
|
+
WebDriverConnect.initialize_web_driver
|
43
|
+
Browsers.set_device_orientation('landscape')
|
44
|
+
verify_local_browser(browser = :ipad_pro_12_9, platform = :mobile, headless = false)
|
45
|
+
expect(Environ.browser_size).to eq([1366, 1024])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'local headless browser instances' do
|
50
|
+
it 'connects to a local headless Chrome browser' do
|
51
|
+
ENV['WEB_BROWSER'] = 'chrome_headless'
|
52
|
+
WebDriverConnect.initialize_web_driver
|
53
|
+
Browsers.maximize_browser
|
54
|
+
verify_local_browser(browser = :chrome_headless, platform = :desktop, headless = true)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'connects to a local headless Edge browser' do
|
58
|
+
ENV['WEB_BROWSER'] = 'edge_headless'
|
59
|
+
WebDriverConnect.initialize_web_driver
|
60
|
+
Browsers.refresh_browser
|
61
|
+
verify_local_browser(browser = :edge_headless, platform = :desktop, headless = true)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'connects to a local headless Firefox browser' do
|
65
|
+
ENV['WEB_BROWSER'] = 'firefox_headless'
|
66
|
+
WebDriverConnect.initialize_web_driver
|
67
|
+
Browsers.delete_all_cookies
|
68
|
+
verify_local_browser(browser = :firefox_headless, platform = :desktop, headless = true)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
after(:each) do
|
73
|
+
Capybara.current_session.quit
|
74
|
+
Environ.session_state = :quit
|
75
|
+
end
|
76
|
+
|
77
|
+
def verify_local_browser(browser, platform, headless)
|
78
|
+
expect(Environ.browser).to eq(browser)
|
79
|
+
expect(Environ.platform).to eq(platform)
|
80
|
+
expect(Environ.headless).to eq(headless)
|
81
|
+
expect(Environ.session_state).to eq(:running)
|
82
|
+
expect(Environ.driver).to eq(:webdriver)
|
83
|
+
expect(Environ.device).to eq(:web)
|
84
|
+
expect(Environ.is_web?).to eq(true)
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe TestCentricity::WebDriverConnect, web: true do
|
4
|
+
before(:context) do
|
5
|
+
# instantiate local test environment
|
6
|
+
@environs ||= EnvironData
|
7
|
+
@environs.find_environ('LOCAL', :yaml)
|
8
|
+
ENV['SELENIUM'] = ''
|
9
|
+
ENV['WEB_BROWSER'] = 'appium'
|
10
|
+
ENV['DEVICE_TYPE'] = 'tablet'
|
11
|
+
# start Appium server
|
12
|
+
$server = TestCentricity::AppiumServer.new
|
13
|
+
$server.start
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'Mobile device simulator' do
|
17
|
+
it 'connects to iOS Simulator - environment variables' do
|
18
|
+
ENV['AUTOMATION_ENGINE'] = 'XCUITest'
|
19
|
+
ENV['APP_PLATFORM_NAME'] = 'ios'
|
20
|
+
ENV['APP_BROWSER'] = 'Safari'
|
21
|
+
ENV['APP_VERSION'] = '15.4'
|
22
|
+
ENV['APP_DEVICE'] = 'iPad Pro (12.9-inch) (5th generation)'
|
23
|
+
WebDriverConnect.initialize_web_driver
|
24
|
+
expect(Environ.browser).to eq(:appium)
|
25
|
+
expect(Environ.platform).to eq(:mobile)
|
26
|
+
expect(Environ.headless).to eq(false)
|
27
|
+
expect(Environ.session_state).to eq(:running)
|
28
|
+
expect(Environ.driver).to eq(:appium)
|
29
|
+
expect(Environ.device).to eq(:simulator)
|
30
|
+
expect(Environ.device_name).to eq('iPad Pro (12.9-inch) (5th generation)')
|
31
|
+
expect(Environ.device_os).to eq(:ios)
|
32
|
+
expect(Environ.device_type).to eq(:tablet)
|
33
|
+
expect(Environ.device_os_version).to eq('15.4')
|
34
|
+
expect(Environ.is_ios?).to eq(true)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'connects to iOS Simulator - desired_capabilities hash' do
|
38
|
+
ENV['APP_PLATFORM_NAME'] = 'ios'
|
39
|
+
ENV['APP_BROWSER'] = 'Safari'
|
40
|
+
ENV['APP_VERSION'] = '15.4'
|
41
|
+
ENV['APP_DEVICE'] = 'iPad Pro (12.9-inch) (5th generation)'
|
42
|
+
|
43
|
+
caps = {
|
44
|
+
desired_capabilities: {
|
45
|
+
platformName: 'ios',
|
46
|
+
platformVersion: '15.4',
|
47
|
+
browserName: 'Safari',
|
48
|
+
deviceName: 'iPad Pro (12.9-inch) (5th generation)',
|
49
|
+
automationName: 'XCUITest'
|
50
|
+
}
|
51
|
+
}
|
52
|
+
WebDriverConnect.initialize_web_driver(caps)
|
53
|
+
expect(Environ.browser).to eq(:appium)
|
54
|
+
expect(Environ.platform).to eq(:mobile)
|
55
|
+
expect(Environ.headless).to eq(false)
|
56
|
+
expect(Environ.session_state).to eq(:running)
|
57
|
+
expect(Environ.driver).to eq(:appium)
|
58
|
+
expect(Environ.device).to eq(:simulator)
|
59
|
+
expect(Environ.device_name).to eq('iPad Pro (12.9-inch) (5th generation)')
|
60
|
+
expect(Environ.device_os).to eq(:ios)
|
61
|
+
expect(Environ.device_type).to eq(:tablet)
|
62
|
+
expect(Environ.device_os_version).to eq('15.4')
|
63
|
+
expect(Environ.is_ios?).to eq(true)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'connects to Android Simulator - environment variables' do
|
67
|
+
ENV['APP_PLATFORM_NAME'] = 'Android'
|
68
|
+
ENV['APP_BROWSER'] = 'Chrome'
|
69
|
+
ENV['APP_VERSION'] = '12.0'
|
70
|
+
ENV['APP_DEVICE'] = 'Pixel_C_API_31'
|
71
|
+
WebDriverConnect.initialize_web_driver
|
72
|
+
expect(Environ.browser).to eq(:appium)
|
73
|
+
expect(Environ.platform).to eq(:mobile)
|
74
|
+
expect(Environ.headless).to eq(false)
|
75
|
+
expect(Environ.session_state).to eq(:running)
|
76
|
+
expect(Environ.driver).to eq(:appium)
|
77
|
+
expect(Environ.device).to eq(:simulator)
|
78
|
+
expect(Environ.device_name).to eq('Pixel_C_API_31')
|
79
|
+
expect(Environ.device_os).to eq(:android)
|
80
|
+
expect(Environ.device_type).to eq(:tablet)
|
81
|
+
expect(Environ.device_os_version).to eq('12.0')
|
82
|
+
expect(Environ.is_android?).to eq(true)
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'connects to Android Simulator - desired_capabilities hash' do
|
86
|
+
ENV['APP_PLATFORM_NAME'] = 'Android'
|
87
|
+
ENV['APP_BROWSER'] = 'Chrome'
|
88
|
+
ENV['APP_VERSION'] = '12.0'
|
89
|
+
ENV['APP_DEVICE'] = 'Pixel_C_API_31'
|
90
|
+
|
91
|
+
caps = {
|
92
|
+
desired_capabilities: {
|
93
|
+
platformName: 'Android',
|
94
|
+
platformVersion: '12.0',
|
95
|
+
browserName: 'Chrome',
|
96
|
+
deviceName: 'Pixel_C_API_31',
|
97
|
+
automationName: 'Android'
|
98
|
+
}
|
99
|
+
}
|
100
|
+
WebDriverConnect.initialize_web_driver(caps)
|
101
|
+
expect(Environ.browser).to eq(:appium)
|
102
|
+
expect(Environ.platform).to eq(:mobile)
|
103
|
+
expect(Environ.headless).to eq(false)
|
104
|
+
expect(Environ.session_state).to eq(:running)
|
105
|
+
expect(Environ.driver).to eq(:appium)
|
106
|
+
expect(Environ.device).to eq(:simulator)
|
107
|
+
expect(Environ.device_name).to eq('Pixel_C_API_31')
|
108
|
+
expect(Environ.device_os).to eq(:android)
|
109
|
+
expect(Environ.device_type).to eq(:tablet)
|
110
|
+
expect(Environ.device_os_version).to eq('12.0')
|
111
|
+
expect(Environ.is_android?).to eq(true)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
after(:each) do
|
116
|
+
Capybara.current_session.quit
|
117
|
+
Environ.session_state = :quit
|
118
|
+
end
|
119
|
+
|
120
|
+
after(:context) do
|
121
|
+
$server.stop if Environ.driver == :appium && $server.running?
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe TestCentricity::PageObject, web: true do
|
4
|
+
before :context do
|
5
|
+
@test_page = TestPage.new
|
6
|
+
end
|
7
|
+
|
8
|
+
context 'page object traits' do
|
9
|
+
it 'returns page name' do
|
10
|
+
expect(@test_page.page_name).to eq('Basic Test Page')
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns page url' do
|
14
|
+
expect(@test_page.page_url).to eq('/basic_test_page.html')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'returns page locator' do
|
18
|
+
expect(@test_page.page_locator).to eq('form#HTMLFormElements')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'determines if page is secure' do
|
22
|
+
allow(@test_page).to receive(:secure?).and_return(false)
|
23
|
+
expect(@test_page.secure?).to eq(false)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should display the title of the page' do
|
27
|
+
allow(@test_page).to receive(:title).and_return('I am the title of a page')
|
28
|
+
expect(@test_page.title).to eql 'I am the title of a page'
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'responds to open_portal' do
|
32
|
+
expect(@test_page).to respond_to(:open_portal)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'responds to load_page' do
|
36
|
+
expect(@test_page).to respond_to(:load_page)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'responds to verify_page_exists' do
|
40
|
+
expect(@test_page).to respond_to(:verify_page_exists)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'responds to exists?' do
|
44
|
+
expect(@test_page).to respond_to(:exists?)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'page object with UI elements' do
|
49
|
+
it 'responds to element' do
|
50
|
+
expect(@test_page).to respond_to(:element1)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'responds to button' do
|
54
|
+
expect(@test_page).to respond_to(:button1)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'responds to textfield' do
|
58
|
+
expect(@test_page).to respond_to(:field1)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'responds to link' do
|
62
|
+
expect(@test_page).to respond_to(:link1)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'responds to range' do
|
66
|
+
expect(@test_page).to respond_to(:range1)
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'responds to image' do
|
70
|
+
expect(@test_page).to respond_to(:image1)
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'responds to radio' do
|
74
|
+
expect(@test_page).to respond_to(:radio1)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'responds to checkbox' do
|
78
|
+
expect(@test_page).to respond_to(:check1)
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'responds to section' do
|
82
|
+
expect(@test_page).to respond_to(:section1)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe TestCentricity::PageSection, web: true do
|
4
|
+
before :context do
|
5
|
+
@test_page = TestPage.new
|
6
|
+
@test_section = @test_page.section1
|
7
|
+
end
|
8
|
+
|
9
|
+
context 'section object traits' do
|
10
|
+
it 'returns section name' do
|
11
|
+
expect(@test_section.section_name).to eq('Basic Test Section')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'returns section locator' do
|
15
|
+
expect(@test_section.get_locator).to eq('div#section')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'returns class' do
|
19
|
+
expect(@test_section.class).to eql TestPageSection
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'returns css locator type' do
|
23
|
+
expect(@test_section.get_locator_type).to eql :css
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'registers with type section' do
|
27
|
+
expect(@test_section.get_object_type).to eql :section
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'returns parent list object' do
|
31
|
+
expect(@test_section.get_parent_list).to eql nil
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'section object with UI elements' do
|
36
|
+
it 'responds to element' do
|
37
|
+
expect(@test_section).to respond_to(:element1)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'responds to button' do
|
41
|
+
expect(@test_section).to respond_to(:button1)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'responds to textfield' do
|
45
|
+
expect(@test_section).to respond_to(:field1)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'responds to link' do
|
49
|
+
expect(@test_section).to respond_to(:link1)
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'responds to range' do
|
53
|
+
expect(@test_section).to respond_to(:range1)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'responds to image' do
|
57
|
+
expect(@test_section).to respond_to(:image1)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'responds to radio' do
|
61
|
+
expect(@test_section).to respond_to(:radio1)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'responds to checkbox' do
|
65
|
+
expect(@test_section).to respond_to(:check1)
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'responds to section' do
|
69
|
+
expect(@test_section).to respond_to(:section2)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
data/testcentricity.gemspec
CHANGED
@@ -7,41 +7,42 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'testcentricity'
|
8
8
|
spec.version = TestCentricity::VERSION
|
9
9
|
spec.platform = Gem::Platform::RUBY
|
10
|
-
spec.required_ruby_version = '>= 2.
|
10
|
+
spec.required_ruby_version = '>= 2.7.5'
|
11
11
|
spec.authors = ['A.J. Mrozinski']
|
12
12
|
spec.email = ['testcentricity@gmail.com']
|
13
|
-
spec.summary = %q{A Page Object
|
14
|
-
spec.description =
|
15
|
-
The TestCentricity™ core
|
16
|
-
for use with Cucumber,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
spec.
|
23
|
-
|
13
|
+
spec.summary = %q{A Page Object Model Framework for desktop/mobile web and native mobile app testing}
|
14
|
+
spec.description = '
|
15
|
+
The TestCentricity™ core framework for native mobile iOS and Android apps and desktop/mobile web testing implements a Page Object
|
16
|
+
Model DSL for use with Cucumber, Appium, Capybara, and Selenium-Webdriver v4.x. The gem also facilitates the configuration of the
|
17
|
+
appropriate Appium capabilities required to establish a connection with locally or cloud (using BrowserStack, Sauce Labs, or
|
18
|
+
TestingBot services) hosted iOS or Android devices or simulators. For more information on desktop/mobile web testing with this
|
19
|
+
gem, refer to docs for the TestCentricity™ Web gem (https://www.rubydoc.info/gems/testcentricity_web).'
|
20
|
+
spec.homepage = 'https://github.com/TestCentricity/testcentricity'
|
21
|
+
spec.license = 'BSD-3-Clause'
|
22
|
+
spec.metadata = {
|
23
|
+
'changelog_uri' => 'https://github.com/TestCentricity/testcentricity/blob/master/CHANGELOG.md',
|
24
|
+
'documentation_uri' => 'https://www.rubydoc.info/gems/testcentricity'
|
25
|
+
}
|
24
26
|
|
25
27
|
spec.files = `git ls-files -z`.split("\x0")
|
26
28
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
27
29
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
28
30
|
spec.require_paths = ['lib']
|
29
|
-
spec.requirements << '
|
31
|
+
spec.requirements << 'Appium, TestCentricity Web'
|
30
32
|
|
31
|
-
spec.add_development_dependency 'bundler'
|
33
|
+
spec.add_development_dependency 'bundler'
|
34
|
+
spec.add_development_dependency 'cucumber'
|
35
|
+
spec.add_development_dependency 'cuke_modeler', '~> 3.0'
|
36
|
+
spec.add_development_dependency 'curb'
|
37
|
+
spec.add_development_dependency 'json'
|
38
|
+
spec.add_development_dependency 'parallel_tests'
|
32
39
|
spec.add_development_dependency 'rake'
|
40
|
+
spec.add_development_dependency 'require_all', '=1.5.0'
|
41
|
+
spec.add_development_dependency 'rspec', '~> 3.10'
|
42
|
+
spec.add_development_dependency 'simplecov', ['~> 0.18']
|
43
|
+
spec.add_development_dependency 'yard', ['>= 0.9.0']
|
33
44
|
|
34
|
-
spec.
|
35
|
-
spec.
|
36
|
-
spec.
|
37
|
-
spec.add_dependency 'poltergeist'
|
38
|
-
spec.add_dependency 'faker'
|
39
|
-
spec.add_dependency 'chronic', '0.10.2'
|
40
|
-
spec.add_dependency 'spreadsheet', '1.1.1'
|
41
|
-
spec.add_dependency 'os'
|
42
|
-
spec.add_dependency 'i18n'
|
43
|
-
spec.add_dependency 'browserstack-local'
|
44
|
-
spec.add_dependency 'appium_lib'
|
45
|
-
|
46
|
-
spec.add_runtime_dependency 'childprocess', '~> 0.5'
|
45
|
+
spec.add_runtime_dependency 'appium_lib'
|
46
|
+
spec.add_runtime_dependency 'testcentricity_web', '>= 4.2.2'
|
47
|
+
spec.add_runtime_dependency 'test-unit'
|
47
48
|
end
|