scoutui 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +71 -16
- data/bin/scoutui_driver.rb +22 -0
- data/examples/ex1/commands.yml +25 -0
- data/examples/ex1/test-example.sh +36 -0
- data/examples/ex1/test.config.json +16 -0
- data/examples/ex2/commands.yml +35 -0
- data/examples/ex2/page_model.json +18 -0
- data/examples/ex2/test-example.sh +38 -0
- data/examples/ex2/test.config.json +25 -0
- data/examples/ex6/commands.yml +53 -0
- data/examples/ex6/ex1.config.json +24 -0
- data/examples/ex6/test-example.sh +36 -0
- data/lib/scoutui/base/q_accounts.rb +8 -4
- data/lib/scoutui/base/q_browser.rb +22 -0
- data/lib/scoutui/base/test_scout.rb +3 -5
- data/lib/scoutui/base/test_settings.rb +1 -11
- data/lib/scoutui/base/user_vars.rb +42 -1
- data/lib/scoutui/base/visual_test_framework.rb +131 -24
- data/lib/scoutui/eyes/eye_factory.rb +21 -9
- data/lib/scoutui/eyes/eye_scout.rb +33 -9
- data/lib/scoutui/navigator.rb +1 -0
- data/lib/scoutui/utils/utils.rb +96 -32
- data/lib/scoutui/version.rb +1 -1
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 597490bc864b9a5ab5ae2abb47f5ab6d384f26db
|
4
|
+
data.tar.gz: 250daf6f585493301d23a20b73b0ffec728ee177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e64db3af7536e55a3d18769ef42d334c3dee36a05147a3fe014a16a77193677f8f0fc6799509377bf8a359a9e6a177bb991ebdc7ab90c9410c91351454c19b9
|
7
|
+
data.tar.gz: d64d32a4627e59340781012c27f88d08423ab4eebd407a1f8e8cdfad5482a3a9fac345d1824fbb4c1b1721361eba0fee21ffb1c8859ac928029018cb44047477
|
data/README.md
CHANGED
@@ -1,11 +1,31 @@
|
|
1
|
-
#
|
1
|
+
# ScoutUI
|
2
2
|
|
3
|
-
|
3
|
+
The ScoutUI gem provides a simple, yet powerful visual test framework to help you and your team with an automated visual test strategy.
|
4
4
|
|
5
|
-
|
5
|
+
This project is still in beta, but working - the version '1.0.0' will be the first "stable" release.
|
6
|
+
|
7
|
+
## What does ScoutUI provide?
|
8
|
+
|
9
|
+
1. Command driven test strategy using YAML and/or JSON format
|
10
|
+
2. Integration with Applitools Eyes (this is optional - only if you have an Eyes account)
|
11
|
+
3. Leverage Selenium/WebDriver without having to hassle with it (e.g. APIs) to conduct browser testing
|
12
|
+
a. UI Regression with Eyes
|
13
|
+
b. Functional Testing
|
14
|
+
|
15
|
+
|
16
|
+
## Helpful Links
|
17
|
+
YouTube
|
6
18
|
|
7
19
|
## Installation
|
8
20
|
|
21
|
+
### Prerequisites
|
22
|
+
1. Ruby 1.9.3 or higher
|
23
|
+
2. Following Gems
|
24
|
+
a. selenium-webdriver
|
25
|
+
b. eyes_selenium
|
26
|
+
c. yaml
|
27
|
+
d. json
|
28
|
+
|
9
29
|
Add this line to your application's Gemfile:
|
10
30
|
|
11
31
|
```ruby
|
@@ -24,16 +44,58 @@ To run unit tests:
|
|
24
44
|
|
25
45
|
$ bundle exec rake spec
|
26
46
|
|
27
|
-
##
|
47
|
+
## Running the examples
|
28
48
|
|
29
|
-
|
49
|
+
Following these steps to get started.
|
50
|
+
|
51
|
+
1. Goto the ./examples/ex1 folder
|
52
|
+
2. Set the environment variable APPLITOOLS_API_KEY with your key
|
53
|
+
|
54
|
+
export APPLITOOLS_API_KEY=[__YOUR_APPLITOOLS_KEY__]
|
55
|
+
3. Set the environment variable SCOUTUI_BIN to the ScoutUi driver
|
56
|
+
|
57
|
+
export SCOUTUI_BIN=[ScoutUI Path]\bin\scoutui_driver.rb
|
58
|
+
|
59
|
+
4. Run the script 'test-simple.sh'
|
60
|
+
5. Goto your Applitools account and look for the test named "Graceland"
|
30
61
|
|
31
62
|
## Development
|
32
63
|
|
33
64
|
|
34
|
-
##
|
65
|
+
## Creating Tests
|
66
|
+
|
67
|
+
### Command files
|
68
|
+
Command files are currently supported only in YAML format, however JSON will be supported very shortly (by 10/28/2015).
|
35
69
|
|
36
|
-
|
70
|
+
Each stanza of a Command YAML file starts with *page*.
|
71
|
+
|
72
|
+
page:
|
73
|
+
|
74
|
+
The following
|
75
|
+
|
76
|
+
|
77
|
+
#### Example 1. Navigate to a URL then take snapshots after user actions (e.g. mouse events).
|
78
|
+
|
79
|
+
page:
|
80
|
+
name: Home
|
81
|
+
url: http://www.elvis.com
|
82
|
+
---
|
83
|
+
page:
|
84
|
+
name: Mouseover Music
|
85
|
+
action: mouseover(//ul[@class="nav-primary"]//a[text()="Music"])
|
86
|
+
snapit: true
|
87
|
+
---
|
88
|
+
page:
|
89
|
+
name: Studio Albums
|
90
|
+
action: click(//*[@id='music']//a[text()="Studio Albums"])
|
91
|
+
snapit: true
|
92
|
+
expected:
|
93
|
+
wait: //footer[@id="footer"]//a[@class="credits"]
|
94
|
+
|
95
|
+
|
96
|
+
## To run from the command line
|
97
|
+
|
98
|
+
ruby test_script.rb --config <your test settings JSON file> --eyes
|
37
99
|
|
38
100
|
|
39
101
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -42,20 +104,13 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
42
104
|
|
43
105
|
## Contributing
|
44
106
|
|
45
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
46
|
-
|
107
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/h20dragon/scoutui.
|
47
108
|
|
48
109
|
## License
|
49
110
|
|
50
111
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
51
112
|
|
52
113
|
## To do
|
53
|
-
1. Refactor test_settings handling of JSON in method setConfig() - if Hash then we're fine, otherwise load the file (where String is passed)
|
54
|
-
|
55
|
-
jFile = File.read(static_settings_file)
|
56
|
-
jsonData=JSON.parse(jFile)
|
57
|
-
|
58
|
-
puts "jsonData type is #{jsonData.class.to_s}"
|
59
114
|
|
60
|
-
|
115
|
+
Advanced Test Reporting
|
61
116
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require_relative '../lib/scoutui'
|
3
|
+
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
##
|
7
|
+
# --file <Yaml>
|
8
|
+
# --host <String>
|
9
|
+
# --lang <String>
|
10
|
+
# --title <Applitools Title>
|
11
|
+
# --browser <chrome|firefox|ie>
|
12
|
+
|
13
|
+
|
14
|
+
nav = Scoutui::Navigator.new(Scoutui::Utils::TestUtils.instance.parseCommandLine())
|
15
|
+
|
16
|
+
|
17
|
+
runner = Scoutui::Base::TestScout.new(nav)
|
18
|
+
|
19
|
+
runner.start()
|
20
|
+
runner.report()
|
21
|
+
|
22
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
page:
|
2
|
+
name: Home
|
3
|
+
url: http://www.elvis.com
|
4
|
+
---
|
5
|
+
page:
|
6
|
+
name: Mouseover Music
|
7
|
+
action: mouseover(//ul[@class="nav-primary"]//a[text()="Music"])
|
8
|
+
snapit: true
|
9
|
+
---
|
10
|
+
page:
|
11
|
+
name: Studio Albums
|
12
|
+
action: click(//*[@id='music']//a[text()="Studio Albums"])
|
13
|
+
snapit: true
|
14
|
+
expected:
|
15
|
+
xyz: //footer[@id="footer"]//a[@class="credits"]
|
16
|
+
---
|
17
|
+
page:
|
18
|
+
skip: true
|
19
|
+
action: type(//input[@id="password"], ${password})
|
20
|
+
---
|
21
|
+
page:
|
22
|
+
skip: true
|
23
|
+
action: click(//input[@id="btnSubmit"])
|
24
|
+
expected:
|
25
|
+
avatar: //img[@id="cnqr-profile-avatar"]
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#/bin/bash
|
2
|
+
##
|
3
|
+
# Description
|
4
|
+
# This test script overrides the provided title and appname (if provided in the test config. file)
|
5
|
+
#
|
6
|
+
# Set the APPLITOOLS_API_KEY environment variable with your key.
|
7
|
+
#
|
8
|
+
# export APPLITOOLS_API_KEY="__YOUR_KEY_HERE__"
|
9
|
+
##
|
10
|
+
|
11
|
+
# Specify browser under test (chrome, firefox, ie, safari)
|
12
|
+
BUT=chrome
|
13
|
+
|
14
|
+
# Specify the title and appName needed by Applitools
|
15
|
+
# Specify the title and appName needed by Applitools
|
16
|
+
## NOTE: If the test configuration file specifies the title and app, it is superseded by the
|
17
|
+
## command line options.
|
18
|
+
TITLE=Graceland
|
19
|
+
APP=Elvis
|
20
|
+
|
21
|
+
# Specify the test configuration file
|
22
|
+
TEST_CFG="./test.config.json"
|
23
|
+
|
24
|
+
##
|
25
|
+
# content
|
26
|
+
# strict
|
27
|
+
# exact
|
28
|
+
# layyout
|
29
|
+
##
|
30
|
+
MATCH_TYPE="layout"
|
31
|
+
|
32
|
+
# The following command line parameters will override provided title and appName (if provided in test config file)
|
33
|
+
$SCOUTUI_BIN --config $TEST_CFG --browser $BUT --eyes --app $APP --title $TITLE --match $MATCH_TYPE
|
34
|
+
|
35
|
+
# The following
|
36
|
+
# $SCOUTUI_BIN --config $TEST_CFG --eyes --match $MATCH_TYPE --browser $BUT
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"Project": "Example",
|
3
|
+
"Version": "1.00",
|
4
|
+
"Description": "Example1 - http://www.Elvis.com",
|
5
|
+
|
6
|
+
"browser": "chrome",
|
7
|
+
|
8
|
+
"eyes": {
|
9
|
+
"title": "Example1",
|
10
|
+
"viewport": "1700x718",
|
11
|
+
"app": "09-26"
|
12
|
+
},
|
13
|
+
|
14
|
+
"host": "http://www.elvis-presley.com",
|
15
|
+
"dut": "./commands.yml"
|
16
|
+
}
|
@@ -0,0 +1,35 @@
|
|
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
|
+
expected:
|
6
|
+
wait: page(home).get(cars4sale)
|
7
|
+
wait: page(home).get(whyCarMax)
|
8
|
+
---
|
9
|
+
page:
|
10
|
+
name: Mouseover View Tickets
|
11
|
+
action: mouseover(page(home).get(whyCarMax))
|
12
|
+
snapit: true
|
13
|
+
---
|
14
|
+
page:
|
15
|
+
name: Click - specified by Alias
|
16
|
+
action: click(${whyCarMax})
|
17
|
+
snapit: true
|
18
|
+
---
|
19
|
+
page:
|
20
|
+
skip: true
|
21
|
+
action: pause
|
22
|
+
---
|
23
|
+
page:
|
24
|
+
skip: true
|
25
|
+
name: Click on Input
|
26
|
+
action: click(page(main_nav).get(search_input))
|
27
|
+
snapit: true
|
28
|
+
---
|
29
|
+
page:
|
30
|
+
action: type(page(main_nav).get(search_input), ${Search_Me})
|
31
|
+
---
|
32
|
+
page:
|
33
|
+
action: click(page(main_nav).get(search_btn))
|
34
|
+
expected:
|
35
|
+
wait: //input[@id='zip']
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"home": {
|
3
|
+
"cars4sale": "//a[text()='Find Cars for Sale']",
|
4
|
+
"whyCarMax": "//a[text()='Why CarMax']",
|
5
|
+
"wait2": "//input[text()='Sign in']"
|
6
|
+
},
|
7
|
+
|
8
|
+
"main_nav": {
|
9
|
+
"search_input": "//input[@id='search']",
|
10
|
+
"search_btn": "//a[@id='search-btn']"
|
11
|
+
},
|
12
|
+
|
13
|
+
|
14
|
+
"search": {
|
15
|
+
"header": "//title"
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#/bin/bash
|
2
|
+
##
|
3
|
+
# Description
|
4
|
+
# This test script overrides the provided title and appname (if provided in the test config. file)
|
5
|
+
#
|
6
|
+
# Set the APPLITOOLS_API_KEY environment variable with your key.
|
7
|
+
#
|
8
|
+
# export APPLITOOLS_API_KEY="__YOUR_KEY_HERE__"
|
9
|
+
##
|
10
|
+
SCOUTUI_BIN=../../bin/scoutui_driver.rb
|
11
|
+
# Specify browser under test (chrome, firefox, ie, safari)
|
12
|
+
BUT=chrome
|
13
|
+
|
14
|
+
# Specify the title and appName needed by Applitools
|
15
|
+
## NOTE: If the test configuration file specifies the title and app, it is superseded by the
|
16
|
+
## command line options.
|
17
|
+
TITLE=DEMO-CarMax
|
18
|
+
APP=Oct2015
|
19
|
+
|
20
|
+
# Specify the test configuration file
|
21
|
+
TEST_CFG="./test.config.json"
|
22
|
+
|
23
|
+
##
|
24
|
+
# content
|
25
|
+
# strict
|
26
|
+
# exact
|
27
|
+
# layyout
|
28
|
+
##
|
29
|
+
MATCH_TYPE="layout"
|
30
|
+
|
31
|
+
EYES=--eyes
|
32
|
+
|
33
|
+
|
34
|
+
# The following command line parameters will override provided title and appName (if provided in test config file)
|
35
|
+
$SCOUTUI_BIN --config $TEST_CFG --browser $BUT $EYES --app $APP --title $TITLE --match $MATCH_TYPE --pagemodel ./page_model.json
|
36
|
+
|
37
|
+
# The following
|
38
|
+
# $SCOUTUI_BIN --config $TEST_CFG --eyes --match $MATCH_TYPE --browser $BUT
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"Project": "Example",
|
3
|
+
"Version": "1.00",
|
4
|
+
"Description": "Example - CarMax",
|
5
|
+
|
6
|
+
"browser": "chrome",
|
7
|
+
|
8
|
+
"eyes": {
|
9
|
+
"title": "Example - CarMax",
|
10
|
+
"viewport": "1024x718",
|
11
|
+
"app": "10-16"
|
12
|
+
},
|
13
|
+
|
14
|
+
"host": "http://www.carmax.com",
|
15
|
+
"dut": "./commands.yml",
|
16
|
+
|
17
|
+
|
18
|
+
"user_vars": {
|
19
|
+
"Search_Me": "BMW M3",
|
20
|
+
"View_Tickets_Link": "page(main_nav).get(ViewTicketsLink)",
|
21
|
+
"WhyCarMax": "page(home).get(whyCarMax)"
|
22
|
+
}
|
23
|
+
|
24
|
+
}
|
25
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
page:
|
2
|
+
name: Home
|
3
|
+
description: Navigate to a specified URL and wait until the expected elements are present
|
4
|
+
url: http://localhost:8081/trac/PWK/wiki
|
5
|
+
expected:
|
6
|
+
wait: page(home).get(wiki_link)
|
7
|
+
wait2: page(home).get(login_form).get(password)
|
8
|
+
---
|
9
|
+
page:
|
10
|
+
name: Mouseover View Tickets
|
11
|
+
action: mouseover(page(main_nav).get(ViewTicketsLink))
|
12
|
+
snapit: true
|
13
|
+
---
|
14
|
+
page:
|
15
|
+
name: Click - specified by Alias
|
16
|
+
action: click(${View_Tickets_Link})
|
17
|
+
snapit: true
|
18
|
+
---
|
19
|
+
page:
|
20
|
+
skip: true
|
21
|
+
action: pause
|
22
|
+
---
|
23
|
+
page:
|
24
|
+
name: Click on Input
|
25
|
+
action: click(page(main_nav).get(search_input))
|
26
|
+
snapit: true
|
27
|
+
---
|
28
|
+
page:
|
29
|
+
action: type(page(main_nav).get(search_input), ${Search_Me})
|
30
|
+
---
|
31
|
+
page:
|
32
|
+
skip: true
|
33
|
+
name: Mouseover Music
|
34
|
+
action: mouseover(//ul[@class="nav-primary"]//a[text()="Music"])
|
35
|
+
snapit: true
|
36
|
+
---
|
37
|
+
page:
|
38
|
+
skip: true
|
39
|
+
name: Studio Albums
|
40
|
+
action: click(//*[@id='music']//a[text()="Studio Albums"])
|
41
|
+
snapit: true
|
42
|
+
expected:
|
43
|
+
wait: //footer[@id="footer"]//a[@class="credits"]
|
44
|
+
---
|
45
|
+
page:
|
46
|
+
skip: true
|
47
|
+
action: type(//input[@id="password"], ${password})
|
48
|
+
---
|
49
|
+
page:
|
50
|
+
skip: true
|
51
|
+
action: click(//input[@id="btnSubmit"])
|
52
|
+
expected:
|
53
|
+
avatar: //img[@id="cnqr-profile-avatar"]
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"Project": "Example",
|
3
|
+
"Version": "1.00",
|
4
|
+
"Description": "Example1",
|
5
|
+
|
6
|
+
"browser": "chrome",
|
7
|
+
|
8
|
+
"eyes": {
|
9
|
+
"title": "Example1",
|
10
|
+
"viewport": "1700x718",
|
11
|
+
"app": "09-26"
|
12
|
+
},
|
13
|
+
|
14
|
+
"host": "http://localhost:8081/trac/PWK/wiki",
|
15
|
+
"dut": "./commands.yml",
|
16
|
+
|
17
|
+
|
18
|
+
"user_vars": {
|
19
|
+
"Search_Me": "Van Halen",
|
20
|
+
"View_Tickets_Link": "page(main_nav).get(ViewTicketsLink)"
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|
24
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#/bin/bash
|
2
|
+
##
|
3
|
+
# Description
|
4
|
+
# This test script overrides the provided title and appname (if provided in the test config. file)
|
5
|
+
#
|
6
|
+
# Set the APPLITOOLS_API_KEY environment variable with your key.
|
7
|
+
#
|
8
|
+
# export APPLITOOLS_API_KEY="__YOUR_KEY_HERE__"
|
9
|
+
##
|
10
|
+
SCOUTUI_BIN=../../bin/scoutui_driver.rb
|
11
|
+
# Specify browser under test (chrome, firefox, ie, safari)
|
12
|
+
BUT=chrome
|
13
|
+
|
14
|
+
# Specify the title and appName needed by Applitools
|
15
|
+
TITLE=DEMO-ONE
|
16
|
+
APP=Elvis
|
17
|
+
|
18
|
+
# Specify the test configuration file
|
19
|
+
TEST_CFG="./ex6.config.json"
|
20
|
+
|
21
|
+
##
|
22
|
+
# content
|
23
|
+
# strict
|
24
|
+
# exact
|
25
|
+
# layyout
|
26
|
+
##
|
27
|
+
MATCH_TYPE="layout"
|
28
|
+
|
29
|
+
#EYES=--eyes
|
30
|
+
EYES=""
|
31
|
+
|
32
|
+
# The following command line parameters will override provided title and appName (if provided in test config file)
|
33
|
+
$SCOUTUI_BIN --debug --config $TEST_CFG --browser $BUT $EYES --app $APP --title $TITLE --match $MATCH_TYPE --pagemodel ./page_model.json
|
34
|
+
|
35
|
+
# The following
|
36
|
+
# $SCOUTUI_BIN --config $TEST_CFG --eyes --match $MATCH_TYPE --browser $BUT
|