ole-qa-framework 2.7.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/CHANGELOG.md +15 -0
  2. data/lib/common/common_object.rb +1 -1
  3. data/lib/common/line_object.rb +35 -10
  4. data/lib/common/page.rb +5 -0
  5. data/lib/common/subline_object.rb +8 -24
  6. data/lib/module/qa_helpers.rb +1 -1
  7. data/lib/module/qa_page_helpers.rb +24 -0
  8. data/lib/ole_qa_framework/VERSION.rb +1 -1
  9. data/lib/olefs/common/purap_document.rb +20 -25
  10. data/lib/olefs/objects/invoice_current_item.rb +1 -1
  11. data/lib/olefs/objects/invoice_line.rb +5 -2
  12. data/lib/olefs/objects/line_item.rb +44 -50
  13. data/lib/olefs/objects/receiving_line.rb +22 -52
  14. data/lib/olefs/pages/invoice.rb +5 -2
  15. data/lib/olefs/pages/payment_request.rb +0 -39
  16. data/lib/olefs/pages/purchase_order.rb +1 -11
  17. data/lib/olefs/pages/receiving_document.rb +1 -11
  18. data/lib/olefs/pages/requisition.rb +1 -11
  19. data/lib/olefs/subobjects/accounting_line.rb +16 -16
  20. data/lib/olefs/subobjects/copies_line.rb +9 -7
  21. data/lib/olefs/subobjects/exception_notes_line.rb +3 -3
  22. data/lib/olefs/{objects → subobjects}/invoice_line_item.rb +34 -45
  23. data/lib/olefs/subobjects/notes_line.rb +5 -5
  24. data/lib/olefs/subobjects/processing_line.rb +2 -2
  25. data/lib/olefs/subobjects/receipt_notes_line.rb +2 -2
  26. data/lib/olels/common/e_doc.rb +0 -17
  27. data/lib/olels/common/editor.rb +0 -17
  28. data/lib/olels/objects/access_info_line.rb +4 -4
  29. data/lib/olels/objects/control_006_line.rb +6 -6
  30. data/lib/olels/objects/control_007_line.rb +6 -6
  31. data/lib/olels/objects/data_line.rb +7 -7
  32. data/lib/olels/objects/editor_note.rb +3 -3
  33. data/lib/olels/objects/holdings_note.rb +5 -5
  34. data/lib/olels/objects/item_note.rb +5 -5
  35. data/lib/olels/objects/ownership_extent_line.rb +6 -16
  36. data/lib/olels/objects/patron_address_line.rb +33 -33
  37. data/lib/olels/objects/patron_email_line.rb +10 -10
  38. data/lib/olels/objects/patron_phone_line.rb +14 -14
  39. data/lib/olels/pages/bib_editor.rb +3 -44
  40. data/lib/olels/pages/instance_editor.rb +3 -33
  41. data/lib/olels/pages/item_editor.rb +1 -13
  42. data/lib/olels/pages/patron.rb +4 -33
  43. data/lib/olels/pages/return.rb +1 -0
  44. data/lib/olels/pages/staff_upload.rb +1 -0
  45. data/lib/olels/subobjects/ownership_note.rb +4 -4
  46. data/spec/common/line_object_spec.rb +41 -8
  47. data/spec/common/subline_object_spec.rb +9 -19
  48. data/spec/modules/qa_page_helpers_spec.rb +54 -0
  49. data/spec/olefs/accounting_line_spec.rb +9 -30
  50. data/spec/olefs/copies_line_spec.rb +1 -16
  51. data/spec/olefs/exception_notes_line_spec.rb +3 -13
  52. data/spec/olefs/invoice_current_item_spec.rb +1 -1
  53. data/spec/olefs/invoice_line_item_spec.rb +5 -5
  54. data/spec/olefs/invoice_line_spec.rb +2 -2
  55. data/spec/olefs/invoice_spec.rb +2 -2
  56. data/spec/olefs/line_item_spec.rb +32 -67
  57. data/spec/olefs/notes_line_spec.rb +5 -17
  58. data/spec/olefs/payment_request_spec.rb +1 -43
  59. data/spec/olefs/processing_line_spec.rb +5 -4
  60. data/spec/olefs/purap_document_spec.rb +23 -1
  61. data/spec/olefs/purchase_order_spec.rb +4 -18
  62. data/spec/olefs/receipt_notes_line_spec.rb +5 -14
  63. data/spec/olefs/receive_spec.rb +3 -18
  64. data/spec/olefs/receiving_line_spec.rb +35 -74
  65. data/spec/olefs/requisition_spec.rb +5 -19
  66. data/spec/olels/access_info_line_spec.rb +1 -1
  67. data/spec/olels/bib_editor_spec.rb +8 -56
  68. data/spec/olels/data_line_spec.rb +2 -2
  69. data/spec/olels/editor_spec.rb +0 -4
  70. data/spec/olels/{holdings_note_spec_spec.rb → holdings_note_spec.rb} +1 -1
  71. data/spec/olels/instance_editor_spec.rb +8 -31
  72. data/spec/olels/item_editor_spec.rb +4 -14
  73. data/spec/olels/item_note_spec.rb +2 -2
  74. data/spec/olels/ownership_extent_line_spec.rb +6 -16
  75. data/spec/olels/ownership_note_spec.rb +2 -1
  76. data/spec/olels/patron_address_line_spec.rb +1 -1
  77. data/spec/olels/patron_email_line_spec.rb +1 -1
  78. data/spec/olels/patron_phone_line_spec.rb +2 -2
  79. data/spec/olels/patron_spec.rb +8 -40
  80. metadata +7 -30
  81. data/lib/olefs/common/invoice_line_object.rb +0 -37
  82. data/lib/olefs/common/line_object.rb +0 -39
  83. data/lib/olefs/objects/new_line_item.rb +0 -48
  84. data/lib/olefs/objects/new_preq_line_item.rb +0 -43
  85. data/lib/olefs/objects/new_receiving_line.rb +0 -42
  86. data/lib/olefs/objects/preq_line_item.rb +0 -68
  87. data/lib/olefs/pages/payment_request_creation.rb +0 -44
  88. data/lib/olefs/subobjects/invoice_notes_line.rb +0 -25
  89. data/lib/olefs/subobjects/new_accounting_line.rb +0 -43
  90. data/lib/olefs/subobjects/new_copies_line.rb +0 -37
  91. data/lib/olefs/subobjects/new_exception_notes_line.rb +0 -30
  92. data/lib/olefs/subobjects/new_invoice_notes_line.rb +0 -35
  93. data/lib/olefs/subobjects/new_notes_line.rb +0 -36
  94. data/lib/olefs/subobjects/new_receipt_notes_line.rb +0 -35
  95. data/lib/olels/common/line_object.rb +0 -39
  96. data/spec/olefs/invoice_line_object_spec.rb +0 -49
  97. data/spec/olefs/invoice_notes_line_spec.rb +0 -49
  98. data/spec/olefs/preq_creation_spec.rb +0 -47
  99. data/spec/olefs/preq_line_item_spec.rb +0 -111
  100. data/spec/workflows/purap_spec.rb +0 -221
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### v3.0.0 - 2013/10/15
2
+
3
+ * Flexible Line Objects
4
+ * Line Objects & Subline Objects are defined once on a parent object
5
+ * The line number instance variable is now settable.
6
+ * The line ID instance variable has been replaced with a reader lookup method.
7
+ * Array reader attributes are used to track lines & sublines on instantiated objects.
8
+ * A lines array has been implemented on all page objects.
9
+ * A sublines array has been implemented on all line objects.
10
+ * OLELS
11
+ * Fix element definitions on Return Screen page.
12
+ * Fix element definitions on Staff Upload page.
13
+ * Spec
14
+ * Remove old workflow spec, no longer accurate or necessary.
15
+
1
16
  ### v2.7.3 - 2013/10/11
