testcentricity 3.0.2 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -0
  4. data/lib/testcentricity/app_core/appium_connect_helper.rb +1 -0
  5. data/lib/testcentricity/app_core/screen_section.rb +0 -1
  6. data/lib/testcentricity/app_elements/alert.rb +64 -0
  7. data/lib/testcentricity/app_elements/app_element_helper.rb +56 -13
  8. data/lib/testcentricity/version.rb +1 -1
  9. metadata +7 -165
  10. data/.gitignore +0 -40
  11. data/.rspec +0 -4
  12. data/.rubocop.yml +0 -38
  13. data/.ruby-version +0 -1
  14. data/.simplecov +0 -9
  15. data/CODE_OF_CONDUCT.md +0 -13
  16. data/Gemfile +0 -6
  17. data/Rakefile +0 -63
  18. data/config/cucumber.yml +0 -145
  19. data/config/locales/en-US.yml +0 -56
  20. data/config/test_data/LOCAL_data.yml +0 -11
  21. data/config/test_data/data.yml +0 -10
  22. data/features/deep_links.feature +0 -26
  23. data/features/login.feature +0 -30
  24. data/features/navigation.feature +0 -31
  25. data/features/step_definitions/generic_steps.rb +0 -72
  26. data/features/support/android/screens/about_screen.rb +0 -11
  27. data/features/support/android/screens/base_app_screen.rb +0 -29
  28. data/features/support/android/screens/checkout_address_screen.rb +0 -17
  29. data/features/support/android/screens/checkout_payment_screen.rb +0 -22
  30. data/features/support/android/screens/login_screen.rb +0 -18
  31. data/features/support/android/screens/products_screen.rb +0 -13
  32. data/features/support/android/screens/saucebot_screen.rb +0 -16
  33. data/features/support/android/screens/webview_screen.rb +0 -13
  34. data/features/support/android/sections/nav_widgets/nav_menu.rb +0 -39
  35. data/features/support/env.rb +0 -61
  36. data/features/support/hooks.rb +0 -135
  37. data/features/support/ios/screens/about_screen.rb +0 -11
  38. data/features/support/ios/screens/base_app_screen.rb +0 -19
  39. data/features/support/ios/screens/checkout_address_screen.rb +0 -17
  40. data/features/support/ios/screens/checkout_payment_screen.rb +0 -22
  41. data/features/support/ios/screens/login_screen.rb +0 -18
  42. data/features/support/ios/screens/products_screen.rb +0 -13
  43. data/features/support/ios/screens/saucebot_screen.rb +0 -16
  44. data/features/support/ios/screens/webview_screen.rb +0 -13
  45. data/features/support/ios/sections/list_items/product_cell_item.rb +0 -13
  46. data/features/support/ios/sections/modals/base_modal.rb +0 -23
  47. data/features/support/ios/sections/modals/logout_modal.rb +0 -6
  48. data/features/support/ios/sections/modals/reset_app_state_modal.rb +0 -6
  49. data/features/support/ios/sections/nav_widgets/nav_bar.rb +0 -31
  50. data/features/support/ios/sections/nav_widgets/nav_menu.rb +0 -41
  51. data/features/support/shared_components/screens/base_app_screen.rb +0 -31
  52. data/features/support/shared_components/screens/checkout_address_screen.rb +0 -17
  53. data/features/support/shared_components/screens/checkout_payment_screen.rb +0 -22
  54. data/features/support/shared_components/screens/login_screen.rb +0 -39
  55. data/features/support/shared_components/screens/saucebot_screen.rb +0 -17
  56. data/features/support/shared_components/screens/webview_screen.rb +0 -12
  57. data/features/support/shared_components/sections/nav_menu.rb +0 -58
  58. data/features/support/world_data.rb +0 -12
  59. data/features/support/world_pages.rb +0 -26
  60. data/reports/.keep +0 -1
  61. data/spec/fixtures/page_object.rb +0 -22
  62. data/spec/fixtures/page_section_object.rb +0 -21
  63. data/spec/fixtures/screen_object.rb +0 -16
  64. data/spec/fixtures/screen_section_object.rb +0 -16
  65. data/spec/spec_helper.rb +0 -33
  66. data/spec/testcentricity/elements/button_spec.rb +0 -18
  67. data/spec/testcentricity/elements/checkbox_spec.rb +0 -28
  68. data/spec/testcentricity/elements/image_spec.rb +0 -13
  69. data/spec/testcentricity/elements/label_spec.rb +0 -18
  70. data/spec/testcentricity/elements/list_spec.rb +0 -13
  71. data/spec/testcentricity/elements/ui_element_spec.rb +0 -72
  72. data/spec/testcentricity/mobile/appium_connect_spec.rb +0 -117
  73. data/spec/testcentricity/mobile/screen_object_spec.rb +0 -63
  74. data/spec/testcentricity/mobile/screen_section_object_spec.rb +0 -56
  75. data/spec/testcentricity/version_spec.rb +0 -7
  76. data/spec/testcentricity/web/browser_spec.rb +0 -41
  77. data/spec/testcentricity/web/local_webdriver_spec.rb +0 -86
  78. data/spec/testcentricity/web/mobile_webdriver_spec.rb +0 -123
  79. data/spec/testcentricity/web/page_object_spec.rb +0 -85
  80. data/spec/testcentricity/web/page_section_object_spec.rb +0 -72
  81. data/testcentricity.gemspec +0 -50
@@ -1,86 +0,0 @@
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
@@ -1,123 +0,0 @@
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
@@ -1,85 +0,0 @@
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
@@ -1,72 +0,0 @@
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
@@ -1,50 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'testcentricity/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'testcentricity'
8
- spec.version = TestCentricity::VERSION
9
- spec.platform = Gem::Platform::RUBY
10
- spec.required_ruby_version = '>= 2.7.5'
11
- spec.authors = ['A.J. Mrozinski']
12
- spec.email = ['testcentricity@gmail.com']
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
- }
26
-
27
- spec.files = `git ls-files -z`.split("\x0")
28
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
29
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
30
- spec.require_paths = ['lib']
31
- spec.requirements << 'Appium, TestCentricity Web'
32
-
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'
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']
44
-
45
- spec.add_runtime_dependency 'appium_lib'
46
- spec.add_runtime_dependency 'curb'
47
- spec.add_runtime_dependency 'json'
48
- spec.add_runtime_dependency 'testcentricity_web', '>= 4.2.2'
49
- spec.add_runtime_dependency 'test-unit'
50
- end