From b95e694c7f95be3173373b5acb2d210e661faaae Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 25 Apr 2017 18:45:11 +0300 Subject: [PATCH] add some basic prefs UI tests --- tests/functional/basic.php | 2 +- tests/functional/prefs.php | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/functional/prefs.php diff --git a/tests/functional/basic.php b/tests/functional/basic.php index 19d9ca8d2..8f35692d3 100644 --- a/tests/functional/basic.php +++ b/tests/functional/basic.php @@ -9,7 +9,7 @@ class BasicTest extends PHPUnit_Extensions_Selenium2TestCase { } public function setUpPage() { - $this->timeouts()->implicitWait(10000); + $this->timeouts()->implicitWait(5000); } public function testLogin() { diff --git a/tests/functional/prefs.php b/tests/functional/prefs.php new file mode 100644 index 000000000..4f2dea4b7 --- /dev/null +++ b/tests/functional/prefs.php @@ -0,0 +1,42 @@ +setHost('localhost'); + $this->setPort(4444); + $this->setBrowserUrl('http://localhost/tt-rss/'); + $this->setBrowser('firefox'); + } + + public function setUpPage() { + $this->timeouts()->implicitWait(5000); + } + + public function testLogin() { + $this->url('/prefs.php'); + + $this->byName("login")->value('admin'); + $this->byName("password")->value('password'); + $this->byCssSelector('#dijit_form_Button_0_label')->click(); + + $this->byCssSelector('#ttrssPrefs')->displayed(); + } + + public function testTabs() { + + $this->byCssSelector("#dijit_layout_AccordionPane_1_wrapper")->displayed(); + + /* feeds */ + $this->execute(["script" => "selectTab('feedConfig');", "args" => []]); + $this->byCssSelector("div.dijitTreeContainer > div.dijitTreeNode")->displayed(); + + /* filters */ + $this->execute(["script" => "selectTab('filterConfig');", "args" => []]); + $this->byCssSelector("div.dijitTreeContainer > div.dijitTreeNode")->displayed(); + + /* filters */ + $this->execute(["script" => "selectTab('labelConfig');", "args" => []]); + $this->byCssSelector("div.dijitTreeContainer > div.dijitTreeNode")->displayed(); + + } +}