2
17
 
3
18
  * Page (base class)
@@ -26,7 +26,7 @@ module OLE_QA::Framework
26
26
  # The OLE_QA::Framework::Session instance passed to the Data Object.
27
27
  attr_accessor :ole
28
28
 
29
- # Arrays containing the names(Symbol) of each element or function declared
29
+ # Arrays containing the name (Symbol) of each element or function declared
30
30
  # on a data object.
31
31
  attr_reader :elements, :functions
32
32
 
@@ -20,25 +20,50 @@ module OLE_QA::Framework
20
20
  class Line_Object < Data_Object
21
21
 
22
22
  # The line number that this object will have on the screen.
23
- # - Used for line identifier replacement.
24
- attr_reader :line_number
25
- attr_reader :line_id
23
+ # - This is the 1-based line number used for replacement of human-readable identifiers.
24
+ attr_accessor :line_number
25
+
26
+ # An array containing the name (Symbol) of each subline element on the line object.
27
+ attr_reader :sublines
26
28
 
27
29
  # @param ole_session [Object] The OLE_QA::Framework::Session session to pass to the Data Object.
28
30
  # @param line_number [Fixnum] The number this line object will use for element definitions.
29
31
  def initialize(ole_session, line_number = 1)
30
32
  @line_number = line_number
31
- @line_id = line_number - 1
32
33
  super(ole_session)
34
+ @sublines = Array.new
35
+ set_sublines if defined?(self.set_sublines)
33
36
  end
34
37
 
