Class: HTMLCS

Inherits:
Object
  • Object
show all
Defined in:
lib/html_cs_run_parse.rb

Overview

this gem is specifically for running HTMLCS

Class Method Summary collapse

Class Method Details

.compile_html_cs(data_location) ⇒ Object



18
19
20
21
# File 'lib/html_cs_run_parse.rb', line 18

def self.compile_html_cs(data_location)
  exec = Execution.new
  exec.build(data_location)
end

.run_html_cs(browser, file_name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/html_cs_run_parse.rb', line 6

def self.run_html_cs(browser, file_name)
  browser.execute_script(File.read(File.expand_path("../HTMLCS.js", __FILE__)))
  browser.execute_script("HTMLCS_RUNNER.run('WCAG2AA')")
  output = browser.driver.manage.logs.get(:browser)
  parse = ParseMachine.new
  parse.htmlcs_parse(output, file_name)
  browser.screenshot.save "#{file_name}.png"
  File.open(file_name + ".txt", 'w+') { |file|
    file.print(browser.url)
  }
end