scoutui 2.0.4.0 → 2.0.4.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -4
  3. data/README.md +7 -0
  4. data/bin/scoutui_driver +1 -0
  5. data/examples/benchmark/ex.rb +16 -0
  6. data/examples/capabilities/win10.chrome46.json +6 -0
  7. data/examples/carmax/appmodel/search_results.json +27 -0
  8. data/examples/carmax/commands/commands.yml +63 -0
  9. data/examples/cmdshell/commands/hello.yml +22 -0
  10. data/examples/converters/jsonupdate.rb +31 -0
  11. data/examples/ex2/appmodel/common.json +51 -0
  12. data/examples/ex2/appmodel/page_model.json +106 -0
  13. data/examples/ex2/appmodel/register.model.json +42 -0
  14. data/examples/ex2/commands/commands.basic.appmodel.yml +8 -0
  15. data/examples/ex2/commands/commands.yml +115 -0
  16. data/examples/ex2/commands/ex1.yml +7 -0
  17. data/examples/ex2/commands/ex1c.yml +8 -0
  18. data/examples/ex2/commands/ex1d.yml +22 -0
  19. data/examples/ex2/commands/ex2.hover.yml +43 -0
  20. data/examples/ex2/commands/ex2.yml +24 -0
  21. data/examples/ex2/data.json +6 -0
  22. data/examples/ex2/test-configs/test.config.basic.json +12 -0
  23. data/examples/ex2/test-configs/test.config.json +31 -0
  24. data/examples/ex2/tests/run-test.sh +125 -0
  25. data/examples/ex2/tests/test-basic-appmodel.sh +14 -0
  26. data/examples/ex2/tests/test-example.sh +39 -0
  27. data/examples/ex2/tests/test-example1a.sh +16 -0
  28. data/examples/ex2/tests/test-example1b.sh +13 -0
  29. data/examples/ex2/tests/test-example1c.sh +15 -0
  30. data/examples/ex2/tests/test-example1d.sh +15 -0
  31. data/examples/ex2/tests/test-example2.forms.eyes.sh +40 -0
  32. data/examples/ex2/tests/test-example2.hover.eyes.sh +40 -0
  33. data/examples/ex2/tests/test-example2.hover.sh +26 -0
  34. data/examples/ex2/tests/test-example2.sh +43 -0
  35. data/examples/ex2/tests/test-example3.sauce.sh +77 -0
  36. data/examples/ex2/tests/test-example3.sh +41 -0
  37. data/examples/headless/run.sh +15 -0
  38. data/lib/scoutui/base/visual_test_framework.rb +2 -0
  39. data/lib/scoutui/commands/clauses/do_until.rb +4 -0
  40. data/lib/scoutui/commands/commands.rb +3 -0
  41. data/lib/scoutui/commands/exists_alert.rb +3 -0
  42. data/lib/scoutui/commands/jsalert/action_jsalert.rb +3 -0
  43. data/lib/scoutui/version.rb +1 -1
  44. data/scoutui.gemspec +3 -2
  45. metadata +57 -10
  46. data/lib/scoutui/base/q_har_mgr.rb +0 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34ed84007ef4998e7b2cc820d506924afd43cda3
4
- data.tar.gz: b2158277a8b948fff0289325448946a5cf7c1fbf
3
+ metadata.gz: b2d2f09a2924340e7d3f0d577346c925aeb526e5
4
+ data.tar.gz: 43d31a4618f0093a68415fafc1d49ea2a1d361f4
5
5
  SHA512:
6
- metadata.gz: c48105b8807085f336963b8975e43ab4d93f94b1c291ecdb4569fc6c6a1ac7d3a1355abd4752023c65ea0b3e9acae0cc9bfb8df66bb8d2e54f8581e9cd9ed5a2
7
- data.tar.gz: ce395f4c6c40dbc38ebd317f1d97f471f90ea3c05bafc992d57264f5e05324b36f71d616178885771e8556f1b7be99d4e2bbce16fd2a30370648796fcd39df49
6
+ metadata.gz: ac9c09c0791bdec5aff1c1c9f663ed4388b28bf6c7924f8fca9a99f1942695c3f209f308de909c64f4ef9bf3e9cf7d44117ef8122a319b0f594dedd37d1ace1b
7
+ data.tar.gz: a80e2fc72d615ad6610e5f02f70bddec2795481d56e3478da3e56fb0f89fdaf4a0d495e21465bbcbd171c762edc7a1a4d4b50afed71dd67c93702b648ce249ef
data/.gitignore CHANGED
@@ -4,9 +4,7 @@
4
4
  /_yardoc/