35
- # Set element definitions, if any.
36
- # @note Use @line_number or @line_id in an element definition to specify either the textual,
37
- # human-readable (1-based) line number of the line object, or the coded, application-readable
38
- # (0-based) line identifier number of the line object.
39
- def set_elements
38
+ # A reader method for the line_id function.
39
+ # - This is the 0-based line number used for replacement of programmatic identifiers such as element IDs.
40
+ def line_id
41
+ @line_number - 1
40
42
  end
41
43
 
42
-
44
+ # Set a subline object definition on a page object.
45
+ # - A subline object created with this method becomes an accessor attribute
46
+ # associated with an instance variable on the page or data object on
47
+ # which it is created.
48
+ #
49
+ # @param name [Symbol] The name the new subline object will have on the object.
50
+ # (This will be an instance variable, so it cannot contain spaces.)
51
+ # @param klas [Class] The class to instantiate for the new subline object.
52
+ # (An error will be returned if the class given is not defined.)
53
+ # @param force [Boolean] If set to true, this method can be used to override an existing subline object definition.
54
+ #
55
+ # @raise StandardError if a parameter is of an incorrect type.
56
+ # @raise StandardError if an instance method already exists for a subline object with the same name.
57
+ # (Suppress with force = true.)
58
+ #
59
+ def set_subline(name, klas, force = false)
60
+ raise StandardError, "Name must be a symbol. Given: #{name} (#{name.class})" unless name.instance_of?(Symbol)
61
+ raise StandardError, "Klas must be a class. Given: #{klas} (#{klas.class})" unless klas.instance_of?(Class)
62
+ raise StandardError, "Subline object is already defined. (Use the 'force = true' option to suppress this error.)" if @sublines.include?(name) && ! force
63
+ instance_variable_set("@#{name}", klas.new(@ole, 1))
64
+ make_reader(name) unless force
65
+ @sublines << name unless force
66
+ end
67
+ alias_method(:subline, :set_subline)
43
68
  end
44
69
  end
data/lib/common/page.rb CHANGED
@@ -23,6 +23,9 @@ module OLE_QA::Framework
23
23
  # or OLELS, instead use the :new_url accessor set on the e-Doc object.
24
24
  attr_reader :url
25
25
 
26
+ # An array containing the name (Symbol) of each line object on the page object.
27
+ attr_reader :lines
28
+
26
29
  include OLE_QA::Framework::Page_Helpers
27
30
 
28
31
  # @param ole_session [Object] The OLE_QA::Framework::Session instance in which the page should load.
@@ -31,7 +34,9 @@ module OLE_QA::Framework
31
34
  super(ole_session)
32
35
  @url = url
33
36
  @wait_on = Array.new
37
+ @lines = Array.new
34
38
  wait_for_elements if defined?(self.wait_for_elements)
39
+ set_lines if defined?(self.set_lines)
35
40
  end
36
41
 
37
42
  # Open the page via URL.
@@ -14,34 +14,18 @@
14
14
 
15
15
  module OLE_QA::Framework
16
16
  # A Data Object in OLE that represents a line nested under another line.
17
- # A subline can usually be added or deleted, and has element identifiers
18
- # which vary dependent upon the line below which they are nested.
19
- class Subline_Object < Data_Object
17
+ # - A subline object can be recursed under another subline object, use of the "@parent_line"
18
+ # instance variable should allow for continued recursion ad nauseam.
19
+ class Subline_Object < Line_Object
20
20
 
21
- # The line number that this object will have on the screen.
22
- # - Used for line identifier replacement.
23
- attr_reader :line_number
24
- attr_reader :line_id
25
-
26
- # The line number that this subline object will have on the screen.
27
- # - Used for subline identifier replacement.
28
- attr_reader :subline_number
29
- attr_reader :subline_id
21
+ # The line under which this subline object was created.
22
+ attr_reader :parent_line
30
23
 
31
24
  # @param ole_session [Object] The OLE_QA::Framework::Session session to pass to the Data Object.
32
25
  # @param line_number [Fixnum] The line number this subline object will use for element definitions.
33
- # @param subline_number [Fixnum] The subline number this subline object will use for element definitions.
34
- def initialize(ole_session, line_number = 1, subline_number = 1)
35
- @line_number, @subline_number = line_number, subline_number
36
- @line_id = line_number -1
37
- @subline_id = subline_number -1
38
- super(ole_session)
39
- end
40
-
41
- # Set elements on the subline object.
42
- # @note Use line_number, line_id, subline_number, and subline_id to replace dynamic identifier numbers.
43
- # (See {OLE_QA::Framework::Line_Object#set_elements} for more on line number substitution.)
44
- def set_elements
26
+ def initialize(ole_session, parent_line, line_number = 1)
27
+ @parent_line = parent_line
28
+ super(ole_session, line_number)
45
29
  end
46
30
  end
47
31
  end
@@ -126,7 +126,7 @@ module OLE_QA::Framework::Helpers
126
126
  eigenclass = class << self;
127
127
  self
128
128
  end
