testcentricity_web 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -26
- data/lib/devices/devices.yml +12 -0
- data/lib/testcentricity_web/elements/table.rb +32 -3
- data/lib/testcentricity_web/page_objects_helper.rb +18 -6
- data/lib/testcentricity_web/page_sections_helper.rb +12 -0
- data/lib/testcentricity_web/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91f0b5045b977407a488bae9a7d36c3a5815b1db
|
4
|
+
data.tar.gz: a3535368c390c06fe12fb8c0b5259df72a66f76f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b59dfa190668a3ebc34ceba101b60808658c31994b1d52e7217f1a9d008facc2f6bc10f9114daa912b1391362944d41f4a650b61806791be9759d2d72a0f6c6
|
7
|
+
data.tar.gz: dcde6b5b17af37c6dd729a3d78db63d48942e218324f904f6626fd1b250f3ce3f090fe4ac38a1166e81a4e1a8f1df91ff1a99cb83679a717bb9a0bcd6c0e3866
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ The TestCentricity™ Web gem supports running automated tests against the follo
|
|
13
13
|
* a "headless" browser (using Poltergeist and PhantomJS)
|
14
14
|
* mobile Safari browsers on iOS device simulators (using Appium and XCode on OS X)
|
15
15
|
* cloud hosted desktop or mobile web browsers using the [Browserstack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate),
|
16
|
-
[Sauce Labs](https://saucelabs.com/
|
16
|
+
[Sauce Labs](https://saucelabs.com/open-source#automated-testing-platform), [CrossBrowserTesting](https://crossbrowsertesting.com/selenium-testing), or
|
17
17
|
[TestingBot](https://testingbot.com/features) services.
|
18
18
|
|
19
19
|
|
@@ -538,31 +538,33 @@ on OS X or Windows. The specified mobile browser's user agent, CSS screen dimens
|
|
538
538
|
within the local Firefox or Chrome browser instance. You may even specify the emulated device's screen orientation. For locally hosted emulated
|
539
539
|
mobile web browsers, the `WEB_BROWSER` Environment Variable must be set to one of the values from the table below:
|
540
540
|
|
541
|
-
`WEB_BROWSER`
|
542
|
-
|
543
|
-
`ipad`
|
544
|
-
`ipad_pro`
|
545
|
-
`android_tablet`
|
546
|
-
`kindle_fire`
|
547
|
-
`kindle_firehd7`
|
548
|
-
`kindle_firehd8`
|
549
|
-
`surface`
|
550
|
-
`blackberry_playbook` |`firefox` or `chrome` |1024 x 600|landscape
|
551
|
-
`samsung_galaxy_tab` |`firefox` or `chrome` |1280 x 800|landscape
|
552
|
-
`google_nexus7` |`firefox` or `chrome` |960 x 600|landscape
|
553
|
-
`google_nexus9` |`firefox` or `chrome` |1024 x 768|landscape
|
554
|
-
`google_nexus10` |`firefox` or `chrome` |1280 x 800|landscape
|
555
|
-
`iphone`
|
556
|
-
`iphone4`
|
557
|
-
`iphone5`
|
558
|
-
`iphone6`
|
559
|
-
`iphone6_plus`
|
560
|
-
`
|
561
|
-
`
|
562
|
-
`
|
563
|
-
`
|
564
|
-
`
|
565
|
-
`
|
541
|
+
`WEB_BROWSER` | `HOST_BROWSER` | **CSS Screen Dimensions** | **Default Orientation** | **OS Version**
|
542
|
+
----------------------|----------------------|-----------|----------|---------
|
543
|
+
`ipad` |`firefox` or `chrome` |1024 x 768 |landscape |iOS 9.1
|
544
|
+
`ipad_pro` |`firefox` or `chrome` |1366 x 1024|landscape |iOS 9.1
|
545
|
+
`android_tablet` |`firefox` or `chrome` |1024 x 768 |landscape |Android 3.0
|
546
|
+
`kindle_fire` |`firefox` or `chrome` |1024 x 600 |landscape |
|
547
|
+
`kindle_firehd7` |`firefox` or `chrome` |800 x 480 |landscape |Fire OS 3
|
548
|
+
`kindle_firehd8` |`firefox` or `chrome` |1280 x 800 |landscape |Fire OS 5
|
549
|
+
`surface` |`firefox` or `chrome` |1366 x 768 |landscape |
|
550
|
+
`blackberry_playbook` |`firefox` or `chrome` |1024 x 600 |landscape |BlackBerry Tablet OS
|
551
|
+
`samsung_galaxy_tab` |`firefox` or `chrome` |1280 x 800 |landscape |Android 4.0.4
|
552
|
+
`google_nexus7` |`firefox` or `chrome` |960 x 600 |landscape |Android 4.4.4
|
553
|
+
`google_nexus9` |`firefox` or `chrome` |1024 x 768 |landscape |Android 5.1
|
554
|
+
`google_nexus10` |`firefox` or `chrome` |1280 x 800 |landscape |Android 5.1
|
555
|
+
`iphone` |`firefox` or `chrome` |320 x 480 |portrait |iOS 9.1
|
556
|
+
`iphone4` |`firefox` or `chrome` |320 x 480 |portrait |iOS 9.1
|
557
|
+
`iphone5` |`firefox` or `chrome` |320 x 568 |portrait |iOS 9.1
|
558
|
+
`iphone6` |`firefox` or `chrome` |375 x 667 |portrait |iOS 9.1
|
559
|
+
`iphone6_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 9.1
|
560
|
+
`iphone7` |`firefox` or `chrome` |375 x 667 |portrait |iOS 10
|
561
|
+
`iphone7_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 10
|
562
|
+
`android_phone` |`firefox` or `chrome` |320 x 480 |portrait |Android 4.0.1
|
563
|
+
`nexus6` |`firefox` or `chrome` |411 x 731 |portrait |Android 6.0.1
|
564
|
+
`windows_phone7` |`firefox` or `chrome` |320 x 480 |portrait |Windows Phone OS 7.5
|
565
|
+
`windows_phone8` |`firefox` or `chrome` |320 x 480 |portrait |Windows Phone OS 8.0
|
566
|
+
`blackberry_z10` |`firefox` or `chrome` |384 x 640 |portrait |BlackBerry 10 OS
|
567
|
+
`blackberry_z30` |`firefox` or `chrome` |360 x 640 |portrait |BlackBerry 10 OS
|
566
568
|
|
567
569
|
To change the emulated device's screen orientation from the default setting, set the `ORIENTATION` Environment Variable to either `portrait` or `landscape`.
|
568
570
|
|
@@ -767,6 +769,8 @@ replace the placeholder text with your user account and authorization code for t
|
|
767
769
|
iphone5: WEB_BROWSER=iphone5 HOST_BROWSER=firefox <%= mobile %>
|
768
770
|
iphone6: WEB_BROWSER=iphone6 HOST_BROWSER=firefox <%= mobile %>
|
769
771
|
iphone6_plus: WEB_BROWSER=iphone6_plus HOST_BROWSER=firefox <%= mobile %>
|
772
|
+
iphone7: WEB_BROWSER=iphone7 HOST_BROWSER=firefox <%= mobile %>
|
773
|
+
iphone7_plus: WEB_BROWSER=iphone7_plus HOST_BROWSER=firefox <%= mobile %>
|
770
774
|
android_phone: WEB_BROWSER=android_phone HOST_BROWSER=firefox <%= mobile %>
|
771
775
|
nexus6: WEB_BROWSER=nexus6 HOST_BROWSER=firefox <%= mobile %>
|
772
776
|
android_tablet: WEB_BROWSER=android_tablet HOST_BROWSER=firefox <%= mobile %>
|
data/lib/devices/devices.yml
CHANGED
@@ -28,6 +28,18 @@
|
|
28
28
|
:css_height: 736
|
29
29
|
:default_orientation: portrait
|
30
30
|
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
|
31
|
+
:iphone7:
|
32
|
+
:name: "iPhone 7"
|
33
|
+
:css_width: 375
|
34
|
+
:css_height: 667
|
35
|
+
:default_orientation: portrait
|
36
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A345 Safari/602.1"
|
37
|
+
:iphone7_plus:
|
38
|
+
:name: "iPhone 7 Plus"
|
39
|
+
:css_width: 414
|
40
|
+
:css_height: 736
|
41
|
+
:default_orientation: portrait
|
42
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A345 Safari/602.1"
|
31
43
|
:android_phone:
|
32
44
|
:name: "Generic Android phone"
|
33
45
|
:css_width: 320
|
@@ -281,6 +281,35 @@ module TestCentricity
|
|
281
281
|
clear_alt_locator
|
282
282
|
end
|
283
283
|
|
284
|
+
def get_cell_attribute(row, column, attrib)
|
285
|
+
row_count = get_row_count
|
286
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{@locator}" if row > row_count
|
287
|
+
column_count = get_column_count
|
288
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{@locator}" if column > column_count
|
289
|
+
set_table_cell_locator(row, column)
|
290
|
+
result = get_native_attribute(attrib)
|
291
|
+
clear_alt_locator
|
292
|
+
result
|
293
|
+
end
|
294
|
+
|
295
|
+
def get_row_attribute(row, attrib)
|
296
|
+
row_count = get_row_count
|
297
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{@locator}" if row > row_count
|
298
|
+
(row > 1) ?
|
299
|
+
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}[#{row}]") :
|
300
|
+
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}")
|
301
|
+
result = get_native_attribute(attrib)
|
302
|
+
clear_alt_locator
|
303
|
+
result
|
304
|
+
end
|
305
|
+
|
306
|
+
def find_row_attribute(attrib, search_value)
|
307
|
+
(1..get_row_count).each do |row|
|
308
|
+
return row if get_row_attribute(row, attrib) == search_value
|
309
|
+
end
|
310
|
+
nil
|
311
|
+
end
|
312
|
+
|
284
313
|
# Search for the specified text value in the specified row of the table object.
|
285
314
|
# Returns the number of the first column that contains the search value.
|
286
315
|
#
|
@@ -288,7 +317,7 @@ module TestCentricity
|
|
288
317
|
# @param search_value [String] value to be searched for
|
289
318
|
# @return [Integer] column number of table cell that contains search value
|
290
319
|
# @example
|
291
|
-
#
|
320
|
+
# bom_table.find_in_table_row(4, 'High-speed Framus bolts')
|
292
321
|
#
|
293
322
|
def find_in_table_row(row, search_value)
|
294
323
|
(1..get_column_count).each do |column|
|
@@ -304,7 +333,7 @@ module TestCentricity
|
|
304
333
|
# @param search_value [String] value to be searched for
|
305
334
|
# @return [Integer] row number of table cell that contains search value
|
306
335
|
# @example
|
307
|
-
#
|
336
|
+
# playlist_table.find_in_table_column(1, 'Ashes to Ashes')
|
308
337
|
#
|
309
338
|
def find_in_table_column(column, search_value)
|
310
339
|
(1..get_row_count).each do |row|
|
@@ -326,7 +355,7 @@ module TestCentricity
|
|
326
355
|
# 4 => 'MD',
|
327
356
|
# 5 => 'Family Practice'
|
328
357
|
# }
|
329
|
-
#
|
358
|
+
# clinicians_table.populate_table_row(3, data)
|
330
359
|
#
|
331
360
|
def populate_table_row(row, data)
|
332
361
|
wait_until_exists(2)
|
@@ -420,23 +420,35 @@ module TestCentricity
|
|
420
420
|
end
|
421
421
|
|
422
422
|
if state.is_a?(Hash) && state.length == 1
|
423
|
-
error_msg = "Expected #{ui_object.get_locator} #{property.to_s} property to
|
423
|
+
error_msg = "Expected #{ui_object.get_locator} #{property.to_s} property to"
|
424
424
|
state.each do |key, value|
|
425
425
|
case key
|
426
426
|
when :lt, :less_than
|
427
|
-
ExceptionQueue.enqueue_exception("#{error_msg} less than #{value} but found #{actual}") unless actual < value
|
427
|
+
ExceptionQueue.enqueue_exception("#{error_msg} be less than #{value} but found #{actual}") unless actual < value
|
428
428
|
when :lt_eq, :less_than_or_equal
|
429
|
-
ExceptionQueue.enqueue_exception("#{error_msg} less than or equal to #{value} but found #{actual}") unless actual <= value
|
429
|
+
ExceptionQueue.enqueue_exception("#{error_msg} be less than or equal to #{value} but found #{actual}") unless actual <= value
|
430
430
|
when :gt, :greater_than
|
431
|
-
ExceptionQueue.enqueue_exception("#{error_msg} greater than #{value} but found #{actual}") unless actual > value
|
431
|
+
ExceptionQueue.enqueue_exception("#{error_msg} be greater than #{value} but found #{actual}") unless actual > value
|
432
432
|
when :gt_eq, :greater_than_or_equal
|
433
|
-
ExceptionQueue.enqueue_exception("#{error_msg} greater than or equal to #{value} but found #{actual}") unless actual >= value
|
433
|
+
ExceptionQueue.enqueue_exception("#{error_msg} be greater than or equal to #{value} but found #{actual}") unless actual >= value
|
434
434
|
when :starts_with
|
435
435
|
ExceptionQueue.enqueue_exception("#{error_msg} start with '#{value}' but found #{actual}") unless actual.start_with?(value)
|
436
436
|
when :ends_with
|
437
437
|
ExceptionQueue.enqueue_exception("#{error_msg} end with '#{value}' but found #{actual}") unless actual.end_with?(value)
|
438
438
|
when :contains
|
439
439
|
ExceptionQueue.enqueue_exception("#{error_msg} contain '#{value}' but found #{actual}") unless actual.include?(value)
|
440
|
+
when :like, :is_like
|
441
|
+
actual_like = actual.gsub("\n", '')
|
442
|
+
actual_like = actual_like.gsub("\r", '')
|
443
|
+
actual_like = actual_like.gsub("\t", '')
|
444
|
+
actual_like = actual_like.gsub(' ', '')
|
445
|
+
actual_like = actual_like.downcase
|
446
|
+
expected = value.gsub("\n", '')
|
447
|
+
expected = expected.gsub("\r", '')
|
448
|
+
expected = expected.gsub("\t", '')
|
449
|
+
expected = expected.gsub(' ', '')
|
450
|
+
expected = expected.downcase
|
451
|
+
ExceptionQueue.enqueue_exception("#{error_msg} be like '#{value}' but found #{actual}") unless actual_like.include?(expected)
|
440
452
|
end
|
441
453
|
end
|
442
454
|
else
|
@@ -458,7 +470,7 @@ module TestCentricity
|
|
458
470
|
# last_name_field => 'Pumperknickle',
|
459
471
|
# gender_select => 'Female',
|
460
472
|
# dob_field => '11/18/1976',
|
461
|
-
# email_field => 'p.pumperknickle4876@
|
473
|
+
# email_field => 'p.pumperknickle4876@gmail.com',
|
462
474
|
# mailing_list_check => 'Yes'
|
463
475
|
# }
|
464
476
|
# populate_data_fields(data)
|
@@ -503,6 +503,18 @@ module TestCentricity
|
|
503
503
|
ExceptionQueue.enqueue_exception("#{error_msg} end with '#{value}' but found #{actual}") unless actual.end_with?(value)
|
504
504
|
when :contains
|
505
505
|
ExceptionQueue.enqueue_exception("#{error_msg} contain '#{value}' but found #{actual}") unless actual.include?(value)
|
506
|
+
when :like, :is_like
|
507
|
+
actual_like = actual.gsub("\n", '')
|
508
|
+
actual_like = actual_like.gsub("\r", '')
|
509
|
+
actual_like = actual_like.gsub("\t", '')
|
510
|
+
actual_like = actual_like.gsub(' ', '')
|
511
|
+
actual_like = actual_like.downcase
|
512
|
+
expected = value.gsub("\n", '')
|
513
|
+
expected = expected.gsub("\r", '')
|
514
|
+
expected = expected.gsub("\t", '')
|
515
|
+
expected = expected.gsub(' ', '')
|
516
|
+
expected = expected.downcase
|
517
|
+
ExceptionQueue.enqueue_exception("#{error_msg} be like '#{value}' but found #{actual}") unless actual_like.include?(expected)
|
506
518
|
end
|
507
519
|
end
|
508
520
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcentricity_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.J. Mrozinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|