class TestHistoryBuilder
Builder to generate options for getting test history All of the with… methods return self for method chaining
Public Class Methods
# File lib/cbthelper/TestHistoryBuilder.rb, line 7 def initialize @options = {} end
Public Instance Methods
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
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
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
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
Will only return tests that match the build given
# File lib/cbthelper/TestHistoryBuilder.rb, line 31 def withBuild(build) @options["build"] = build self end
# File lib/cbthelper/TestHistoryBuilder.rb, line 89 def withEndDate(endDate) @options["endDate"] = endDate self end
Sets the max number of tests to return
# File lib/cbthelper/TestHistoryBuilder.rb, line 12 def withLimit(limit) @options["num"] = limit self end
Will only return tests that match the name given
# File lib/cbthelper/TestHistoryBuilder.rb, line 25 def withName(name) @options["name"] = name self end
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
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
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
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
# File lib/cbthelper/TestHistoryBuilder.rb, line 84 def withStartDate(startDate) @options["startDate"] = startDate self end
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