spec/view_doms_spec.rb in domkey-0.1.0 vs spec/view_doms_spec.rb in domkey-0.2.0
- old
+ new
@@ -1,21 +1,21 @@
require 'spec_helper'
-module DomkeyExample
- class Doms
+
+describe Domkey::View do
+
+ class DomsExample
include Domkey::View
doms(:streets) { text_fields(class: 'street1') }
end
-end
-describe Domkey::View do
before :all do
- Domkey.browser.goto("file://" + __dir__ + "/html/test.html")
+ goto_html("test.html")
end
it 'doms collection' do
- view = DomkeyExample::Doms.new
+ view = DomsExample.new
view.should respond_to(:streets)
view.streets.should be_kind_of(Domkey::View::PageObjectCollection)
view.streets.each { |e| e.should be_kind_of(Domkey::View::PageObject) }
view.streets.should_not respond_to(:value) # or should it?
view.streets.should_not respond_to(:set) # or should it?
@@ -30,10 +30,10 @@
#require 'benchmark'
#Benchmark.bm do |bm|
# howmany = 50
# # setup browser
-# Domkey.browser.goto("file://" + __dir__ + "/html/test.html")
+# goto_html("test.html")
# view = DomkeyExample::Doms.new Domkey.browser
# bm.report('domkey') do
# howmany.times do
# view.streets.each { |e| e.set "hello" }
# view.streets.map { |e| e.value }