Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Blatter committed Jul 16, 2017
1 parent 7761435 commit 3b2306d
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 16 deletions.
16 changes: 14 additions & 2 deletions docs/step_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,31 @@ def examples
end

class StepDefinition
attr_accessor :name, :title
attr_accessor :path, :name, :title

def initialize(path)
$steps = []

self.path = path
self.name = File.basename(path, '.rb')
self.title = "#{self.name.capitalize} Step Definitions\n"
self.title = "#{self.name.gsub('_', ' ').split.map(&:capitalize).join(' ')} Step Definitions\n"

require path
end

def description
contents = File.read(self.path)

description_match = contents.match(/\s*#\s*Description: ([^\n]+)/)

return '' unless description_match and description_match.length > 1

description_match[1]
end

def output
output = "# #{self.title}\n"
output += "#{self.description}\n"

output += "## Steps: \n\n"

Expand Down
5 changes: 5 additions & 0 deletions docs/step_definitions/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Cucumber Step Definitions Overview

The following documentation will demonstrate how to use AutomationObject in a Ruby/Cucumber context.
We have created common step definitions that you can include for automating and testing a website or app.

## Features

* Using RSpec for Assertions

## Loading Step Definitions in Cucumber
Expand Down
1 change: 1 addition & 0 deletions docs/step_definitions/element.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Element Step Definitions

Use the following step definitions to interact with or test elements
## Steps:

### Call an element method
Expand Down
3 changes: 2 additions & 1 deletion docs/step_definitions/element_array.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Element_array Step Definitions
# Element Array Step Definitions

Use the following step definitions to interact with or test element arrays
## Steps:

### For: Call an element array method
Expand Down
3 changes: 2 additions & 1 deletion docs/step_definitions/element_hash.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Element_hash Step Definitions
# Element Hash Step Definitions

Use the following step definitions to interact with or test element hashes
## Steps:

### Call an element hash method
Expand Down
1 change: 1 addition & 0 deletions docs/step_definitions/modal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Modal Step Definitions

Use the following step definitions to interact with or test modals
## Steps:

### Automatically navigate to the modal
Expand Down
3 changes: 2 additions & 1 deletion docs/step_definitions/screen.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Screen Step Definitions

Use the following step definitions to interact with or test screens
## Steps:

### Automatically navigate to the modal
### Automatically navigate to the screen

#### Examples:

Expand Down
3 changes: 1 addition & 2 deletions lib/automation_object/step_definitions/element.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# frozen_string_literal: true
require_relative 'support/parse'

# Element Step Definitions
# Provides step definitions related to elements
# Description: Use the following step definitions to interact with or test elements

# Call an element method
# Examples:
Expand Down
3 changes: 1 addition & 2 deletions lib/automation_object/step_definitions/element_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
require_relative 'support/parse'
require_relative 'support/element_array'

# Title: Element Array Step Definitions
# Description: Provides step definitions related to element arrays
# Description: Use the following step definitions to interact with or test element arrays

# For: Call an element array method
# Examples:
Expand Down
3 changes: 1 addition & 2 deletions lib/automation_object/step_definitions/element_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
require_relative 'support/parse'
require_relative 'support/element_hash'

# Title: Element Hash Step Definitions
# Description: Provides step definitions related to element hashes
# Description: Use the following step definitions to interact with or test element hashes

# Call an element hash method
# Examples:
Expand Down
3 changes: 1 addition & 2 deletions lib/automation_object/step_definitions/modal.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# frozen_string_literal: true
require_relative 'support/parse'

# Modal Step Definitions
# Provides step definitions related to modals
# Description: Use the following step definitions to interact with or test modals

# Automatically navigate to the modal
# Examples:
Expand Down
5 changes: 2 additions & 3 deletions lib/automation_object/step_definitions/screen.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# frozen_string_literal: true
require_relative 'support/parse'

# Screen Step Definitions
# Provides step definitions related to screens
# Description: Use the following step definitions to interact with or test screens

# Automatically navigate to the modal
# Automatically navigate to the screen
# Examples:
# - I go to the "home_screen" screen
# - I go to "login_screen" screen
Expand Down

0 comments on commit 3b2306d

Please sign in to comment.