BasicTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. class BasicTest extends PHPUnit_Extensions_Selenium2TestCase {
  3. public function setUp() {
  4. $this->setHost('localhost');
  5. $this->setPort(4444);
  6. $this->setBrowserUrl('http://localhost/tt-rss/');
  7. $this->setBrowser('firefox');
  8. }
  9. public function setUpPage() {
  10. $this->timeouts()->implicitWait(5000);
  11. }
  12. public function testLogin() {
  13. $this->url('/index.php');
  14. $this->byName("login")->value('admin');
  15. $this->byName("password")->value('password');
  16. $this->byCssSelector('#dijit_form_Button_0_label')->click();
  17. $this->byCssSelector('#feedTree')->displayed();
  18. }
  19. public function testBasicDialogs() {
  20. $this->testLogin();
  21. $this->execute(["script" => "Filters.quickAddFilter()", "args" => []]);
  22. $this->byCssSelector("#filterEditDlg")->displayed();
  23. $this->execute(["script" => "dijit.byId('filterEditDlg').hide();", "args" => []]);
  24. $this->execute(["script" => "CommonDialog.quickAddFeed()", "args" => []]);
  25. $this->byCssSelector("#feedAddDlg")->displayed();
  26. $this->execute(["script" => "dijit.byId('feedAddDlg').hide();", "args" => []]);
  27. }
  28. public function testOpenFeed() {
  29. $this->testLogin();
  30. $this->byCssSelector('#dijit__TreeNode_3')->click();
  31. $this->byCssSelector('#RROW-1 > .header')->displayed();
  32. }
  33. }