Class: Continuum::TestResult

Inherits:
Object
  • Object
show all
Defined in:
src/lib/continuum/test_result.rb

Overview

Encapsulates all of the data related to assertions returned from Access Engine

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(att_no, css, uel, encoding, element, timestamp, clustering_data) ⇒ TestResult

Returns a new instance of TestResult.

Parameters:

  • att_no (Integer)

    The number of attributes for the element associated with this test result.

  • css (String)

    The CSS selector for the element associated with this test result.

  • uel (String)

    The UEL for the element associated with this test result.

  • encoding (Array<Integer>)

    The character encoding array for the element associated with this test result.

  • element (String)

    The HTML for the element associated with this test result.

  • timestemp (String)

    The timestamp at which the test result was recorded.

  • clustering_data (ClusteringData)

    The clustering data for the element associated with this test result.



54
55
56
57
58
59
60
61
62
# File 'src/lib/continuum/test_result.rb', line 54

def initialize(att_no, css, uel, encoding, element, timestamp, clustering_data)
    @att_no = att_no
    @css = css
    @uel = uel
    @encoding = encoding
    @element = element
    @timestamp = timestamp
    @clustering_data = clustering_data
end

Instance Attribute Details

#att_noInteger

Gets the number of attributes for the element associated with this test result.

Returns:

  • (Integer)

    The number of attributes for the element associated with this test result.



15
16
17
# File 'src/lib/continuum/test_result.rb', line 15

def att_no
  @att_no
end

#clustering_dataClusteringData

Gets the clustering data for the element associated with this test result.

Returns:

  • (ClusteringData)

    The clustering data for the element associated with this test result.



45
46
47
# File 'src/lib/continuum/test_result.rb', line 45

def clustering_data
  @clustering_data
end

#cssString

Gets the CSS selector for the element associated with this test result.

Returns:

  • (String)

    The CSS selector for the element associated with this test result.



20
21
22
# File 'src/lib/continuum/test_result.rb', line 20

def css
  @css
end

#elementString

Gets the HTML for the element associated with this test result.

Returns:

  • (String)

    The HTML for the element associated with this test result.



35
36
37
# File 'src/lib/continuum/test_result.rb', line 35

def element
  @element
end

#encodingArray<Integer>

Gets the character encoding array for the element associated with this test result.

Returns:

  • (Array<Integer>)

    The character encoding array for the element associated with this test result.



30
31
32
# File 'src/lib/continuum/test_result.rb', line 30

def encoding
  @encoding
end

#timestampString

Gets the timestamp at which the test result was recorded.

Returns:

  • (String)

    The timestamp at which the test result was recorded.



40
41
42
# File 'src/lib/continuum/test_result.rb', line 40

def timestamp
  @timestamp
end

#uelString

Gets the UEL for the element associated with this test result.

Returns:

  • (String)

    The UEL for the element associated with this test result.



25
26
27
# File 'src/lib/continuum/test_result.rb', line 25

def uel
  @uel
end

Class Method Details

.from_json(json_data) ⇒ AccessibilityConcern

Parameters:

  • json_data (String, Hash)

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'src/lib/continuum/test_result.rb', line 66

def self.from_json(json_data)
    parsed = DataUtil.parse_json(json_data) || {}
  
    return new(
        parsed['attrNo'],
        parsed['css'],
        parsed['uel'],
        parsed['encoding'],
        parsed['element'],
        parsed['timestamp'],
        ClusteringData.from_json(parsed['clusteringData'])
    )
end