AngularCest.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. class AngularCest
  3. {
  4. public function _before(AngularGuy $I)
  5. {
  6. $I->amOnPage('/');
  7. }
  8. public function followLinks(AngularGuy $I)
  9. {
  10. $I->click('Get more info!');
  11. $I->see('About', 'h1');
  12. $I->seeInCurrentUrl('#/info');
  13. $I->expect('Angular scope is rendered');
  14. $I->see('Welcome to event app', 'p');
  15. $I->click('Back to form');
  16. $I->see('Create Event', 'h1');
  17. }
  18. public function fillFieldByName(AngularGuy $I)
  19. {
  20. $I->see('Create Event', 'h1');
  21. $I->fillField('Name', 'davert');
  22. $I->submit();
  23. $I->dontSee('Please wait');
  24. $I->see('Thank you');
  25. $I->see('davert', '#data');
  26. $I->seeInFormResult(['name' => 'davert']);
  27. }
  28. /**
  29. * @depends fillFieldByName
  30. * @param AngularGuy $I
  31. */
  32. public function fillFieldByPlaceholder(AngularGuy $I)
  33. {
  34. $I->fillField('Please enter a name', 'davert');
  35. $I->submit();
  36. $I->seeInFormResult(['name' => 'davert']);
  37. }
  38. /**
  39. * @depends fillFieldByName
  40. * @param AngularGuy $
  41. */
  42. public function fillRadioByLabel(AngularGuy $I)
  43. {
  44. $I->checkOption('Free');
  45. $I->submit();
  46. $I->seeInFormResult(['price' => '0']);
  47. }
  48. public function fillInWysiwyg(AngularGuy $I)
  49. {
  50. $I->expect('i can edit editable divs');
  51. $I->fillField('.cke_editable', 'Hello world');
  52. $I->wait(1);
  53. $I->submit();
  54. $I->seeInFormResult(['htmldesc' => "<p>Hello world</p>\n"]);
  55. }
  56. public function fillSelect(AngularGuy $I)
  57. {
  58. $I->selectOption('Guest Speaker', 'Iron Man');
  59. $I->submit();
  60. $I->seeInFormResult(["speaker1" => "iron_man"]);
  61. }
  62. }