Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Ruby/Cucumber Composition design

A slight issue I'm genuinely new to Ruby, I have a class which contains cases of other classes(composition)

I'm endeavoring to get to the class occurrences inside Ruby Cucumber, however continue restoring a mistake unclear technique `bk' for nil:NilClass (NoMethodError) 'bk' strategy is situated inside the inside class I'm speculating this blunder is on the grounds that Cucumber can't get to the class of Interior. Whats the most ideal method for planning this or a reasonable arrangement?
class CarConfig


def initialize(browser, wait)
@browser = browser
@wait = wait
@equipments = Equipment.new(@browser)
@interior = Interior.new(@browser)
@engines = Engines.new(@browser)
@exterior = Exterior.new(@browser)
@grades = Grades.new(@browser)
end

def click_comfort
@browser.find_element(:css, 'a.xdata-id-Comfort').click
end


def check_equipment
equipment_availability = []
equipment_not_available = " equipment not available"
equipment_currently_available = "equipment available"

equipment = [@equipments.lifestyle,@equipments.elegance, @equipments.comfort, @equipments.executive, @equipments.luxury,
@equipments.innova].each do

end
equipment_availability.push equipment

if "#{equipment_availability}".include? "disabled"
equipment_not_available
else
equipment_currently_available
end
Cucumber

Given /^I have selected Comfort$/ do
@car_configurator = CarConfig.new(@browser, @wait)
@browser.get $car_config_page
sleep(2)
@car_configurator.click_comfort
sleep(3)

end

Then /^I should see interior BK as available$/ do
@interior.bk.should_not include ("disabled"), ("selected")
end
Sign In or Register to comment.