129
- raise StandardError, "Element is already defined. (Use the 'force = true' option to suppress this error.)" if eigenclass.instance_methods.include?(name) && ! force
129
+ raise StandardError, "Function is already defined. (Use the 'force = true' option to suppress this error.)" if eigenclass.instance_methods.include?(name) && ! force
130
130
  eigenclass.class_eval do
131
131
  define_method name.to_s do |*arg|
132
132
  yield *arg
@@ -14,4 +14,28 @@
14
14
 
15
15
  module OLE_QA::Framework::Page_Helpers
16
16
 
17
+ # Set a line object definition on a page object.
18
+ # - A line object created with this method becomes an accessor attribute
19
+ # associated with an instance variable on the page or data object on
20
+ # which it is created.
21
+ #
22
+ # @param name [Symbol] The name the new line object will have on the object.
23
+ # (This will be an instance variable, so it cannot contain spaces.)
24
+ # @param klas [Class] The class to instantiate for the new line object.
25
+ # (An error will be returned if the class given is not defined.)
26
+ # @param force [Boolean] If set to true, this method can be used to override an existing line object definition.
27
+ #
28
+ # @raise StandardError if a parameter is of an incorrect type.
29
+ # @raise StandardError if an instance method already exists for a line object with the same name.
30
+ # (Suppress with force = true.)
31
+ #
32
+ def set_line(name, klas, force = false)
33
+ raise StandardError, "Name must be a symbol. Given: #{name} (#{name.class})" unless name.instance_of?(Symbol)
34
+ raise StandardError, "Klas must be a class. Given: #{klas} (#{klas.class})" unless klas.instance_of?(Class)
35
+ raise StandardError, "Line object is already defined. (Use the 'force = true' option to suppress this error.)" if @lines.include?(name) && ! force
36
+ instance_variable_set("@#{name}", klas.new(@ole, 1))
37
+ make_reader(name) unless force
38
+ @lines << name unless force
39
+ end
40
+ alias_method(:line, :set_line)
17
41
  end
@@ -15,6 +15,6 @@
15
15
  module OLE_QA
16
16
  module Framework
17
17
  # The version number for this project.
18
- VERSION = '2.7.3'
18
+ VERSION = '3.0.0'
19
19
  end
20
20
  end
@@ -15,10 +15,6 @@
15
15
  module OLE_QA::Framework::OLEFS
16
16
  # An OLE Financial System PURchasing/Accounts Payable Document
17
17
  class PURAP_Document < E_Doc
18
- def initialize(ole_session, url)
19
- super(ole_session, url)
20
- set_lines if defined?(self.set_lines)
21
- end
22
18
 
23
19
  # Set PURAP Document Elements.
24
20
  def set_elements
@@ -47,27 +43,26 @@ module OLE_QA::Framework::OLEFS
47
43
  element(:vendor_tab_toggle) {b.input(:id => "tab-Vendor-imageToggle")}
48
44
  element(:closed_vendor_name_field) {b.td(:xpath => "//tr/th[div[contains(text(),'Suggested Vendor:')]]/following-sibling::td[1]")}
49
45
  # Route Log Tab
