README.md in true_automation-0.1.0 vs README.md in true_automation-0.3.2
- old
+ new
@@ -1,43 +1,77 @@
# TrueAutomation
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/true_automation`. To experiment with that code, run `bin/console` for an interactive prompt.
+ **true_automation** gem enables awesome TrueAutomation.IO features for Capybara, Watir or Ruby-based Selenium projects.
+
+## Setup
-TODO: Delete this and the text above, and describe your gem
+**true_automation** gem provides helper DSL method, that can be used instead of Selenium/Capybara locators.
+Initial setup aim is to make `ta` method visible for your code.
-## Installation
+You need **trueautomation** npm package installed globally first. It requires NodeJS 9+.
+We recommend to use [nvm](https://github.com/creationix/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows)
+to install Node.
+When right version of Node is installed run the following command:
+
+ $ npm install -g trueautomation
+
+
+### Automatic Setup
+
+Run `trueautomation init` inside your project directory. TrueAutomation installer automatically detects technology used
+in your project. Currently we support Capybara/RSpec automatic setup only.
+
+#### Capybara/RSpec
+
+For Capybara/RSpec projects TrueAutomation installer adds **true_automation** gem to the Gemfile, and includes TrueAutomation
+DSL to `rspec_helper.rb`.
+
+#### Other
+
+For other Ruby-based stacks installer just adds **true_automation** gem to the Gemfile. Check *Manual Setup* section for
+setup guide.
+
+### Manual Setup
+
Add this line to your application's Gemfile:
```ruby
gem 'true_automation'
```
And then execute:
- $ bundle
+ $ bundle install
+
+Add TrueAutomation DSL to your test file
-Or install it yourself as:
+ ```ruby
+ require 'true_automation/dsl'
+ ```
+
+ And include DSL into your class or just as the first line after `require` section.
+
+ ```ruby
+include TrueAutomation::DSL
+```
- $ gem install true_automation
-
## Usage
-TODO: Write usage instructions here
+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).
-## Development
+The gem provides helper method to use TrueAutomation.IO Smart Locators instead of Selenium or Capybara locators.
-After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
+To record an element for the first time use `ta(ta_name, initial_locator)` syntax.
-To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
+| Parameter | Description |
+|-----------------|-------------------------------------------------------------|
+|*ta_name* | is TrueAutomation Element name. We recommend to use namespaced syntax. E.g. _pageName:widgetName:elementName_ |
+|*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 |
-## Contributing
+For example:
-Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/true_automation. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
-
-## License
-
-The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
-
-## Code of Conduct
-
-Everyone interacting in the TrueAutomation project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/true_automation/blob/master/CODE_OF_CONDUCT.md).
+```ruby
+find(:xpath, ta('true:automation:name', '//initialXpathLocator'))
+find(:css, ta('true:automation:name', '.initialCSSSelector'))
+click(ta('true:automation:name', 'Login'))
+```