true_automation 0.1.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +56 -22
- data/lib/true_automation/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: 6d70d37175ba346864ba424d243f4b5e3f218b11
|
4
|
+
data.tar.gz: 66b4f5bfb527b47227c22c05a27a7f3736d24caa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f45f020ed106d5d622ce870ea5b16caecfba6ce69cf6cc3ea66011ff4c1a539981b882b242de131e4f046e4b68d0dc2a8304c7b7fdac7960adc1d704309efc0
|
7
|
+
data.tar.gz: 05160e0aeb806872464410f085a089df63839b4bac3641adb92ff6abf457c2db595b9114b502c42238693a14c632c6a201cde487acd868f611eac8dc66a05f10
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,43 +1,77 @@
|
|
1
1
|
# TrueAutomation
|
2
2
|
|
3
|
-
|
3
|
+
**true_automation** gem enables awesome TrueAutomation.IO features for Capybara, Watir or Ruby-based Selenium projects.
|
4
|
+
|
5
|
+
## Setup
|
4
6
|
|
5
|
-
|
7
|
+
**true_automation** gem provides helper DSL method, that can be used instead of Selenium/Capybara locators.
|
8
|
+
Initial setup aim is to make `ta` method visible for your code.
|
6
9
|
|
7
|
-
|
10
|
+
You need **trueautomation** npm package installed globally first. It requires NodeJS 9+.
|
11
|
+
We recommend to use [nvm](https://github.com/creationix/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows)
|
12
|
+
to install Node.
|
8
13
|
|
9
|
-
|
14
|
+
When right version of Node is installed run the following command:
|
10
15
|
|
11
|
-
|
12
|
-
gem 'true_automation'
|
13
|
-
```
|
16
|
+
$ npm install -g trueautomation
|
14
17
|
|
15
|
-
And then execute:
|
16
18
|
|
17
|
-
|
19
|
+
### Automatic Setup
|
18
20
|
|
19
|
-
|
21
|
+
Run `trueautomation init` inside your project directory. TrueAutomation installer automatically detects technology used
|
22
|
+
in your project. Currently we support Capybara/RSpec automatic setup only.
|
20
23
|
|
21
|
-
|
24
|
+
#### Capybara/RSpec
|
22
25
|
|
23
|
-
|
26
|
+
For Capybara/RSpec projects TrueAutomation installer adds **true_automation** gem to the Gemfile, and includes TrueAutomation
|
27
|
+
DSL to `rspec_helper.rb`.
|
24
28
|
|
25
|
-
|
29
|
+
#### Other
|
26
30
|
|
27
|
-
|
31
|
+
For other Ruby-based stacks installer just adds **true_automation** gem to the Gemfile. Check *Manual Setup* section for
|
32
|
+
setup guide.
|
28
33
|
|
29
|
-
|
34
|
+
### Manual Setup
|
30
35
|
|
31
|
-
|
36
|
+
Add this line to your application's Gemfile:
|
32
37
|
|
33
|
-
|
38
|
+
```ruby
|
39
|
+
gem 'true_automation'
|
40
|
+
```
|
34
41
|
|
35
|
-
|
42
|
+
And then execute:
|
43
|
+
|
44
|
+
$ bundle install
|
45
|
+
|
46
|
+
Add TrueAutomation DSL to your test file
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
require 'true_automation/dsl'
|
50
|
+
```
|
51
|
+
|
52
|
+
And include DSL into your class or just as the first line after `require` section.
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
include TrueAutomation::DSL
|
56
|
+
```
|
57
|
+
|
58
|
+
## Usage
|
36
59
|
|
37
|
-
|
60
|
+
Object is found by initial locator during the first run. We use advanced html tree and attributes analyzing algorithm which can find the object even if locator has been changed (id/classes are regenerated or HTML slightly changed).
|
38
61
|
|
39
|
-
The gem
|
62
|
+
The gem provides helper method to use TrueAutomation.IO Smart Locators instead of Selenium or Capybara locators.
|
40
63
|
|
41
|
-
|
64
|
+
To record an element for the first time use `ta(ta_name, initial_locator)` syntax.
|
42
65
|
|
43
|
-
|
66
|
+
| Parameter | Description |
|
67
|
+
|-----------------|-------------------------------------------------------------|
|
68
|
+
|*ta_name* | is TrueAutomation Element name. We recommend to use namespaced syntax. E.g. _pageName:widgetName:elementName_ |
|
69
|
+
|*initial_locator*| is Selenium/Capybara locator to use to find element for the first time. If you change initial locator in your code, TrueAutomation element record will be rewritten during next test run |
|
70
|
+
|
71
|
+
For example:
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
find(:xpath, ta('true:automation:name', '//initialXpathLocator'))
|
75
|
+
find(:css, ta('true:automation:name', '.initialCSSSelector'))
|
76
|
+
click(ta('true:automation:name', 'Login'))
|
77
|
+
```
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: true_automation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrueAutomation.IO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|