features/chemists.feature in chemistrykit-3.8.1 vs features/chemists.feature in chemistrykit-3.9.0.rc1
- old
+ new
@@ -42,10 +42,33 @@
search_results.text.include?(chemist.type)
end
end
end
"""
+ And a file named "formulas/advanced_chemist_formula.rb" with:
+ """
+ module Formulas
+ class AdvancedChemistFormula < Formula
+ include ChemistryKit::Formula::ChemistAware
+ def open(url)
+ @driver.get url
+ end
+
+ def search
+ search_box = find id: 'gbqfq'
+ search_box.send_keys chemist.some_sub_account.item
+ search_box.send_keys :enter
+ end
+
+ def search_results_found?
+ wait_for(5) { displayed? id: 'search' }
+ search_results = find id: 'search'
+ search_results.text.include?(chemist.some_sub_account.item)
+ end
+ end
+ end
+ """
And a file named "formulas/lib/formula.rb" with:
"""
module Formulas
class Formula < ChemistryKit::Formula::Base
@@ -106,16 +129,48 @@
Given a file named "beakers/chemist_beaker.rb" with:
"""
describe "Chemist Beaker", :depth => 'shallow' do
let(:basic) { @formula_lab.mix('basic_formula') }
let(:chem) { @formula_lab.using('chemist_formula').with('admin1').mix }
+ let(:chem2) { @formula_lab.using('chemist_formula').with('other1').mix }
it "loads an external web page" do
basic.open "http://www.google.com"
chem.search
chem.search_results_found?.should eq true
end
+
+ it "loads an external web page" do
+ basic.open "http://www.google.com"
+ chem2.search
+ chem2.search_results_found?.should eq true
+ end
end
"""
+ And a file named "chemists/others.csv" with:
+ """
+ Key,Type,Email,Name,Password
+ other1,other,other@email.com,Mr. Other,abc123$
+ """
When I run `ckit brew`
- Then the stdout should contain "1 example, 0 failures"
+ Then the stdout should contain "2 examples, 0 failures"
+ Scenario: Composing a chemist from multiple files
+ Given a file named "beakers/chemist_beaker.rb" with:
+ """
+ describe "Chemist Beaker", :depth => 'shallow' do
+ let(:basic) { @formula_lab.mix('basic_formula') }
+ let(:chem) { @formula_lab.using('advanced_chemist_formula').with('admin1').and_with('other1').mix }
+ it "loads an external web page" do
+ basic.open "http://www.google.com"
+ chem.search
+ chem.search_results_found?.should eq true
+ end
+ end
+ """
+ And a file named "chemists/others.csv" with:
+ """
+ Key,Type,Item
+ other1,some_sub_account,some_item
+ """
+ When I run `ckit brew`
+ Then the stdout should contain "1 example, 0 failures"