Method: #manual_test

Defined in:
lib/wsl.rb

#manual_test(*steps) ⇒ Object

A manual test is a fall back strategy when it is difficult to write automated step(s). For example you may have to interact with an external site as part of your script to click on an email link, or when registering enter a captcha code.

manual_test is a workaround for such tricky scenarios. Essentially you list some steps to perform within the manual_test then record whether it is a pass or a fail. Note that irrespective of how many manual tests you have you can only record one pass or fail for all steps within it.

Example usage -

some automated steps
...
rem "Register on the site"
...
manual_test "enter the captcha"
click "submitBtn"
manual_test "submit registration",
            "login into email account",
            "click on registration email link"	
...
  • steps: The steps to perform within the manual test. Textual values comma separated for each step.



571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File 'lib/wsl.rb', line 571

def manual_test(*steps)
	@myBrowser.logger.log(" Manual steps to perform:")
	
	# Log the steps
	steps.each do |step| 
		@myBrowser.logger.logStep(step)
	end
	
	# Ask for pass or fail
	result = ""
	
	until result.upcase  == "P" || result.upcase == "F" do
		puts " Manual test pass or fail (P/F)? " 
		result = gets.chomp	
	end
	
	# Log result
	@myBrowser.logger.logExpectedResult("Manual test passes")
	
	if result.upcase == "P" then
		@myBrowser.logger.logActualResult(Wsl::CustomLogger::pass, "Manual test passed")
	else
		@myBrowser.logger.logActualResult(Wsl::CustomLogger::fail, "Manual test failed")	
	end
end