Best Howitzer_ruby code snippet using Howitzer.subject
helpers_spec.rb
Source:helpers_spec.rb
...7 let(:phantomjs_driver) { false }8 let(:sauce_driver) { false }9 let(:testingbot_driver) { false }10 describe '#sauce_driver?' do11 subject { sauce_driver? }12 before { allow(settings).to receive(:driver) { driver_setting } }13 context 'when :sauce' do14 let(:driver_setting) { :sauce }15 it { is_expected.to be_truthy }16 end17 context 'when not :sauce' do18 let(:driver_setting) { :phantomjs }19 it { is_expected.to be_falsey }20 end21 context 'when driver specified as String' do22 let(:driver_setting) { 'sauce' }23 it { is_expected.to be true }24 end25 context 'when driver is not specified' do26 let(:driver_setting) { nil }27 it do28 expect(log).to receive(:error).with(29 Howitzer::DriverNotSpecifiedError,30 'Please check your settings'31 ).once.and_call_original32 expect { subject }.to raise_error(Howitzer::DriverNotSpecifiedError)33 end34 end35 end36 describe '#testingbot_driver?' do37 subject { testingbot_driver? }38 before { allow(settings).to receive(:driver) { driver_setting } }39 context 'when :testingbot' do40 let(:driver_setting) { :testingbot }41 it { is_expected.to be_truthy }42 end43 context 'when not :testingbot' do44 let(:driver_setting) { :phantomjs }45 it { is_expected.to be_falsey }46 end47 context 'when driver specified as String' do48 let(:driver_setting) { 'testingbot' }49 it { is_expected.to be_truthy }50 end51 context 'when driver is not specified' do52 let(:driver_setting) { nil }53 it do54 expect(log).to receive(:error).with(55 Howitzer::DriverNotSpecifiedError,56 'Please check your settings'57 ).once.and_call_original58 expect { subject }.to raise_error(Howitzer::DriverNotSpecifiedError)59 end60 end61 end62 describe '#phantomjs_driver?' do63 subject { phantomjs_driver? }64 before { allow(settings).to receive(:driver) { driver_setting } }65 context 'when :phantomjs' do66 let(:driver_setting) { :phantomjs }67 it { is_expected.to be_truthy }68 end69 context 'when not :phantomjs' do70 let(:driver_setting) { :selenium }71 it { is_expected.to be_falsey }72 end73 context 'when :selenium_grid' do74 let(:driver_setting) { :selenium_grid }75 it { is_expected.to be_falsey }76 end77 context 'when driver specified as String' do78 let(:driver_setting) { 'phantomjs' }79 it { is_expected.to be_truthy }80 end81 context 'when driver is not specified' do82 let(:driver_setting) { nil }83 it do84 expect(log).to receive(:error).with(85 Howitzer::DriverNotSpecifiedError,86 'Please check your settings'87 ).once.and_call_original88 expect { subject }.to raise_error(Howitzer::DriverNotSpecifiedError)89 end90 end91 end92 describe '#selenium_driver?' do93 subject { selenium_driver? }94 before { allow(settings).to receive(:driver) { driver_setting } }95 context 'when :selenium' do96 let(:driver_setting) { :selenium }97 it { is_expected.to be_truthy }98 end99 context 'when :selenium_grid' do100 let(:driver_setting) { :selenium_grid }101 it { is_expected.to be_falsey }102 end103 context 'when not :selenium' do104 let(:driver_setting) { :phantomjs }105 it { is_expected.to be_falsey }106 end107 context 'when driver specified as String' do108 let(:driver_setting) { 'selenium' }109 it { is_expected.to be_truthy }110 end111 context 'when driver is not specified' do112 let(:driver_setting) { nil }113 it do114 expect(log).to receive(:error).with(115 Howitzer::DriverNotSpecifiedError,116 'Please check your settings'117 ).once.and_call_original118 expect { subject }.to raise_error(Howitzer::DriverNotSpecifiedError)119 end120 end121 end122 describe '#selenium_grid_driver?' do123 subject { selenium_grid_driver? }124 before { allow(settings).to receive(:driver) { driver_setting } }125 context 'when :selenium_grid' do126 let(:driver_setting) { :selenium_grid }127 it { is_expected.to be_truthy }128 end129 context 'when :selenium' do130 let(:driver_setting) { :selenium }131 it { is_expected.to be_falsey }132 end133 context 'when not :selenium' do134 let(:driver_setting) { :phantomjs }135 it { is_expected.to be_falsey }136 end137 context 'when driver specified as String' do138 let(:driver_setting) { 'selenium_grid' }139 it { is_expected.to be_truthy }140 end141 context 'when driver is not specified' do142 let(:driver_setting) { nil }143 it do144 expect(log).to receive(:error).with(145 Howitzer::DriverNotSpecifiedError,146 'Please check your settings'147 ).once.and_call_original148 expect { subject }.to raise_error(Howitzer::DriverNotSpecifiedError)149 end150 end151 end152 describe '#ie_browser?' do153 subject { ie_browser? }154 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }155 before { allow(self).to receive(:testingbot_driver?) { testingbot_driver } }156 before { allow(self).to receive(:selenium_grid_driver?) { selenium_grid_driver } }157 context 'when sauce_driver? is TRUE' do158 let(:sauce_driver) { true }159 context 'settings.sl_browser_name = :ie' do160 before { allow(settings).to receive(:sl_browser_name) { :ie } }161 it { is_expected.to be_truthy }162 end163 context 'settings.sl_browser_name = :iexplore' do164 before { allow(settings).to receive(:sl_browser_name) { :iexplore } }165 it { is_expected.to be_truthy }166 end167 context 'settings.sl_browser_name = :chrome' do168 before { allow(settings).to receive(:sl_browser_name) { :chrome } }169 it { is_expected.to be_falsey }170 end171 context 'settings.sl_browser_name is not specified' do172 before { allow(settings).to receive(:sl_browser_name) { nil } }173 it do174 expect(log).to receive(:error).with(175 Howitzer::SlBrowserNotSpecifiedError,176 'Please check your settings'177 ).once.and_call_original178 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)179 end180 end181 end182 context 'when sauce_driver? is FALSE' do183 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }184 context 'when selenium_driver? is TRUE' do185 let(:selenium_driver) { true }186 context 'settings.sel_browser = :ie' do187 before { allow(settings).to receive(:sel_browser) { :ie } }188 it { is_expected.to be_truthy }189 end190 context 'settings.sel_browser = :iexplore' do191 before { allow(settings).to receive(:sel_browser) { :iexplore } }192 it { is_expected.to be_truthy }193 end194 context 'settings.sel_browser = :chrome' do195 before { allow(settings).to receive(:sel_browser) { :chrome } }196 it { is_expected.to be_falsey }197 end198 context 'settings.sel_browser is not specified' do199 before { allow(settings).to receive(:sel_browser) { nil } }200 it do201 expect(log).to receive(:error).with(202 Howitzer::SelBrowserNotSpecifiedError,203 'Please check your settings'204 ).once.and_call_original205 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)206 end207 end208 end209 context 'when selenium_driver? is FALSE' do210 it { is_expected.to be_falsey }211 end212 context 'when selenium_grid_driver? is TRUE' do213 let(:selenium_grid_driver) { true }214 context 'settings.sel_browser = :ie' do215 before { allow(settings).to receive(:sel_browser) { :ie } }216 it { is_expected.to be_truthy }217 end218 context 'settings.sel_browser = :iexplore' do219 before { allow(settings).to receive(:sel_browser) { :iexplore } }220 it { is_expected.to be_truthy }221 end222 context 'settings.sel_browser = :chrome' do223 before { allow(settings).to receive(:sel_browser) { :chrome } }224 it { is_expected.to be_falsey }225 end226 context 'settings.sel_browser is not specified' do227 before { allow(settings).to receive(:sel_browser) { nil } }228 it do229 expect(log).to receive(:error).with(230 Howitzer::SelBrowserNotSpecifiedError,231 'Please check your settings'232 ).once.and_call_original233 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)234 end235 end236 end237 context 'when selenium_grid_driver? is FALSE' do238 it { is_expected.to be_falsey }239 end240 end241 context 'when testingbot_driver? is TRUE' do242 let(:testingbot_driver) { true }243 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }244 context 'settings.sel_browser = :ie' do245 before do246 allow(settings).to receive(:tb_browser_name) { :ie }247 allow(settings).to receive(:tb_browser_version) { 9 }248 end249 it { is_expected.to be_truthy }250 end251 context 'settings.tb_browser_name = :iexplore' do252 before do253 allow(settings).to receive(:tb_browser_name) { :iexplore }254 allow(settings).to receive(:tb_browser_version) { 9 }255 end256 it { is_expected.to be_truthy }257 end258 context 'settings.tb_browser_name = :firefox' do259 before do260 allow(settings).to receive(:tb_browser_name) { :firefox }261 allow(settings).to receive(:tb_browser_version) { 8 }262 end263 it { is_expected.to be_falsey }264 end265 context 'settings.tb_browser_name is not specified' do266 before { allow(settings).to receive(:tb_browser_name) { nil } }267 it do268 expect(log).to receive(:error).with(269 Howitzer::TbBrowserNotSpecifiedError,270 'Please check your settings'271 ).once.and_call_original272 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)273 end274 end275 end276 context 'when testingbot_driver? is FALSE' do277 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }278 context 'when sauce_driver? is TRUE' do279 let(:sauce_driver) { true }280 context 'settings.sl_browser_name = :ie' do281 before { allow(settings).to receive(:sl_browser_name) { :ie } }282 it { is_expected.to be_truthy }283 end284 context 'settings.sl_browser_name = :iexplore' do285 before { allow(settings).to receive(:sl_browser_name) { :iexplore } }286 it { is_expected.to be_truthy }287 end288 context 'settings.sl_browser_name = :chrome' do289 before { allow(settings).to receive(:sl_browser_name) { :chrome } }290 it { is_expected.to be_falsey }291 end292 context 'settings.sl_browser_name is not specified' do293 before { allow(settings).to receive(:sl_browser_name) { nil } }294 it do295 expect(log).to receive(:error).with(296 Howitzer::SlBrowserNotSpecifiedError,297 'Please check your settings'298 ).once.and_call_original299 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)300 end301 end302 end303 end304 context 'when selenium_driver? is TRUE' do305 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }306 context 'when selenium_driver? is TRUE' do307 let(:selenium_driver) { true }308 context 'settings.sel_browser = :ie' do309 before { allow(settings).to receive(:sel_browser) { :ie } }310 it { is_expected.to be_truthy }311 end312 context 'settings.sel_browser = :iexplore' do313 before { allow(settings).to receive(:sel_browser) { :iexplore } }314 it { is_expected.to be_truthy }315 end316 context 'settings.sel_browser = :chrome' do317 before { allow(settings).to receive(:sel_browser) { :chrome } }318 it { is_expected.to be_falsey }319 end320 context 'settings.sel_browser is not specified' do321 before { allow(settings).to receive(:sel_browser) { nil } }322 it do323 expect(log).to receive(:error).with(324 Howitzer::SelBrowserNotSpecifiedError,325 'Please check your settings'326 ).once.and_call_original327 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)328 end329 end330 end331 end332 context 'when selenium_driver? is FALSE' do333 before { allow(self).to receive(:selenium_driver?) { false } }334 context 'when testingbot_driver? is TRUE' do335 let(:testingbot_driver) { true }336 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }337 context 'settings.sl_browser_name = :ie' do338 before do339 allow(settings).to receive(:tb_browser_name) { :ie }340 allow(settings).to receive(:tb_browser_version) { 9 }341 end342 it { is_expected.to be_truthy }343 end344 context 'settings.tb_browser_name = :iexplore' do345 before do346 allow(settings).to receive(:tb_browser_name) { :iexplore }347 allow(settings).to receive(:tb_browser_version) { 9 }348 end349 it { is_expected.to be_truthy }350 end351 context 'settings.tb_browser_name = :firefox' do352 before do353 allow(settings).to receive(:tb_browser_name) { :firefox }354 allow(settings).to receive(:tb_browser_version) { 8 }355 end356 it { is_expected.to be_falsey }357 end358 context 'settings.tb_browser_name is not specified' do359 before { allow(settings).to receive(:tb_browser_name) { nil } }360 it do361 expect(log).to receive(:error).with(362 Howitzer::TbBrowserNotSpecifiedError,363 'Please check your settings'364 ).once.and_call_original365 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)366 end367 end368 end369 end370 end371 describe '#ff_browser?' do372 subject { ff_browser? }373 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }374 before { allow(self).to receive(:testingbot_driver?) { testingbot_driver } }375 before { allow(self).to receive(:selenium_grid_driver?) { selenium_grid_driver } }376 context 'when sauce_driver? is TRUE' do377 let(:sauce_driver) { true }378 context 'settings.sl_browser_name = :ff' do379 before { allow(settings).to receive(:sl_browser_name) { :ff } }380 it { is_expected.to be_truthy }381 end382 context 'settings.sl_browser_name = :firefox' do383 before { allow(settings).to receive(:sl_browser_name) { :firefox } }384 it { is_expected.to be_truthy }385 end386 context 'settings.sl_browser_name = :chrome' do387 before { allow(settings).to receive(:sl_browser_name) { :chrome } }388 it { is_expected.to be_falsey }389 end390 context 'settings.sl_browser_name is not specified' do391 before { allow(settings).to receive(:sl_browser_name) { nil } }392 it do393 expect(log).to receive(:error).with(394 Howitzer::SlBrowserNotSpecifiedError,395 'Please check your settings'396 ).once.and_call_original397 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)398 end399 end400 end401 context 'when sauce_driver? is FALSE' do402 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }403 context 'when selenium_driver? is TRUE' do404 let(:selenium_driver) { true }405 context 'settings.sel_browser = :ff' do406 before { allow(settings).to receive(:sel_browser) { :ff } }407 it { is_expected.to be_truthy }408 end409 context 'settings.sel_browser = :firefox' do410 before { allow(settings).to receive(:sel_browser) { :firefox } }411 it { is_expected.to be_truthy }412 end413 context 'settings.sel_browser = :chrome' do414 before { allow(settings).to receive(:sel_browser) { :chrome } }415 it { is_expected.to be_falsey }416 end417 context 'settings.sel_browser is not specified' do418 before { allow(settings).to receive(:sel_browser) { nil } }419 it do420 expect(log).to receive(:error).with(421 Howitzer::SelBrowserNotSpecifiedError,422 'Please check your settings'423 ).once.and_call_original424 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)425 end426 end427 end428 context 'when selenium_driver? is FALSE' do429 it { is_expected.to be_falsey }430 end431 end432 context 'when testingbot_driver? is TRUE' do433 let(:testingbot_driver) { true }434 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }435 context 'settings.tb_browser_name = :ff' do436 before do437 allow(settings).to receive(:tb_browser_name) { :ff }438 allow(settings).to receive(:tb_browser_version) { 8 }439 end440 it { is_expected.to be_truthy }441 end442 context 'settings.tb_browser_name = :firefox' do443 before do444 allow(settings).to receive(:tb_browser_name) { :firefox }445 allow(settings).to receive(:tb_browser_version) { 8 }446 end447 it { is_expected.to be_truthy }448 end449 context 'settings.tb_browser_name = :iexplore' do450 before do451 allow(settings).to receive(:tb_browser_name) { :iexplore }452 allow(settings).to receive(:tb_browser_version) { 9 }453 end454 it { is_expected.to be_falsey }455 end456 context 'settings.tb_browser_name is not specified' do457 before { allow(settings).to receive(:tb_browser_name) { nil } }458 it do459 expect(log).to receive(:error).with(460 Howitzer::TbBrowserNotSpecifiedError,461 'Please check your settings'462 ).once.and_call_original463 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)464 end465 end466 end467 context 'when testingbot_driver? is FALSE' do468 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }469 context 'when sauce_driver? is TRUE' do470 let(:sauce_driver) { true }471 context 'settings.sl_browser_name = :ff' do472 before { allow(settings).to receive(:sl_browser_name) { :ff } }473 it { is_expected.to be_truthy }474 end475 context 'settings.sl_browser_name = :firefox' do476 before { allow(settings).to receive(:sl_browser_name) { :firefox } }477 it { is_expected.to be_truthy }478 end479 context 'settings.sl_browser_name = :chrome' do480 before { allow(settings).to receive(:sl_browser_name) { :chrome } }481 it { is_expected.to be_falsey }482 end483 context 'settings.sl_browser_name is not specified' do484 before { allow(settings).to receive(:sl_browser_name) { nil } }485 it do486 expect(log).to receive(:error).with(487 Howitzer::SlBrowserNotSpecifiedError,488 'Please check your settings'489 ).once.and_call_original490 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)491 end492 end493 end494 end495 context 'when selenium_driver? is TRUE' do496 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }497 context 'when selenium_driver? is TRUE' do498 let(:selenium_driver) { true }499 context 'settings.sel_browser = :ff' do500 before { allow(settings).to receive(:sel_browser) { :ff } }501 it { is_expected.to be_truthy }502 end503 context 'settings.sel_browser = :firefox' do504 before { allow(settings).to receive(:sel_browser) { :firefox } }505 it { is_expected.to be_truthy }506 end507 context 'settings.sel_browser = :chrome' do508 before { allow(settings).to receive(:sel_browser) { :chrome } }509 it { is_expected.to be_falsey }510 end511 context 'settings.sel_browser is not specified' do512 before { allow(settings).to receive(:sel_browser) { nil } }513 it do514 expect(log).to receive(:error).with(515 Howitzer::SelBrowserNotSpecifiedError,516 'Please check your settings'517 ).once.and_call_original518 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)519 end520 end521 end522 end523 context 'when selenium_driver? is FALSE' do524 before { allow(self).to receive(:selenium_driver?) { false } }525 context 'when testingbot_driver? is TRUE' do526 let(:testingbot_driver) { true }527 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }528 context 'settings.tb_browser_name = :firefox' do529 before do530 allow(settings).to receive(:tb_browser_name) { :firefox }531 allow(settings).to receive(:tb_browser_version) { 8 }532 end533 it { is_expected.to be_truthy }534 end535 context 'settings.tb_browser_name = :ff' do536 before do537 allow(settings).to receive(:tb_browser_name) { :ff }538 allow(settings).to receive(:tb_browser_version) { 8 }539 end540 it { is_expected.to be_truthy }541 end542 context 'settings.tb_browser_name = :iexplore' do543 before do544 allow(settings).to receive(:tb_browser_name) { :iexplore }545 allow(settings).to receive(:tb_browser_version) { 9 }546 end547 it { is_expected.to be_falsey }548 end549 context 'settings.tb_browser_name is not specified' do550 before { allow(settings).to receive(:tb_browser_name) { nil } }551 it do552 expect(log).to receive(:error).with(553 Howitzer::TbBrowserNotSpecifiedError,554 'Please check your settings'555 ).once.and_call_original556 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)557 end558 end559 end560 context 'when selenium_grid_driver? is TRUE' do561 before { allow(self).to receive(:selenium_grid_driver?) { selenium_grid_driver } }562 context 'when selenium_grid_driver? is TRUE' do563 let(:selenium_grid_driver) { true }564 context 'settings.sel_browser = :ff' do565 before { allow(settings).to receive(:sel_browser) { :ff } }566 it { is_expected.to be_truthy }567 end568 context 'settings.sel_browser = :firefox' do569 before { allow(settings).to receive(:sel_browser) { :firefox } }570 it { is_expected.to be_truthy }571 end572 context 'settings.sel_browser = :chrome' do573 before { allow(settings).to receive(:sel_browser) { :chrome } }574 it { is_expected.to be_falsey }575 end576 context 'settings.sel_browser is not specified' do577 before { allow(settings).to receive(:sel_browser) { nil } }578 it do579 expect(log).to receive(:error).with(580 Howitzer::SelBrowserNotSpecifiedError,581 'Please check your settings'582 ).once.and_call_original583 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)584 end585 end586 end587 end588 context 'when selenium_grid_driver? is FALSE' do589 before { allow(self).to receive(:selenium_grid_driver?) { false } }590 context 'when testingbot_driver? is TRUE' do591 let(:testingbot_driver) { true }592 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }593 context 'settings.tb_browser_name = :firefox' do594 before do595 allow(settings).to receive(:tb_browser_name) { :firefox }596 allow(settings).to receive(:tb_browser_version) { 8 }597 end598 it { is_expected.to be_truthy }599 end600 context 'settings.tb_browser_name = :ff' do601 before do602 allow(settings).to receive(:tb_browser_name) { :ff }603 allow(settings).to receive(:tb_browser_version) { 8 }604 end605 it { is_expected.to be_truthy }606 end607 context 'settings.tb_browser_name = :iexplore' do608 before do609 allow(settings).to receive(:tb_browser_name) { :iexplore }610 allow(settings).to receive(:tb_browser_version) { 9 }611 end612 it { is_expected.to be_falsey }613 end614 context 'settings.tb_browser_name is not specified' do615 before { allow(settings).to receive(:tb_browser_name) { nil } }616 it do617 expect(log).to receive(:error).with(618 Howitzer::TbBrowserNotSpecifiedError,619 'Please check your settings'620 ).once.and_call_original621 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)622 end623 end624 end625 end626 end627 end628 describe '#chrome_browser?' do629 subject { chrome_browser? }630 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }631 before { allow(self).to receive(:testingbot_driver?) { testingbot_driver } }632 before { allow(self).to receive(:selenium_grid_driver?) { selenium_grid_driver } }633 context 'when sauce_driver? is TRUE' do634 let(:sauce_driver) { true }635 let(:testingbot_driver) { true }636 context 'settings.sl_browser_name = :chrome' do637 before { allow(settings).to receive(:sl_browser_name) { :chrome } }638 it { is_expected.to be_truthy }639 end640 context 'settings.sl_browser_name = :firefox' do641 before { allow(settings).to receive(:sl_browser_name) { :firefox } }642 it { is_expected.to be_falsey }643 end644 context 'settings.sl_browser_name is not specified' do645 before { allow(settings).to receive(:sl_browser_name) { nil } }646 it do647 expect(log).to receive(:error).with(648 Howitzer::SlBrowserNotSpecifiedError,649 'Please check your settings'650 ).once.and_call_original651 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)652 end653 end654 end655 context 'when sauce_driver? is FALSE' do656 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }657 context 'when selenium_driver? is TRUE' do658 let(:selenium_driver) { true }659 context 'settings.sel_browser = :chrome' do660 before { allow(settings).to receive(:sel_browser) { :chrome } }661 it { is_expected.to be_truthy }662 end663 context 'settings.sel_browser = :firefox' do664 before { allow(settings).to receive(:sel_browser) { :firefox } }665 it { is_expected.to be_falsey }666 end667 context 'settings.sel_browser is not specified' do668 before { allow(settings).to receive(:sel_browser) { nil } }669 it do670 expect(log).to receive(:error).with(671 Howitzer::SelBrowserNotSpecifiedError,672 'Please check your settings'673 ).once.and_call_original674 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)675 end676 end677 end678 context 'when selenium_driver? is FALSE' do679 it { is_expected.to be_falsey }680 end681 end682 context 'when testingbot_driver? is TRUE' do683 let(:testingbot_driver) { true }684 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }685 context 'settings.tb_browser_name = :chrome' do686 before do687 allow(settings).to receive(:tb_browser_name) { :chrome }688 allow(settings).to receive(:tb_browser_version) { 9 }689 end690 it { is_expected.to be_truthy }691 end692 context 'settings.tb_browser_name = :iexplore' do693 before do694 allow(settings).to receive(:tb_browser_name) { :iexplore }695 allow(settings).to receive(:tb_browser_version) { 9 }696 end697 it { is_expected.to be_falsey }698 end699 context 'settings.tb_browser_name is not specified' do700 before { allow(settings).to receive(:tb_browser_name) { nil } }701 it do702 expect(log).to receive(:error).with(703 Howitzer::TbBrowserNotSpecifiedError,704 'Please check your settings'705 ).once.and_call_original706 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)707 end708 end709 end710 context 'when testingbot_driver? is FALSE' do711 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }712 context 'when sauce_driver? is TRUE' do713 let(:sauce_driver) { true }714 context 'settings.sl_browser_name = :chrome' do715 before { allow(settings).to receive(:sl_browser_name) { :chrome } }716 it { is_expected.to be_truthy }717 end718 context 'settings.sl_browser_name = :firefox' do719 before { allow(settings).to receive(:sl_browser_name) { :firefox } }720 it { is_expected.to be_falsey }721 end722 context 'settings.sl_browser_name is not specified' do723 before { allow(settings).to receive(:sl_browser_name) { nil } }724 it do725 expect(log).to receive(:error).with(726 Howitzer::SlBrowserNotSpecifiedError,727 'Please check your settings'728 ).once.and_call_original729 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)730 end731 end732 end733 end734 context 'when selenium_driver? is TRUE' do735 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }736 context 'when selenium_driver? is TRUE' do737 let(:selenium_driver) { true }738 context 'settings.sel_browser = :chrome' do739 before { allow(settings).to receive(:sel_browser) { :chrome } }740 it { is_expected.to be_truthy }741 end742 context 'settings.sel_browser = :firefox' do743 before { allow(settings).to receive(:sel_browser) { :firefox } }744 it { is_expected.to be_falsey }745 end746 context 'settings.sel_browser is not specified' do747 before { allow(settings).to receive(:sel_browser) { nil } }748 it do749 expect(log).to receive(:error).with(750 Howitzer::SelBrowserNotSpecifiedError,751 'Please check your settings'752 ).once.and_call_original753 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)754 end755 end756 end757 end758 context 'when selenium_driver? is FALSE' do759 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }760 context 'when selenium_driver? is TRUE' do761 let(:selenium_driver) { true }762 context 'settings.sel_browser = :chrome' do763 before { allow(settings).to receive(:sel_browser) { :chrome } }764 it { is_expected.to be_truthy }765 end766 context 'settings.sel_browser = :firefox' do767 before { allow(settings).to receive(:sel_browser) { :firefox } }768 it { is_expected.to be_falsey }769 end770 context 'settings.sel_browser is not specified' do771 before { allow(settings).to receive(:sel_browser) { nil } }772 it do773 expect(log).to receive(:error).with(774 Howitzer::SelBrowserNotSpecifiedError,775 'Please check your settings'776 ).once.and_call_original777 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)778 end779 end780 end781 context 'when selenium_driver? is FALSE' do782 it { is_expected.to be_falsey }783 end784 end785 end786 describe '#safari_browser?' do787 subject { safari_browser? }788 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }789 before { allow(self).to receive(:testingbot_driver?) { testingbot_driver } }790 before { allow(self).to receive(:selenium_grid_driver?) { selenium_grid_driver } }791 context 'when sauce_driver? is TRUE' do792 let(:sauce_driver) { true }793 let(:testingbot_driver) { true }794 context 'settings.sl_browser_name = :safari' do795 before { allow(settings).to receive(:sl_browser_name) { :safari } }796 it { is_expected.to be_truthy }797 end798 context 'settings.sl_browser_name = :firefox' do799 before { allow(settings).to receive(:sl_browser_name) { :firefox } }800 it { is_expected.to be_falsey }801 end802 context 'settings.sl_browser_name is not specified' do803 before { allow(settings).to receive(:sl_browser_name) { nil } }804 it do805 expect(log).to receive(:error).with(806 Howitzer::SlBrowserNotSpecifiedError,807 'Please check your settings'808 ).once.and_call_original809 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)810 end811 end812 end813 context 'when sauce_driver? is FALSE' do814 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }815 context 'when selenium_driver? is TRUE' do816 let(:selenium_driver) { true }817 context 'settings.sel_browser = :safari' do818 before { allow(settings).to receive(:sel_browser) { :safari } }819 it { is_expected.to be_truthy }820 end821 context 'settings.sel_browser = :firefox' do822 before { allow(settings).to receive(:sel_browser) { :firefox } }823 it { is_expected.to be_falsey }824 end825 context 'settings.sel_browser is not specified' do826 before { allow(settings).to receive(:sel_browser) { nil } }827 it do828 expect(log).to receive(:error).with(829 Howitzer::SelBrowserNotSpecifiedError,830 'Please check your settings'831 ).once.and_call_original832 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)833 end834 end835 end836 context 'when selenium_driver? is FALSE' do837 it { is_expected.to be_falsey }838 end839 end840 context 'when testingbot_driver? is TRUE' do841 let(:testingbot_driver) { true }842 before { allow(settings).to receive(:testingbot_driver?) { testingbot_driver } }843 context 'settings.tb_browser_name = :safari' do844 before do845 allow(settings).to receive(:tb_browser_name) { :safari }846 allow(settings).to receive(:tb_browser_version) { 9 }847 end848 it { is_expected.to be_truthy }849 end850 context 'settings.tb_browser_name = :iexplore' do851 before do852 allow(settings).to receive(:tb_browser_name) { :iexplore }853 allow(settings).to receive(:tb_browser_version) { 9 }854 end855 it { is_expected.to be_falsey }856 end857 context 'settings.tb_browser_name is not specified' do858 before { allow(settings).to receive(:tb_browser_name) { nil } }859 it do860 expect(log).to receive(:error).with(861 Howitzer::TbBrowserNotSpecifiedError,862 'Please check your settings'863 ).once.and_call_original864 expect { subject }.to raise_error(Howitzer::TbBrowserNotSpecifiedError)865 end866 end867 end868 context 'when testingbot_driver? is FALSE' do869 before { allow(self).to receive(:sauce_driver?) { sauce_driver } }870 context 'when sauce_driver? is TRUE' do871 let(:sauce_driver) { true }872 context 'settings.sl_browser_name = :safari' do873 before { allow(settings).to receive(:sl_browser_name) { :safari } }874 it { is_expected.to be_truthy }875 end876 context 'settings.sl_browser_name = :firefox' do877 before { allow(settings).to receive(:sl_browser_name) { :firefox } }878 it { is_expected.to be_falsey }879 end880 context 'settings.sl_browser_name is not specified' do881 before { allow(settings).to receive(:sl_browser_name) { nil } }882 it do883 expect(log).to receive(:error).with(884 Howitzer::SlBrowserNotSpecifiedError,885 'Please check your settings'886 ).once.and_call_original887 expect { subject }.to raise_error(Howitzer::SlBrowserNotSpecifiedError)888 end889 end890 end891 end892 context 'when selenium_driver? is TRUE' do893 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }894 context 'when selenium_driver? is TRUE' do895 let(:selenium_driver) { true }896 context 'settings.sel_browser = :safari' do897 before { allow(settings).to receive(:sel_browser) { :safari } }898 it { is_expected.to be_truthy }899 end900 context 'settings.sel_browser = :firefox' do901 before { allow(settings).to receive(:sel_browser) { :firefox } }902 it { is_expected.to be_falsey }903 end904 context 'settings.sel_browser is not specified' do905 before { allow(settings).to receive(:sel_browser) { nil } }906 it do907 expect(log).to receive(:error).with(908 Howitzer::SelBrowserNotSpecifiedError,909 'Please check your settings'910 ).once.and_call_original911 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)912 end913 end914 end915 end916 context 'when selenium_driver? is FALSE' do917 before { allow(self).to receive(:selenium_driver?) { selenium_driver } }918 context 'when selenium_driver? is TRUE' do919 let(:selenium_driver) { true }920 context 'settings.sel_browser = :safari' do921 before { allow(settings).to receive(:sel_browser) { :safari } }922 it { is_expected.to be_truthy }923 end924 context 'settings.sel_browser = :firefox' do925 before { allow(settings).to receive(:sel_browser) { :firefox } }926 it { is_expected.to be_falsey }927 end928 context 'settings.sel_browser is not specified' do929 before { allow(settings).to receive(:sel_browser) { nil } }930 it do931 expect(log).to receive(:error).with(932 Howitzer::SelBrowserNotSpecifiedError,933 'Please check your settings'934 ).once.and_call_original935 expect { subject }.to raise_error(Howitzer::SelBrowserNotSpecifiedError)936 end937 end938 end939 context 'when selenium_driver? is FALSE' do940 it { is_expected.to be_falsey }941 end942 end943 end944 describe '#app_url' do945 subject { app_url }946 before do947 allow(settings).to receive(:app_base_auth_login) { app_base_auth_login_setting }948 allow(settings).to receive(:app_base_auth_pass) { app_base_auth_pass_setting }949 allow(settings).to receive(:app_protocol) { app_protocol_setting }950 allow(settings).to receive(:app_host) { app_host_setting }951 end952 let(:app_protocol_setting) { nil }953 let(:app_host_setting) { 'redmine.strongqa.com' }954 context 'when login and password present' do955 let(:app_base_auth_login_setting) { 'alex' }956 let(:app_base_auth_pass_setting) { 'pa$$w0rd' }957 it { is_expected.to eq('http://alex:pa$$w0rd@redmine.strongqa.com') }958 end959 context 'when login and password blank' do960 let(:app_base_auth_login_setting) { '' }961 let(:app_base_auth_pass_setting) { '' }962 it { is_expected.to eq('http://redmine.strongqa.com') }963 end964 end965 describe '#app_base_url' do966 subject { app_base_url(prefix) }967 before do968 allow(settings).to receive(:app_protocol) { app_protocol_setting }969 allow(settings).to receive(:app_host) { app_host_setting }970 end971 let(:app_protocol_setting) { nil }972 let(:app_host_setting) { 'redmine.strongqa.com' }973 context 'when login and password present' do974 let(:prefix) { 'alex:pa$$w0rd@' }975 it { is_expected.to eq('http://alex:pa$$w0rd@redmine.strongqa.com') }976 end977 context 'when login and password blank' do978 let(:prefix) { nil }979 it { is_expected.to eq('http://redmine.strongqa.com') }980 end981 end982 describe '#duration' do983 context 'when more than hour' do984 it { expect(duration(10_000)).to eq('[2h 46m 40s]') }985 end986 context 'when 1 hour exactly' do987 it { expect(duration(3600)).to eq('[1h 0m 0s]') }988 end989 context 'when 0 hours and more than minute' do990 it { expect(duration(2000)).to eq('[33m 20s]') }991 end992 context 'when 1 minute exactly' do993 it { expect(duration(60)).to eq('[1m 0s]') }994 end995 context 'when less than minute' do996 it { expect(duration(45)).to eq('[0m 45s]') }997 end998 context 'when zero' do999 it { expect(duration(0)).to eq('[0m 0s]') }1000 end1001 end1002 describe '#ri' do1003 subject { ri 'boom' }1004 it { expect { subject }.to raise_error(RuntimeError, /boom/) }1005 end1006 describe String do1007 let(:page_name) { 'my' }1008 let(:page_object) { double }1009 before { stub_const('MyPage', page_object) }1010 describe '#open' do1011 subject { page_name.open(:exit) }1012 before do1013 expect(page_object).to receive(:open).with(:exit).once1014 end1015 it { is_expected.to be_nil }1016 end1017 describe '#given' do1018 subject { page_name.given }1019 before do1020 allow(page_name).to receive(:as_page_class) { page_object }1021 expect(page_object).to receive(:given).once1022 end1023 it { is_expected.to be_nil }1024 end1025 describe '#wait_for_opened' do1026 subject { page_name.wait_for_opened }1027 before do1028 allow(page_name).to receive(:as_page_class) { page_object }1029 expect(page_object).to receive(:wait_for_opened).once1030 end1031 it { is_expected.to be_nil }1032 end1033 describe '#as_page_class' do1034 subject { page_name.as_page_class }1035 context 'when 1 word' do1036 it { is_expected.to eql(page_object) }1037 end1038 context 'when more 1 word' do1039 let(:page_name) { 'my super mega' }1040 before { stub_const('MySuperMegaPage', page_object) }1041 it { is_expected.to eql(page_object) }1042 end1043 context 'when plural word' do1044 let(:page_name) { 'user notifications' }1045 before { stub_const('UserNotificationsPage', page_object) }1046 it { is_expected.to eql(page_object) }1047 end1048 end1049 describe '#as_email_class' do1050 subject { email_name.as_email_class }1051 let(:my_email) { double }1052 context 'when 1 word' do1053 let(:email_name) { 'my' }1054 before { stub_const('MyEmail', my_email) }1055 it { is_expected.to eql(my_email) }1056 end1057 context 'when more 1 word' do1058 let(:email_name) { 'my super mega' }1059 before { stub_const('MySuperMegaEmail', my_email) }1060 it { is_expected.to eql(my_email) }1061 end1062 context 'when plural word' do1063 let(:email_name) { 'email notifications' }1064 before { stub_const('EmailNotificationsEmail', my_email) }...
page_validator_spec.rb
Source:page_validator_spec.rb
2require 'howitzer/utils/page_validator'3require 'howitzer/utils/locator_store'4RSpec.describe Howitzer::Utils::PageValidator do5 describe '.validations' do6 it { expect(subject.validations).to eql({}) }7 end8end9RSpec.describe 'PageValidator' do10 let(:web_page_class) do11 Class.new do12 include LocatorStore13 include Howitzer::Utils::PageValidator14 def self.name15 'TestWebPageClass'16 end17 end18 end19 let(:web_page) { web_page_class.new }20 describe '#check_validations_are_defined!' do21 subject { web_page.check_validations_are_defined! }22 context 'when no validation specified' do23 it do24 expect(log).to receive(:error).with(25 Howitzer::NoValidationError,26 "No any page validation was found for 'TestWebPageClass' page"27 ).once.and_call_original28 expect { subject }.to raise_error(Howitzer::NoValidationError)29 end30 end31 context 'when title validation is specified' do32 before do33 web_page.class.validate :title, pattern: /Foo/34 end35 it { expect { subject }.to_not raise_error }36 end37 context 'when url validation is specified' do38 before do39 web_page.class.validate :url, pattern: /Foo/40 end41 it { expect { subject }.to_not raise_error }42 end43 context 'when element_presence validation is specified' do44 before do45 web_page.class.validate :element_presence, locator: :test_locator46 end47 it { expect { subject }.to_not raise_error }48 end49 end50 describe '.validate' do51 before do52 Howitzer::Utils::PageValidator.validations[web_page.class.name] = nil53 end54 subject { web_page.class.validate(name, options) }55 context 'when name = :url' do56 context 'as string' do57 let(:name) { 'url' }58 context 'when options is correct' do59 context '(as string)' do60 let(:options) { { 'pattern' => /foo/ } }61 it do62 is_expected.to be_a(Proc)63 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:url]).to be_a Proc64 end65 end66 context '(as symbol)' do67 let(:options) { { pattern: /foo/ } }68 it do69 is_expected.to be_a(Proc)70 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:url]).to be_a Proc71 end72 end73 end74 context 'when options is incorrect' do75 context '(missing pattern)' do76 let(:options) { {} }77 it do78 expect(log).to receive(:error).with(79 Howitzer::WrongOptionError,80 "Please specify ':pattern' option as Regexp object"81 ).once.and_call_original82 expect { subject }.to raise_error(Howitzer::WrongOptionError)83 end84 end85 context '(string pattern)' do86 let(:options) { { pattern: 'foo' } }87 it do88 expect(log).to receive(:error).with(89 Howitzer::WrongOptionError,90 "Please specify ':pattern' option as Regexp object"91 ).once.and_call_original92 expect { subject }.to raise_error(Howitzer::WrongOptionError)93 end94 end95 context '(not hash)' do96 let(:options) { 'foo' }97 it { expect { subject }.to raise_error(TypeError, "Expected options to be Hash, actual is 'String'") }98 end99 end100 end101 context 'as symbol' do102 let(:name) { :url }103 let(:options) { { pattern: /foo/ } }104 it do105 is_expected.to be_a(Proc)106 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:url]).to be_a Proc107 end108 end109 end110 context 'when name = :element_presence' do111 let(:name) { :element_presence }112 context 'when options is correct' do113 context '(as string)' do114 let(:options) { { 'locator' => 'test_locator' } }115 it do116 is_expected.to be_a(Proc)117 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:element_presence]).to eql(subject)118 end119 end120 context '(as symbol)' do121 let(:options) { { locator: :test_locator } }122 it do123 is_expected.to be_a(Proc)124 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:element_presence]).to eql(subject)125 end126 end127 end128 context 'when options is incorrect' do129 context '(missing locator)' do130 let(:options) { {} }131 it do132 expect(log).to receive(:error).with(133 Howitzer::WrongOptionError,134 "Please specify ':locator' option as one of page locator names"135 ).once.and_call_original136 expect { subject }.to raise_error(Howitzer::WrongOptionError)137 end138 end139 context '(blank locator name)' do140 let(:options) { { locator: '' } }141 it do142 expect(log).to receive(:error).with(143 Howitzer::WrongOptionError,144 "Please specify ':locator' option as one of page locator names"145 ).once.and_call_original146 expect { subject }.to raise_error(Howitzer::WrongOptionError)147 end148 end149 end150 end151 context 'when name = :title' do152 let(:name) { :title }153 context 'when options is correct' do154 context '(as string)' do155 let(:options) { { 'pattern' => /foo/ } }156 it do157 is_expected.to be_a(Proc)158 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:title]).to be_a Proc159 end160 end161 context '(as symbol)' do162 let(:options) { { pattern: /foo/ } }163 it do164 is_expected.to be_a(Proc)165 expect(Howitzer::Utils::PageValidator.validations[web_page.class.name][:title]).to be_a Proc166 end167 end168 end169 context 'when options is incorrect' do170 context '(missing pattern)' do171 let(:options) { {} }172 it do173 expect(log).to receive(:error).with(174 Howitzer::WrongOptionError,175 "Please specify ':pattern' option as Regexp object"176 ).once.and_call_original177 expect { subject }.to raise_error(Howitzer::WrongOptionError)178 end179 end180 context '(string pattern)' do181 let(:options) { { pattern: 'foo' } }182 it do183 expect(log).to receive(:error).with(184 Howitzer::WrongOptionError,185 "Please specify ':pattern' option as Regexp object"186 ).once.and_call_original187 expect { subject }.to raise_error(Howitzer::WrongOptionError)188 end189 end190 end191 end192 context 'when other name' do193 let(:name) { :unknown }194 let(:options) { {} }195 it do196 expect(log).to receive(:error).with(197 Howitzer::UnknownValidationError,198 "unknown 'unknown' validation type"199 ).once.and_call_original200 expect { subject }.to raise_error(Howitzer::UnknownValidationError)201 end202 end203 end204 describe '.pages' do205 subject { Howitzer::Utils::PageValidator.pages }206 it { is_expected.to eq([]) }207 it do208 subject << Class209 is_expected.to eql([Class])210 end211 end212 describe '.opened?' do213 subject { web_page_class.opened? }214 context 'when no one validation is defined' do215 it do216 expect(log).to receive(:error).with(217 Howitzer::NoValidationError,218 "No any page validation was found for 'TestWebPageClass' page"219 ).once.and_call_original220 expect { subject }.to raise_error(Howitzer::NoValidationError)221 end222 end223 context 'when all validations are defined' do224 before do225 web_page_class.class_eval do226 add_locator :login, '#id'227 validate :url, pattern: /foo/228 validate :title, pattern: /Foo page/229 validate :element_presence, locator: :login230 end231 end232 context 'when all matches' do233 before do234 allow(web_page_class).to receive(:current_url) { 'http://test.com/foo' }235 allow(web_page_class).to receive(:title) { 'Foo page' }236 allow(web_page_class).to receive(:first_element).with(:login) { true }237 end238 it { is_expected.to be_truthy }239 end240 context 'when first does not match' do241 before do242 expect(web_page_class).to receive(:current_url).once { 'http://test.com/bar' }243 expect(web_page_class).to receive(:title).never244 expect(web_page_class).to receive(:first_element).never245 end246 it { is_expected.to be_falsey }247 end248 end249 end250 describe '#matched_pages' do251 let!(:web_page1_class) do252 Class.new do253 include Howitzer::Utils::PageValidator254 def self.name255 'TestWebPage1Class'256 end257 def self.opened?258 true259 end260 end261 end262 let!(:web_page2_class) do263 Class.new do264 include Howitzer::Utils::PageValidator265 def self.name266 'TestWebPage2Class'267 end268 def self.opened?269 false270 end271 end272 end273 subject { web_page2_class.matched_pages }274 before { Howitzer::Utils::PageValidator.instance_variable_set(:@pages, [web_page1_class, web_page2_class]) }275 it { is_expected.to eq([web_page1_class]) }276 end277end
mailgun.rb
Source:mailgun.rb
...3require 'howitzer/mail_adapters/abstract'4module MailAdapters5 # This class represents Mailgun mail adapter6 class Mailgun < Abstract7 def self.find(recipient, subject)8 message = {}9 retryable(find_retry_params) { message = retrieve_message(recipient, subject) }10 log.error(11 ::Howitzer::EmailNotFoundError,12 "Message with subject '#{subject}' for recipient '#{recipient}' was not found."13 ) if message.empty?14 new(message)15 end16 def self.events17 ::Mailgun::Connector.instance.client.get("#{::Mailgun::Connector.instance.domain}/events", event: 'stored')18 end19 private_class_method :events20 def self.event_by(recipient, subject)21 events.to_h['items'].find do |hash|22 hash['message']['recipients'].first == recipient && hash['message']['headers']['subject'] == subject23 end24 end25 private_class_method :event_by26 def self.find_retry_params27 {28 timeout: settings.timeout_mailgun,29 sleep: settings.timeout_short,30 silent: true,31 logger: log,32 on: ::Howitzer::EmailNotFoundError33 }34 end35 private_class_method :find_retry_params36 def self.retrieve_message(recipient, subject)37 event = event_by(recipient, subject)38 fail ::Howitzer::EmailNotFoundError, 'Message not received yet, retry...' unless event39 message_url = event['storage']['url']40 ::Mailgun::Connector.instance.client.get_url(message_url).to_h41 end42 private_class_method :retrieve_message43 def plain_text_body44 message['body-plain']45 end46 def html_body47 message['stripped-html']48 end49 def text50 message['stripped-text']51 end...
subject
Using AI Code Generation
1Howitzer::Web::MainPage.on { subject }2Howitzer::Web::MainPage.on { subject.title }3Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }4Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }5Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }6Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }7Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }8Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }
subject
Using AI Code Generation
1Howitzer::Web::MainPage.on { subject }2Howitzer::Web::MainPage.on { subject.title }3Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }4Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }5Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }6Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }7Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }8Howitzer::Web::MainPage.on { subject.title.include? 'Howitzer' }
subject
Using AI Code Generation
1Howitzer.subject('my subject')2Howitzer.subject('my subject')3Howitzer.subject('my subject')4Howitzer.subject('my subject')5Howitzer.subject('my subject')6Howitzer.subject('my subject')7Howitzer.subject('my subject')8Howitzer.ubject('my subjec')9Howitzer.subject('my subject')
subject
Using AI Code Generation
1 subject { Howitzer::Web::MainPage }2 subject { Howitzer::Web::MainPage.new }3 subject { Howitzer::Web::MainPage.new('test') }4 subject { Howitzer::Web::MainPage.new('test', 'test') }5 subject { Howitzer::Web::MainPage.new('test', 'test', 'test') }6 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test') }7 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test') }8 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test') }9 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test') }10 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test', 'test') }11 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test') }12 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test') }13 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test') }14 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test') }15 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test') }16 subject { Howitzer::Web::MainPage.new('test', 'test', 'test', 'test
subject
Using AI Code Generation
1Howitzer.subject('my subject')2Howitzer.subject('my subject')3Howitzer.subject('my subject')4Howitzer.subject('my subject')5Howitzer.subject('my subject')6Howitzer.subject('my subject')7Howitzer.subject('my subject')8Howitzer.subject('my subject')9Howitzer.subject('my subject')
subject
Using AI Code Generation
1 subject { Howitzer }2 it { is_expected.to respond_to :subject }3 it { is_expected.to respond_to :subject }4 it { expect(Howitzer).to respond_to :subject }5 it { expect(subject).to respond_to :subject }6 it { expect(Howitzer.subject).to respond_to :subject }7 it { expect(subject.subject).to respond_to :subject }8 it { expect(subject).to respond_to :subject }9 it { expect(subject).to respond_to :subject }
subject
Using AI Code Generation
1 Cucumber::RbSupport::RbLanguage.new(self)2 Cucumber::RbSupport::RbLanguage.new(self)3 Cucumber::RbSupport::RbLanguage.new(self)4 Cucumber::RbSupport::RbLanguage.new(self)5 Cucumber::RbSupport::RbLanguage.new(self)6 Cucumber::RbSupport::RbLanguage.new(self)
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!