class TestHistoryBuilder

Builder to generate options for getting test history All of the with… methods return self for method chaining

Public Class Methods

new() click to toggle source
# File lib/cbthelper/TestHistoryBuilder.rb, line 7
def initialize
    @options = {}   
end

Public Instance Methods

build() click to toggle source

Generates the test history options @return : a ruby hash to pass to getTestHistory()

# File lib/cbthelper/TestHistoryBuilder.rb, line 96
def build
    return @options
end
withActive(active) click to toggle source

If set, will only return active or inactive tests @param active: boolean value

# File lib/cbthelper/TestHistoryBuilder.rb, line 19
def withActive(active)
    @options["active"] = active
    self
end
withBrowser(browser) click to toggle source

Will only return tests that used the same browser @param browser: a string with the browser name and version: (eg. Chrome 65)

# File lib/cbthelper/TestHistoryBuilder.rb, line 64
def withBrowser(browser)
    @options["browser"] = browser
    self
end
withBrowserType(browserType) click to toggle source

Will only return tests that used the same browser type @param browserType: a string representing the browser family (eg. 'Chrome', 'Edge', 'Safari')

# File lib/cbthelper/TestHistoryBuilder.rb, line 72
def withBrowserType(browserType)
    @options["browserType"] = browserType
    self
end
withBuild(build) click to toggle source

Will only return tests that match the build given

# File lib/cbthelper/TestHistoryBuilder.rb, line 31
def withBuild(build)
    @options["build"] = build
    self
end
withEndDate(endDate) click to toggle source
# File lib/cbthelper/TestHistoryBuilder.rb, line 89
def withEndDate(endDate)
    @options["endDate"] = endDate
    self
end
withLimit(limit) click to toggle source

Sets the max number of tests to return

# File lib/cbthelper/TestHistoryBuilder.rb, line 12
def withLimit(limit)
    @options["num"] = limit
    self
end
withName(name) click to toggle source

Will only return tests that match the name given

# File lib/cbthelper/TestHistoryBuilder.rb, line 25
def withName(name)
    @options["name"] = name
    self
end
withPlatform(platform) click to toggle source

Will only return tests with the same platform (OS) @param platform: string with the platform (eg. 'Windows 10', 'Mac OS 10.13')

# File lib/cbthelper/TestHistoryBuilder.rb, line 50
def withPlatform(platform)
    @options["platform"] = platform
    self
 end
withPlatformType(platformType) click to toggle source

Will only return tests with the same platformType (OS Family) @param platformType: string with the platform type (eg. 'Windows', 'Mac', 'Android')

# File lib/cbthelper/TestHistoryBuilder.rb, line 57
def withPlatformType(platformType)
    @options["platformType"] = platformType
    self
end
withResolution(resolution) click to toggle source

Will only return tests that used the same resolution @param resolution: a string with the form 'WIDTHxHEIGHT' (eg. '1024x768')

# File lib/cbthelper/TestHistoryBuilder.rb, line 79
def withResolution(resolution)
    @options["resolution"]= resolution
    self
end
withScore(score) click to toggle source

Will only return tests with the score specified ('pass', 'fail', 'unset')

# File lib/cbthelper/TestHistoryBuilder.rb, line 43
def withScore(score)
    @options["score"] = score
    self
end
withStartDate(startDate) click to toggle source
# File lib/cbthelper/TestHistoryBuilder.rb, line 84
def withStartDate(startDate)
    @options["startDate"] = startDate
    self
end
withUrl(url) click to toggle source

Will only return tests that navigate to the same url

# File lib/cbthelper/TestHistoryBuilder.rb, line 37
def withUrl(url)
    @options["url"] = url
    self
end