50
- element(:route_log_tab_toggle) {b.input(:id => "tab-RouteLog-imageToggle")}
51
- # element(:actions_taken) {b.bs(:xpath => "//div[@id='tab-ActionsTaken-div']/div[1]/table/tbody/tr/td[1]/b")}
52
- # element(:actions_taken_by) {b.as(:xpath => "//div[@id='tab-ActionsTaken-div']/div[1]/table/tbody/tr/td[2]/a")}
53
- end
54
-
55
- # Create a Line Object on a PURAP Document page.
56
- def create_line(instance_name, class_name, which=0)
57
- raise StandardError, "Line object already exists. (#{instance_name})" if self.instance_variables.include?("@#{instance_name}".to_sym)
58
- new_line_name = instance_name
59
- make_accessor(:"#{instance_name}")
60
- klas = OLE_QA::Framework::OLEFS.const_get(:"#{class_name}")
61
- instance_variable_set(:"@#{new_line_name}", klas.new(@ole, which))
62
- end
63
- alias_method(:add_line,:create_line)
64
-
65
- # Remove a Line Object from a PURAP Document page.
66
- def remove_line(instance_name)
67
- raise StandardError, "Line object does not exist. (#{instance_name})" unless self.instance_variables.include?("@#{instance_name}".to_sym)
68
- remove_instance_variable("@#{instance_name}".to_sym)
69
- unmake_attr(instance_name.to_sym)
46
+ element(:route_log_tab_toggle) {b.input(:id => "tab-RouteLog-imageToggle")}
47
+ # New Purchasing Line Item Elements
48
+ element(:new_bib_option) {b.radio(:name => 'AttachBib', :index => 0)}
49
+ element(:existing_bib_option) {b.radio(:name => 'AttachBib', :index => 1)}
50
+ element(:existing_bib_button) {b.input(:id => 'bibSelectExistingItemButton')}
51
+ element(:new_bib_button) {b.input(:id => "bibCreateCurrentItemButton")}
52
+ element(:item_type_selector) {b.select_list(:id => "newPurchasingItemLine.itemTypeDescription")}
53
+ element(:copies_field) {b.text_field(:id => "newPurchasingItemLine.oleItemQuantity")}
54
+ element(:parts_field) {b.text_field(:id => "newPurchasingItemLine.itemNoOfParts")}
55
+ element(:list_price_field) {b.text_field(:id => "newPurchasingItemLine.itemListPrice")}
56
+ element(:public_view_checkbox) {b.checkbox(:id => "newPurchasingItemLine.itemPublicViewIndicator")}
57
+ element(:item_price_source_selector) {b.select_list(:id => "newPurchasingItemLine.itemPriceSourceId")}
58
+ element(:request_source_selector) {b.select_list(:id => "newPurchasingItemLine.requestSourceTypeId")}
59
+ element(:format_selector) {b.select_list(:id => "newPurchasingItemLine.formatTypeId")}
60
+ element(:category_selector) {b.select_list(:id => "newPurchasingItemLine.categoryId")}
61
+ element(:route_to_requestor_checkbox) {b.checkbox(:id => "newPurchasingItemLine.itemRouteToRequestorIndicator")}
62
+ element(:discount_field) {b.text_field(:id => "newPurchasingItemLine.itemDiscount")}
63
+ element(:discount_type_selector) {b.select_list(:id => "newPurchasingItemLine.itemDiscountType")}
64
+ element(:add_button) {b.input(:name => "methodToCall.addItem")}
65
+ element(:location_selector) {b.select_list(:id => 'newPurchasingItemLine.itemLocation')}
70
66
  end
71
- alias_method(:delete_line,:remove_line)
72
67
  end
73
68
  end
@@ -14,7 +14,7 @@
14
14
 
15
15
  module OLE_QA::Framework::OLEFS
16
16
  # A Current Items line on an OLE Financial System Invoice e-document.
17
- class Invoice_Current_Item < OLE_QA::Framework::OLEFS::Invoice_Line_Object
17
+ class Invoice_Current_Item < OLE_QA::Framework::Line_Object
18
18
 
19
19
  def set_elements
20
20
  super
@@ -20,7 +20,7 @@ module OLE_QA::Framework::OLEFS
20
20
  # of extra recursion to address the multiple sub-objects of an Invoice E-Document.
21
21
  # - The future structure of Invoice documents is presently uncertain, so this is a temporary measure.
22
22
  # If necessary, the framework may be restructured to follow this model.
23
- class Invoice_Line < OLE_QA::Framework::OLEFS::Invoice_Line_Object
23
+ class Invoice_Line < OLE_QA::Framework::Line_Object
24
24
 
25
25
  # A flexible PO line item object with dynamic ID element definitions on an Invoice document.
26
26
  attr_reader :line_item
@@ -28,7 +28,6 @@ module OLE_QA::Framework::OLEFS
28
28
  # Set OLE instance & line number, instantiate line item for PO line on Invoice document.
29
29
  def initialize(ole_session, line_number = 1)
30
30
  super(ole_session, line_number)
31
- @line_item = OLE_QA::Framework::OLEFS::Invoice_Line_Item.new(@ole, self, 1)
32
31
  end
33
32
 
34
33
  # Set invoice line elements.
@@ -51,5 +50,9 @@ module OLE_QA::Framework::OLEFS
51
50
  def set_functions
52
51
  super
53
52
  end
53
+
54
+ def set_sublines
55
+ subline(:line_item, OLE_QA::Framework::OLEFS::Invoice_Line_Item)
56
+ end
54
57
  end
55
58
  end
@@ -14,38 +14,38 @@
14
14
 
15
15
  module OLE_QA::Framework::OLEFS
16
16
  # A single Line Item in an OLE Financial System PURAP E-Document.
17
- class Line_Item < OLE_QA::Framework::OLEFS::Line_Object
18
- # Create accessor methods for new subline objects.
17
+ class Line_Item < OLE_QA::Framework::Line_Object
18
+ # Create accessor methods for subline objects.
19
19
  def set_sublines
20
- create_subline("new_accounting_line","New_Accounting_Line")
21
- create_subline("new_notes_line","New_Notes_Line")
22
- create_subline("new_copies_line","New_Copies_Line")
20
+ set_subline(:accounting_line, OLE_QA::Framework::OLEFS::Accounting_Line)
21
+ set_subline(:notes_line, OLE_QA::Framework::OLEFS::Notes_Line)
22
+ set_subline(:copies_line, OLE_QA::Framework::OLEFS::Copies_Line)
23
23
  end
