please guide how to disable one of the below test methods using RSpec. I am using Selenuim WebDriver + RSpec combinations to run tests.
require 'rspec' require 'selenium-webdriver' describe 'Automation System' do before(:each) do ### end after(:each) do @driver.quit end it 'Test01' do #positive test case end it 'Test02' do #negative test case end end
- In RSpec, it's also possible to skip over certain examples. We can do that by marking them as being pending, or by telling it that it ought to skip them.
`pending` examples RSpec offers a number of different ways to indicate that an example is. disabled pending some action. `pending` any arbitrary reason with a failing example. `pending` any arbitrary reason with a passing example. `pending` for an example that is currently passing.
I use the database_cleaner gem to scrub my test database before each test runs, ensuring a clean slate and stable baseline every time. By default, RSpec will actually do this for you, running every test with a database transaction and then rolling back that transaction after it finishes.
You can use pending()
or change it
to xit
or wrap assert in pending block for wait implementation:
describe 'Automation System' do # some code here it 'Test01' do pending("is implemented but waiting") end it 'Test02' do # or without message pending end pending do "string".reverse.should == "gnirts" end xit 'Test03' do true.should be(true) end end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With