5
5
  /coverage/
6
6
  /doc/
7
- /pkg/
8
7
  /spec/reports/
8
+ /test/gateway
9
9
  /tmp/
10
- /.idea
11
- /.travis.yml
12
-
10
+ /test/travel
data/README.md CHANGED
@@ -59,6 +59,13 @@ To run unit tests:
59
59
  To run a specific unit test:
60
60
 
61
61
  $ rspec spec/json_spec.rb
62
+
63
+ To build:
64
+
65
+ $ bundle exec rake build
66
+
67
+ To push the build (gem)
68
+ $ gem push <gem file>
62
69
 
63
70
  ## Running the examples
64
71
 
@@ -0,0 +1 @@
1
+ scoutui_driver.rb
@@ -0,0 +1,16 @@
1
+
2
+
3
+
4
+ def foo(opts)
5
+
6
+ puts opts
7
+
8
+
9
+ end
10
+
11
+
12
+
13
+
14
+ foo(rover: 'Rover')
15
+
16
+
@@ -0,0 +1,6 @@
1
+ {
2
+ "platform": "Windows 10",
3
+ "browser": "chrome",
4
+ "version": "46.0",
5
+ "screenResolution": "1024x768"
6
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+
3
+
4
+ "search_results": {
5
+
6
+
7
+ "results": {
8
+
9
+ "header": {
10
+ "reqid": "REQ-HEADER",
11
+ "locator": "//span[text()='Applied filters']",
12
+ "visible_when": "title(Search Results)"
13
+ }
14
+
15
+
16
+ }
17
+
18
+
19
+
20
+ }
21
+
22
+
23
+
24
+
25
+
26
+
27
+ }
@@ -0,0 +1,63 @@
1
+ page:
2
+ name: Home
3
+ description: Navigate to a specified URL and wait until the expected elements are present
4
+ url: http://www.carmax.com
5
+ ---
6
+ page:
7
+ name: Highlight Example
8
+ action: highlight(page(main).get(nav).get(findYourCar))
9
+ ---
10
+ page:
11
+ timeout: 5
12
+ name: Click Find Your Car
13
+ action: click(page(main).get(nav).get(findYourCar))
14
+ expected:
15
+ wait1: //header//*[text()='Pricex']
16
+ ---
17
+ page:
18
+ name: Basic Search
19
+ timeout: 5
20
+ action: click(page(main).get(nav).get(basic_search))
21
+ expected:
22
+ wait: page(basic_search).get(free_text)
23
+ assertions: [
24
+ elvis: {
25
+ "locator": "//button[@text()='Go']",
26
+ "visible_when": "visible(page(basic_search).get(free_text))"
27
+ },
28
+ better_assert: {
29
+ "locator": "page(basic_search)"
30
+ }
31
+ ]
32
+ ---
33
+ page:
34
+ name: Popup
35
+ timeout: 5
36
+ execute_when: visible(//area[@alt='no'])
37
+ action: click(//area[@alt='no'])
38
+ ---
39
+ page:
40
+ name: Enter Porsche
41
+ action: type(page(basic_search).get(free_text), Porsche 911)
42
+ expected:
43
+ wait: //a[contains(@href, 'Porsche%20911')]
44
+ ---
45
+ page:
46
+ action: highlight(//a[contains(@href, 'Porsche%20911')])
47
+ ---
48
+ page:
49
+ action: mouseover(//a[contains(@href, 'Porsche%20911')])
50
+ ---
51
+ page:
52
+ action: click(page(basic_search).get(go))
53
+ assertions: [
54
+ assert1: {
55
+ "locator": "page(search_results).get(results)"
56
+ }
57
+ ]
58
+ ---
59
+ page:
60
+ name: Pause after Nav.
61
+ action: pause
62
+ skipit: false
63
+
@@ -0,0 +1,22 @@
1
+ page:
2
+ name: Assign my vars
3
+ action: assignments
4
+ vars:
5
+ - assign(MyEntity, ScoutUI)
6
+ ---
7
+ page:
8
+ name: Simple Cmd
9
+ id: MultiLs
10
+ action: defineCommand
11
+ commands: sed -e 's/domain/${MyEntity}/g' /tmp/userlist-v2.txt > /tmp/mydata.txt
12
+ ---
13
+ page:
14
+ name: Run Multi
15
+ action: executeCommands
16
+ commands:
17
+ - id: MultiLs
18
+ ---
19
+ page:
20
+ name: Pause afger MultiLs
21
+ action: pause
22
+ skip: false
@@ -0,0 +1,31 @@
1
+
2
+
3
+ def iterate(h)
4
+ h.each do |k, v|
5
+ if v.is_a?(Hash) || v.is_a?(Array)
6
+ iterate(v)
7
+ else
8
+ puts("k is #{k}, value is #{v}")
9
+ if v.match(/peter/i)
10
+ h[k]='Elvis'
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+
17
+ h={
18
+ 'person': {
19
+ 'first': 'Peter',
20
+ 'last': 'Kim',
21
+ 'address': {
22
+ 'city': 'Manhattan peter',
23
+ 'state': 'New York'
24
+ }
25
+ }
26
+ }
27
+
28
+
29
+ iterate(h)
30
+
31
+ puts "h => #{h}"
@@ -0,0 +1,51 @@
1
+ {
2
+
3
+ "basic_nav": {
4
+
5
+ "find_cars_for_sale": {
6
+ "locator": "//*[@id='header']//a[text()='Find Cars for Sale']",
7
+ "visible_when": "always"
8
+ },
9
+
10
+ "sell_us_your_car": {
11
+ "locator": "//*[@id='header']//a[text()='Sell Us Your Car']",
12
+ "visible_when": "title(Used Cars for Sale.*)"
13
+ },
14
+
15
+ "research": {
16
+ "locator": "//*[@id='header']//a[text()='Research']",
17
+ "when_hovered": [
18
+ { "RSRCH": [
19
+ "visible(//*[@id='header']//a[text()='Ratings and Reviews'])",
20
+ "visible(//*[@id='header']//a[text()='Payment Calculators'])",
21
+ "visible(page(submenu3).get(fuel_econ))"
22
+ ]
23
+ }
24
+ ]
25
+ }
26
+
27
+ },
28
+
29
+ "find_cars_for_sale_sm": {
30
+ "description": "Example of observer-like pattern, where an element registers itself to another elements action.",
31
+ "locator": "//*[@id='header']//a[text()='Nationwide Transfers']",
32
+ "visible_when": "mouseover(page(basic_nav).get(find_cars_for_sale))"
33
+ },
34
+
35
+ "submenu2": {
36
+
37
+ "faq": {
38
+ "locator": "//*[@id='header']//a[text()='FAQ']",
39
+ "visible_when": "mouseover(page(basic_nav).get(sell_us_your_car))"
40
+ }
41
+
42
+ },
43
+
44
+ "submenu3": {
45
+ "fuel_econ": {
46
+ "locator": "//*[@id='header']//a[text()='Payment Calculators']"
47
+ }
48
+ }
49
+
50
+
51
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "home": {
3
+ "cars4sale": {
4
+ "locator": "//a[text()='Find Cars for Sale']",
5
+ "visible_when": "always",
6
+ "reqid": "REQ-Home"
7
+ },
8
+ "whyCarMax": {
9
+ "locator": "//*[@id='header']//a[text()='Why CarMax']",
10
+ "visible_when": "text(page(home).get(cars4sale))=Find Cars for Sale",
11
+ "reqid": "REQ-Home"
12
+ },
13
+
14
+ "sign_in": {
15
+ "locator": "//input[text()='Sign in']",
16
+ "visible_when": "title(/Carmax.*online/)",
17
+ "reqid": "REQ-Home"
18
+ },
19
+
20
+ "register": {
21
+ "locator": "//*[@id='register']",
22
+ "reqid": "REQ-register",
23
+
24
+
25
+ "when_clicked": [
26
+ { "req-XYZ": "page(register_pg).get(firstname)" },
27
+ { "req-XYZ": "visible(page(register_pg).get(firstname))"},
28
+ {
29
+ "REGIS-002": [
30
+ "title(Register for MyCarMax)",
31
+ "visible(css=#signInLink)"
32
+ ]
33
+ }
34
+ ],
35
+
36
+
37
+ "visible_when": [
38
+ { "visible_when": "visible(page(home).get(sign_in))=true"},
39
+ { "visible_when": "visible(page(home).get(cars4sale))=true"},
40
+ { "visible_when": "visible(page(home).get(sign_in))=false"},
41
+ { "visible_when": "title(Car[mM]ax.*online)"}
42
+ ]
43
+ },
44
+
45
+ "mycarmax": {
46
+ "locator": "//*[@id='mycarmax']",
47
+ "visible_when": "title(CarMax - Browse used cars and new cars online)",
48
+ "reqid": "REQ-Home"
49
+ },
50
+
51
+ "logoff": {
52
+ "locator": "//*[text()='Log off']",
53
+ "visible_when": "never",
54
+ "reqid": "REQ-Home"
55
+ }
56
+ },
57
+
58
+
59
+ "register_pg": {
60
+ "firstname": {
61
+ "locator": "css=input#FirstName",
62
+ "visible_when": "title(Register for MyCarMax)"
63
+ },
64
+
65
+ "lastname": {
66
+ "locator": "//input[@id='LastName']",
67
+ "visible_when": "always"
68
+ }
69
+ },
70
+
71
+ "research": {
72
+
73
+ "fuel_economy": {
74
+ "locator": ""
75
+ }
76
+
77
+ },
78
+
79
+ "main_nav": {
80
+ "search_input": {
81
+ "locator": "//input[@id='search']",
82
+ "visible_when": "always"
83
+ },
84
+ "search_btn": {
85
+ "locator": "//a[@id='search-btn']",
86
+ "visible_when": "always"
87
+ }
88
+ },
89
+
90
+ "find_cars_by": {
91
+ "make": {
92
+ "locator": "//*[@id='bantab0']/a[contains(text(), 'Make')]",
93
+ "visible_when": "always"
94
+ },
95
+
96
+ "price_list": {
97
+ "locator": "//*[@id='minPriceFilter']",
98
+ "visible_when": "text(//*[@id='minPriceFilter'])=$0"
99
+ }
100
+ },
101
+
102
+ "search": {
103
+ "header": "//title"
104
+ }
105
+ }
106
+
@@ -0,0 +1,42 @@
1
+ {
2
+
3
+ "register": {
4
+
5
+ "error_msgs": {
6
+
7
+ "email": {
8
+ "reqid": "REQ:Email - is required",
9
+ "locator": "//*[@class='field-validation-error' and text()='Email is required.']",
10
+ "visible_when": "text(page(register).get(form).get(email))="
11
+
12
+ }
13
+ },
14
+
15
+ "form": {
16
+ "firstname": {
17
+ "locator": "//input[@id='FirstName']",
18
+ "visible_when": "always"
19
+ },
20
+
21
+ "lastname": {
22
+ "locator": "//input[@id='LastName']",
23
+ "visible_when": "always"
24
+ },
25
+
26
+ "email": {
27
+ "locator": "//input[@id='EmailAddress']",
28
+ "visible_when": "always"
29
+ },
30
+
31
+ "register_btn": {
32
+ "locator": "//input[@id='next']",
33
+ "visible_when": "visible(page(register).get(form).get(firstname))",
34
+ "action_object": true
35
+ }
36
+
37
+ }
38
+
39
+ }
40
+
41
+
42
+ }
@@ -0,0 +1,8 @@
1
+ page:
2
+ skip: false
3
+ name: Home
4
+ description: Navigate to a specified URL and wait until the expected elements are present
5
+ url: http://www.carmax.com
6
+ expected:
7
+ wait: page(main_nav).get(search_input)
8
+ wait2: page(main_nav).get(search_btn)
@@ -0,0 +1,115 @@
1
+ page:
2
+ reqid: Beta Page Loaded
3
+ execute_when: url(beta.carmax.com)
4
+ action: stop
5
+ ---
6
+ page:
7
+ reqid: Initial Load
8
+ url: http://www.carmax.com
9
+ expected:
10
+
11
+ ---
12
+ page:
13
+ reqid: Survey
14
+ description: Survey popup answered by Yes
15
+ execute_when: visible(//area[@alt='no'])
16
+ action: click(//area[@alt='no'])
17
+ ---
18
+ page:
19
+ name: Home
20
+ description: Navigate to a specified URL and wait until the expected elements are present
21
+ url: http://www.carmax.com
22
+ expected:
23
+ wait: page(home).get(cars4sale)
24
+ wait2: page(home).get(whyCarMax)
25
+ wait3: page(find_cars_by).get(make)
26
+ assertions: [
27
+ assert1: {
28
+ "locator": "page(find_cars_by).get(make)",
29
+ "visible_when": "always",
30
+ "reqid": "REQ-HOME"
31
+ },
32
+ assert2: {
33
+ "locator": "page(home).get(whyCarMax)",
34
+ "visible_when": "always"
35
+ },
36
+ assert3: {
37
+ "locator": "page(home)",
38
+ "reqid": "REQ-HOME2"
39
+ }
40
+ ]
41
+ ---
42
+ page:
43
+ name: Click on Make
44
+ action: click(page(find_cars_by).get(make))
45
+ expected:
46
+ wait: //div[contains(@class, 'open')]//a[text()='Porsche']
47
+ ---
48
+ page:
49
+ name: Select Porsche
50
+ action: click(//div[contains(@class, 'open')]//a[text()='${MyMake}'])
51
+ expected:
52
+ wait: //*[@id='Model']//*[text()='${MyMake}']
53
+ assertions: [
54
+ assert1: {
55
+ "locator": "page(find_cars_by).get(price_list)",
56
+
57
+ }
58
+ ]
59
+ ---
60
+ page:
61
+ name: Select the within Mileage List
62
+ action: click(//div[@id='selectedDistanceDesc'])
63
+ expected:
64
+ wait: //*[@id='distance']//a[text()='any distance']
65
+ ---
66
+ page:
67
+ name: Select Any Distance
68
+ action: click(//*[@id='distance']//a[text()='any distance'])
69
+ ---
70
+ page:
71
+ name: Enter Zipcode
72
+ action: type!(//*[@id='zip'], 94030)
73
+ ---
74
+ page:
75
+ name: Update Distance
76
+ action: click(//*[@id='distanceSubmit'])
77
+ expected:
78
+ wait: //*[@id='distance']//a[text()='any distance']
79
+ wait2: //*[@id='zip' and @value='94030']
80
+ ---
81
+ page:
82
+ action: pause
83
+ skip: true
84
+ ---
85
+ page:
86
+ name: Mouseover View Tickets
87
+ action: mouseover(page(home).get(whyCarMax))
88
+ snapit: true
89
+ ---
90
+ page:
91
+ name: Click - specified by Alias
92
+ action: click(${WhyCarMax})
93
+ snapit: true
94
+ ---
95
+ page:
96
+ skip: true
97
+ action: pause
98
+ ---
99
+ page:
100
+ skip: false
101
+ name: Click on Input
102
+ action: click(page(main_nav).get(search_input))
103
+ snapit: true
104
+ ---
105
+ page:
106
+ action: type(page(main_nav).get(search_input), ${Search_Me})
107
+ ---
108
+ page:
109
+ action: pause
110
+ skip: true
111
+ ---
112
+ page:
113
+ action: click(page(main_nav).get(search_btn))
114
+ expected:
115
+ wait: //input[@id='zip']
@@ -0,0 +1,7 @@
1
+ page:
2
+ reqid: MainPg-001
3
+ name: Home
4
+ description: Navigate to a specified URL and wait until the expected elements are present
5
+ url: http://www.carmax.com
6
+ expected:
7
+ wait: //*[@id='searchx']
@@ -0,0 +1,8 @@
1
+ page:
2
+ skip: false
3
+ reqid: MainPg-001
4
+ name: Home
5
+ description: Navigate to a specified URL and wait until the expected elements are present
6
+ url: http://www.carmax.com
7
+ expected:
8
+ wait: //*[@id='searchx']
@@ -0,0 +1,22 @@
1
+ page:
2
+ reqid: MainPg-001
3
+ name: Home
4
+ description: Navigate to a specified URL and wait until the expected elements are present
5
+ url: http://www.carmax.com
6
+ expected:
7
+ wait: //*[@id='search']
8
+ ---
9
+ page:
10
+ reqid: BETA_Loaded
11
+ description: Beta website is loaded.
12
+ execute_when: url(beta)
13
+ ---
14
+ page:
15
+ reqid: Survey
16
+ description: Survey popup answered by Yes
17
+ execute_when: visible(//area[@alt='no'])
18
+ action: click(//area[@alt='no'])
19
+ ---
20
+ page:
21
+ action: pause
22
+ skip: false
@@ -0,0 +1,43 @@
1
+ page:
2
+ name: Home
3
+ description: Navigate to a specified URL and wait until the expected elements are present
4
+ url: http://www.carmax.com
5
+ assertions: [
6
+ assert1: {
7
+ "locator": "page(find_cars_by).get(make)",
8
+ "visible_when": "never",
9
+ "reqid": "REQ-MAKE"
10
+ }
11
+ ]
12
+ ---
13
+ page:
14
+ name: Hover-Research
15
+ action: mouseover(page(basic_nav).get(research))
16
+ snapit: true
17
+ ---
18
+ page:
19
+ action: pause
20
+ skipit: true
21
+ ---
22
+ page:
23
+ name: Hover-Sell Your Car
24
+ snapit: true
25
+ action: mouseover(page(basic_nav).get(sell_us_your_car))
26
+ ---
27
+ page:
28
+ name: Hover-Find Your Car
29
+ action: mouseover(page(basic_nav).get(find_cars_for_sale))
30
+ snapit: true
31
+ ---
32
+ page:
33
+ name: Click Register
34
+ snapit: true
35
+ action: click(page(home).get(register))
36
+ ---
37
+ page:
38
+ reqid: Rover
39
+ action: verifyelement(page(register_pg))
40
+ ---
41
+ page:
42
+ action: pause
43
+ skip: false
@@ -0,0 +1,24 @@
1
+ page:
2
+ skip: false
3
+ name: Home
4
+ description: Navigate to a specified URL and wait until the expected elements are present
5
+ url: http://www.carmax.com
6
+ expected:
7
+ wait: page(home).get(cars4sale)
8
+ wait2: page(home).get(whyCarMax)
9
+ wait3: page(find_cars_by).get(make)
10
+ assertions: [
11
+ assert1: {
12
+ "locator": "page(find_cars_by).get(make)",
13
+ "visible_when": "never",
14
+ "reqid": "REQ-MAKE"
15
+ },
16
+ assert2: {
17
+ "locator": "page(home)",
18
+ "reqid": "REQ-HOME"
19
+ }
20
+ ]
21
+ ---
22
+ page:
23
+ action: pause
24
+ skip: false
@@ -0,0 +1,6 @@
1
+ {
2
+
3
+ "make": "porsche"
4
+
5
+
6
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "Project": "Example",
3
+ "Version": "1.00",
4
+ "Description": "Example - CarMax",
5
+
6
+ "browser": "chrome",
7
+
8
+ "host": "http://www.carmax.com",
9
+
10
+ "dut": ""
11
+ }
12
+