24
24
 
25
25
  # Set line item elements.
26
26
  def set_elements
27
27
  super
28
28
  # Fields
29
- element(:copies_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemQuantity")}
30
- element(:parts_field) {b.text_field(:id => "document.item[#{@line_id}].itemNoOfParts")}
31
- element(:list_price_field) {b.text_field(:id => "document.item[#{@line_id}].itemListPrice")}
32
- element(:discount_field) {b.text_field(:id => "document.item[#{@line_id}].itemDiscount")}
29
+ element(:copies_field) {b.text_field(:id => "document.item[#{line_id}].oleItemQuantity")}
30
+ element(:parts_field) {b.text_field(:id => "document.item[#{line_id}].itemNoOfParts")}
31
+ element(:list_price_field) {b.text_field(:id => "document.item[#{line_id}].itemListPrice")}
32
+ element(:discount_field) {b.text_field(:id => "document.item[#{line_id}].itemDiscount")}
33
33
  element(:description_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[2]")}
34
34
  element(:item_type_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[3]")}
35
35
  element(:extended_cost_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[2]/td[3]")}
36
36
  element(:receipt_status_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[1]")}
37
37
  # Selectors
38
- element(:item_price_source_selector) {b.select_list(:id => "document.item[#{@line_id}].itemPriceSourceId")}
39
- element(:request_source_selector) {b.select_list(:id => "document.item[#{@line_id}].requestSourceId")}
40
- element(:item_type_selector) {b.select_list(:id => "document.item[#{@line_id}].itemTypeDescription")}
41
- element(:format_selector) {b.select_list(:id => "document.item[#{@line_id}].formatTypeId")}
42
- element(:category_selector) {b.select_list(:id => "document.item[#{@line_id}].categoryId")}
43
- element(:discount_type_selector) {b.select_list(:id => "document.item[#{@line_id}].itemDiscountType")}
44
- element(:location_selector) {b.select_list(:id => "document.item[#{@line_id}].itemLocation")}
38
+ element(:item_price_source_selector) {b.select_list(:id => "document.item[#{line_id}].itemPriceSourceId")}
39
+ element(:request_source_selector) {b.select_list(:id => "document.item[#{line_id}].requestSourceId")}
40
+ element(:item_type_selector) {b.select_list(:id => "document.item[#{line_id}].itemTypeDescription")}
41
+ element(:format_selector) {b.select_list(:id => "document.item[#{line_id}].formatTypeId")}
42
+ element(:category_selector) {b.select_list(:id => "document.item[#{line_id}].categoryId")}
43
+ element(:discount_type_selector) {b.select_list(:id => "document.item[#{line_id}].itemDiscountType")}
44
+ element(:location_selector) {b.select_list(:id => "document.item[#{line_id}].itemLocation")}
45
45
  # Buttons, Checkboxes, Etc.
46
46
  element(:delete_button) {b.input(:title => "Delete Item #{@line_number}")}
47
- element(:route_to_requestor_checkbox) {b.checkbox(:id => "document.item[#{@line_id}].itemRouteToRequestor")}
48
- element(:public_view_checkbox) {b.checkbox(:id => "document.item[#{@line_id}].itemPublicViewIndicator")}
47
+ element(:route_to_requestor_checkbox) {b.checkbox(:id => "document.item[#{line_id}].itemRouteToRequestor")}
48
+ element(:public_view_checkbox) {b.checkbox(:id => "document.item[#{line_id}].itemPublicViewIndicator")}
49
49
  # Readonly Elements
50
50
  # Use these for closed, uneditable fields as with a pre-existing line item on a purchase order.
51
51
  element(:closed_description_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[2]")}
@@ -67,40 +67,34 @@ module OLE_QA::Framework::OLEFS
67
67
  element(:closed_unit_cost_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[5]/td[1]")}
68
68
  element(:closed_discount_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[5]/td[2]")}
69
69
  element(:closed_discount_type_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[5]/td[4]")}
70
- # Subtab Toggle Buttons # Matches all of type, then selects by index = @line_id (i.e. if @line_num is 1, index is 0)
71
- element(:accounting_lines_toggle) {b.input(:id => /tab-AccountingLines[0-9]+-imageToggle/, :index => @line_id)}
70
+ # Subtab Toggle Buttons # Matches all of type, then selects by index = line_id (i.e. if @line_num is 1, index is 0)
71
+ element(:accounting_lines_toggle) {b.input(:id => /tab-AccountingLines[0-9]+-imageToggle/, :index => line_id)}
72
+ # FIXME Re-define and re-enable these toggles
72
73
  #element(:notes_toggle) #TBD - The notes and copies lines are treated as the same line for ID purposes.
73
74
  #element(:copies_toggle) # There is no reliable way of knowing which index either should have without being state-aware.
75
+ # FIXME Move new_(X)_line elements to line item as their definitions are static in this context.
76
+ # New Accounting Line Elements
77
+ element(:account_number_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.accountNumber")}
78
+ element(:chart_selector) {b.select_list(:id => "document.item[#{line_id}].newSourceLine.chartOfAccountsCode")}
79
+ element(:sub_account_number_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.subAccountNumber")}
80
+ element(:object_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.financialObjectCode")}
81
+ element(:sub_object_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.financialSubObjectCode")}
82
+ element(:project_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.projectCode")}
83
+ element(:org_ref_id_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.organizationReferenceId")}
84
+ element(:dollar_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.amount")}
85
+ element(:percent_field) {b.text_field(:id => "document.item[#{line_id}].newSourceLine.accountLinePercent")}
86
+ element(:add_account_button) {b.input(:name => "methodToCall.insertSourceLine.line#{line_id}.anchoraccountingSourceAnchor")}
87
+ # New Notes Line Elements
88
+ element(:note_type_selector) {b.select_list(:id => "document.item[#{line_id}].noteTypeId")}
89
+ element(:note_field) {b.text_field(:id => "document.item[#{line_id}].note")}
90
+ element(:add_note_button) {b.input(:name => "methodToCall.addNote.line#{line_id}")}
91
+ # New Copies Line Elements
92
+ # FIXME Update all definitions below
93
+ element(:num_copies_field) {b.text_field(:id => "document.item[#{line_id}].itemCopies")}
94
+ element(:num_parts_field) {b.text_field(:id => "")}
95
+ element(:location_copies_selector) {b.select_list(:id => "document.item[#{line_id}].locationCopies")}
96
+ element(:starting_copy_field) {b.text_field(:id => "document.item[#{line_id}].startingCopyNumber")}
97
+ element(:add_copy_button) {b.input(:name => "methodToCall.addCopy.line#{line_id}")}
74
98
  end
75
-
76
- def create_accounting_line(which = 1)
77
- create_subline("accounting_line_#{which}","Accounting_Line", which)
78
- end
79
- alias_method(:add_accounting_line,:create_accounting_line)
80
-
81
- def create_notes_line(which = 1)
82
- create_subline("notes_line_#{which}","Notes_Line", which)
83
- end
84
- alias_method(:add_notes_line,:create_notes_line)
85
-
86
- def create_copies_line(which = 1)
87
- create_subline("copies_line_#{which}","Copies_Line", which)
88
- end
89
- alias_method(:add_copies_line,:create_copies_line)
90
-
91
- def remove_accounting_line(which = 1)
92
- remove_subline("accounting_line_#{which}")
93
- end
94
- alias_method(:delete_accounting_line,:remove_accounting_line)
95
-
96
- def remove_notes_line(which = 1)
97
- remove_subline("notes_line_#{which}")
98
- end
99
- alias_method(:delete_notes_line,:remove_notes_line)
100
-
101
- def remove_copies_line(which = 1)
102
- remove_subline("copies_line_#{which}")
103
- end
104
- alias_method(:delete_copies_line,:remove_copies_line)
105
99
  end
106
100
  end
@@ -14,12 +14,13 @@
14
14
 
15
15
  module OLE_QA::Framework::OLEFS
16
16
  # A single line on an OLE Financial System Receiving Document
17
- class Receiving_Line < OLE_QA::Framework::OLEFS::Line_Object
17
+ class Receiving_Line < OLE_QA::Framework::Line_Object
18
18
  # Create accessor methods for new subline objects.
19
19
  def set_sublines
20
- create_subline("new_exception_notes_line","New_Exception_Notes_Line")
21
- create_subline("new_receipt_notes_line","New_Receipt_Notes_Line")
22
- create_subline("new_copies_line","New_Copies_Line")
20
+ set_subline(:exception_notes_line, OLE_QA::Framework::OLEFS::Exception_Notes_Line)
21
+ set_subline(:receipt_notes_line, OLE_QA::Framework::OLEFS::Receipt_Notes_Line)
22
+ set_subline(:copies_line, OLE_QA::Framework::OLEFS::Copies_Line)
23
+ set_subline(:processing_line, OLE_QA::Framework::OLEFS::Processing_Line)
23
24
  end
24
25
 
25
26
  # Set receiving line elements.
@@ -32,57 +33,26 @@ module OLE_QA::Framework::OLEFS
32
33
  element(:prior_parts_received_field) {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[7]")}
33
34
  element(:quantity_to_be_received_field) {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[8]")}
34
35
  element(:parts_to_be_received_field) {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[9]")}
35
- element(:item_received_quantity_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemReceivedTotalQuantity")}
36
- element(:item_received_parts_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemReceivedTotalParts")}
37
- element(:item_returned_quantity_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemReturnedTotalQuantity")}
38
- element(:item_returned_parts_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemReturnedTotalParts")}
39
- element(:item_damaged_quantity_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemDamagedTotalQuantity")}
40
- element(:item_damaged_parts_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemDamagedTotalParts")}
41
- element(:available_to_public_checkbox) {b.checkbox(:id => "document.item[#{@line_id}].availableToPublic")}
42
- element(:public_view_checkbox) {b.checkbox(:id => "document.item[#{@line_id}].availableToPublic")}
36
+ element(:item_received_quantity_field) {b.text_field(:id => "document.item[#{line_id}].oleItemReceivedTotalQuantity")}
37
+ element(:item_received_parts_field) {b.text_field(:id => "document.item[#{line_id}].oleItemReceivedTotalParts")}
38
+ element(:item_returned_quantity_field) {b.text_field(:id => "document.item[#{line_id}].oleItemReturnedTotalQuantity")}
39
+ element(:item_returned_parts_field) {b.text_field(:id => "document.item[#{line_id}].oleItemReturnedTotalParts")}
40
+ element(:item_damaged_quantity_field) {b.text_field(:id => "document.item[#{line_id}].oleItemDamagedTotalQuantity")}
41
+ element(:item_damaged_parts_field) {b.text_field(:id => "document.item[#{line_id}].oleItemDamagedTotalParts")}
42
+ element(:available_to_public_checkbox) {b.checkbox(:id => "document.item[#{line_id}].availableToPublic")}
43
+ element(:public_view_checkbox) {b.checkbox(:id => "document.item[#{line_id}].availableToPublic")}
43
44
  element(:exception_notes_toggle) {b.input(:xpath => "//tr[td/b[contains(text(),'#{@line_number}')]]/following-sibling::tr[2]/td[1]/table/tbody/tr[1]/th/div/input")}
44
45
  element(:receipt_notes_toggle) {b.input(:xpath => "//tr[td/b[contains(text(),'#{@line_number}')]]/following-sibling::tr[3]/td[1]/table/tbody/tr[1]/th/div/input")}
45
46
  element(:special_processing_instructions_toggle) {b.input(:xpath => "//tr[td/b[contains(text(),'#{@line_number}')]]/following-sibling::tr[4]/td[1]/table/tbody/tr[1]/th/div/input")}
47
+ # FIXME add copies line toggle
48
+ # New Receipt Note Elements
49
+ element(:receipt_note_type_selector) {b.select_list(:id => "document.item[#{line_id}].noteTypeId")}
50
+ element(:receipt_note_field) {b.text_field(:id => "document.item[#{line_id}].receiptNotes")}
51
+ element(:add_receipt_note_button) {b.input(:name => "methodToCall.addReceiptNote.line#{line_id}")}
52
+ # New Exception Note Elements
53
+ element(:exception_type_selector) {b.select_list(:id => "document.item[#{line_id}].exceptionTypeId")}
54
+ element(:exception_note_field) {b.text_field(:id => "document.item[#{line_id}].exceptionNotes")}
55
+ element(:add_exception_note_button) {b.input(:name => "methodToCall.addExceptionNOte.line#{line_id}")}
46
56
  end
47
-
48
- def create_exception_notes_line(which = 1)
49
- create_subline("exception_notes_line_#{which}","Exception_Notes_Line", which)
50
- end
51
- alias_method(:add_exception_notes_line,:create_exception_notes_line)
52
-
53
- def create_receipt_notes_line(which = 1)
54
- create_subline("receipt_notes_line_#{which}","Receipt_Notes_Line", which)
55
- end
56
- alias_method(:add_receipt_notes_line,:create_receipt_notes_line)
57
-
58
- def create_copies_line(which = 1)
59
- create_subline("copies_line_#{which}","Copies_Line", which)
60
- end
61
- alias_method(:add_copies_line,:create_copies_line)
62
-
63
- def create_processing_line(which = 1)
64
- create_subline("processing_line_#{which}","Processing_Line", which)
65
- end
66
- alias_method(:add_processing_line,:create_processing_line)
67
-
68
- def remove_exception_notes_line(which = 1)
69
- remove_subline("exception_notes_line_#{which}")
70
- end
71
- alias_method(:delete_exception_notes_line,:remove_exception_notes_line)
72
-
73
- def remove_receipt_notes_line(which = 1)
74
- remove_subline("receipt_notes_line_#{which}")
75
- end
76
- alias_method(:delete_receipt_notes_line,:remove_receipt_notes_line)
77
-
78
- def remove_copies_line(which = 1)
79
- remove_subline("copies_line_#{which}")
80
- end
81
- alias_method(:delete_copies_line,:remove_copies_line)
82
-
83
- def remove_processing_line(which = 1)
84
- remove_subline("processing_line_#{which}")
85
- end
86
- alias_method(:delete_processing_line,:remove_processing_line)
87
57
  end
88
58
  end