Test Setup Failed
Push — master ( 2261e5...599f56 )
by Stiofan
02:03
created
tests/selenium/stest-23_Check_PinPoint.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,37 +1,37 @@
 block discarded – undo
1 1
 <?php
2 2
 class CheckPinpoint extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testCheckPinpoint()
18
-    {
19
-        $this->logInfo('Checking pin point......');
20
-        $this->url(self::GDTEST_BASE_URL.'places/');
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->ExecuteScript('jQuery("a.geodir-pinpoint-link").trigger("mouseover");');
23
-        $this->waitForPageLoadAndCheckForErrors(5000);
24
-        $this->ExecuteScript('jQuery("a.geodir-pinpoint-link").trigger("mouseout");');
25
-    }
17
+	public function testCheckPinpoint()
18
+	{
19
+		$this->logInfo('Checking pin point......');
20
+		$this->url(self::GDTEST_BASE_URL.'places/');
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->ExecuteScript('jQuery("a.geodir-pinpoint-link").trigger("mouseover");');
23
+		$this->waitForPageLoadAndCheckForErrors(5000);
24
+		$this->ExecuteScript('jQuery("a.geodir-pinpoint-link").trigger("mouseout");');
25
+	}
26 26
 
27
-    public function tearDown()
28
-    {
29
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
30
-            //write current file number to completed.txt
31
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
32
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
33
-            fwrite($completed, $CurrentFileNumber);
34
-        }
35
-    }
27
+	public function tearDown()
28
+	{
29
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
30
+			//write current file number to completed.txt
31
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
32
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
33
+			fwrite($completed, $CurrentFileNumber);
34
+		}
35
+	}
36 36
 }
37 37
 ?>
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
tests/selenium/stest-32_Social_Importer.php 2 patches
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -1,113 +1,113 @@
 block discarded – undo
1 1
 <?php
2 2
 class SocialImporter extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
16
-
17
-    public function testSocialImporter()
18
-    {
19
-        $this->logInfo('Testing social importer......');
20
-        //make sure Social Importer plugin active
21
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
-        $this->waitForPageLoadAndCheckForErrors();
23
-
24
-        $is_active = $this->byId("geodirectory-social-importer")->attribute('class');
25
-        if (is_int(strpos($is_active, 'inactive'))) {
26
-            //Activate Geodirectory Social Importer
27
-            $this->maybeActivatePlugin("geodirectory-social-importer", 20000);
28
-            //go back to plugin page
29
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
-        }
31
-
32
-        $is_active1 = $this->byId("geodirectory-social-importer")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "Social Importer plugin not active");
34
-
35
-        $stop_script = false;
36
-
37
-        $fb_app_id  = getenv( 'FACEBOOK_APP_ID' );
38
-        $fb_app_secret  = getenv( 'FACEBOOK_APP_SECRET' );
39
-        $yelp_key  = getenv( 'YELP_KEY' );
40
-        $yelp_key_secret  = getenv( 'YELP_KEY_SECRET' );
41
-        $yelp_token  = getenv( 'YELP_TOKEN' );
42
-        $yelp_token_secret  = getenv( 'YELP_TOKEN_SECRET' );
43
-
44
-        if (!$fb_app_id) {
45
-            $this->logError("ENV variable FACEBOOK_APP_ID not available");
46
-            $stop_script = true;
47
-        }
48
-
49
-        if (!$fb_app_secret) {
50
-            $this->logError("ENV variable FACEBOOK_APP_SECRET not available");
51
-            $stop_script = true;
52
-        }
53
-
54
-        if (!$yelp_key) {
55
-            $this->logError("ENV variable YELP_KEY not available");
56
-            $stop_script = true;
57
-        }
58
-
59
-        if (!$yelp_key_secret) {
60
-            $this->logError("ENV variable YELP_KEY_SECRET not available");
61
-            $stop_script = true;
62
-        }
63
-
64
-        if (!$yelp_token) {
65
-            $this->logError("ENV variable YELP_TOKEN not available");
66
-            $stop_script = true;
67
-        }
68
-
69
-        if (!$yelp_token_secret) {
70
-            $this->logError("ENV variable YELP_TOKEN_SECRET not available");
71
-            $stop_script = true;
72
-        }
73
-
74
-        if($stop_script) {
75
-            $this->logInfo("Stopping the script. Please fix the errors to continue");
76
-            return;
77
-        }
78
-
79
-        // facebook
80
-        $this->url(self::GDTEST_BASE_URL.'admin.php?page=geodirectory&tab=facebook_integration&subtab=geodir_gdfi_options');
81
-        $this->byId('gdfi_app_id')->value($fb_app_id);
82
-        $this->byId('gdfi_app_secret')->value($fb_app_secret);
83
-        $this->byName('gdfi_facebook_integration_options_save')->click();
84
-        $this->waitForPageLoadAndCheckForErrors();
85
-
86
-        //yelp
87
-        $this->url(self::GDTEST_BASE_URL.'admin.php?page=geodirectory&tab=facebook_integration&subtab=manage_gdfi_options_yelp');
88
-        $this->byId('gdfi_yelp_key')->value($yelp_key);
89
-        $this->byId('gdfi_yelp_key_secret')->value($yelp_key_secret);
90
-        $this->byId('gdfi_yelp_token')->value($yelp_token);
91
-        $this->byId('gdfi_yelp_token_secret')->value($yelp_token_secret);
92
-        $this->byName('gdfi_yelp_integration_options_save')->click();
93
-        $this->waitForPageLoadAndCheckForErrors();
94
-
95
-        // import listing
96
-        $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
97
-        $this->byId('gdfi_import_url')->value('http://www.yelp.com/biz/mcdonalds-mountain-view-3');
98
-        $this->byId('gd_facebook_import')->click();
99
-
100
-
101
-    }
102
-
103
-    public function tearDown()
104
-    {
105
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
106
-            //write current file number to completed.txt
107
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
108
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
109
-            fwrite($completed, $CurrentFileNumber);
110
-        }
111
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16
+
17
+	public function testSocialImporter()
18
+	{
19
+		$this->logInfo('Testing social importer......');
20
+		//make sure Social Importer plugin active
21
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
+		$this->waitForPageLoadAndCheckForErrors();
23
+
24
+		$is_active = $this->byId("geodirectory-social-importer")->attribute('class');
25
+		if (is_int(strpos($is_active, 'inactive'))) {
26
+			//Activate Geodirectory Social Importer
27
+			$this->maybeActivatePlugin("geodirectory-social-importer", 20000);
28
+			//go back to plugin page
29
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
+		}
31
+
32
+		$is_active1 = $this->byId("geodirectory-social-importer")->attribute('class');
33
+		$this->assertFalse( strpos($is_active1, 'inactive'), "Social Importer plugin not active");
34
+
35
+		$stop_script = false;
36
+
37
+		$fb_app_id  = getenv( 'FACEBOOK_APP_ID' );
38
+		$fb_app_secret  = getenv( 'FACEBOOK_APP_SECRET' );
39
+		$yelp_key  = getenv( 'YELP_KEY' );
40
+		$yelp_key_secret  = getenv( 'YELP_KEY_SECRET' );
41
+		$yelp_token  = getenv( 'YELP_TOKEN' );
42
+		$yelp_token_secret  = getenv( 'YELP_TOKEN_SECRET' );
43
+
44
+		if (!$fb_app_id) {
45
+			$this->logError("ENV variable FACEBOOK_APP_ID not available");
46
+			$stop_script = true;
47
+		}
48
+
49
+		if (!$fb_app_secret) {
50
+			$this->logError("ENV variable FACEBOOK_APP_SECRET not available");
51
+			$stop_script = true;
52
+		}
53
+
54
+		if (!$yelp_key) {
55
+			$this->logError("ENV variable YELP_KEY not available");
56
+			$stop_script = true;
57
+		}
58
+
59
+		if (!$yelp_key_secret) {
60
+			$this->logError("ENV variable YELP_KEY_SECRET not available");
61
+			$stop_script = true;
62
+		}
63
+
64
+		if (!$yelp_token) {
65
+			$this->logError("ENV variable YELP_TOKEN not available");
66
+			$stop_script = true;
67
+		}
68
+
69
+		if (!$yelp_token_secret) {
70
+			$this->logError("ENV variable YELP_TOKEN_SECRET not available");
71
+			$stop_script = true;
72
+		}
73
+
74
+		if($stop_script) {
75
+			$this->logInfo("Stopping the script. Please fix the errors to continue");
76
+			return;
77
+		}
78
+
79
+		// facebook
80
+		$this->url(self::GDTEST_BASE_URL.'admin.php?page=geodirectory&tab=facebook_integration&subtab=geodir_gdfi_options');
81
+		$this->byId('gdfi_app_id')->value($fb_app_id);
82
+		$this->byId('gdfi_app_secret')->value($fb_app_secret);
83
+		$this->byName('gdfi_facebook_integration_options_save')->click();
84
+		$this->waitForPageLoadAndCheckForErrors();
85
+
86
+		//yelp
87
+		$this->url(self::GDTEST_BASE_URL.'admin.php?page=geodirectory&tab=facebook_integration&subtab=manage_gdfi_options_yelp');
88
+		$this->byId('gdfi_yelp_key')->value($yelp_key);
89
+		$this->byId('gdfi_yelp_key_secret')->value($yelp_key_secret);
90
+		$this->byId('gdfi_yelp_token')->value($yelp_token);
91
+		$this->byId('gdfi_yelp_token_secret')->value($yelp_token_secret);
92
+		$this->byName('gdfi_yelp_integration_options_save')->click();
93
+		$this->waitForPageLoadAndCheckForErrors();
94
+
95
+		// import listing
96
+		$this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place');
97
+		$this->byId('gdfi_import_url')->value('http://www.yelp.com/biz/mcdonalds-mountain-view-3');
98
+		$this->byId('gd_facebook_import')->click();
99
+
100
+
101
+	}
102
+
103
+	public function tearDown()
104
+	{
105
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
106
+			//write current file number to completed.txt
107
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
108
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
109
+			fwrite($completed, $CurrentFileNumber);
110
+		}
111
+	}
112 112
 }
113 113
 ?>
114 114
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
         }
31 31
 
32 32
         $is_active1 = $this->byId("geodirectory-social-importer")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "Social Importer plugin not active");
33
+        $this->assertFalse(strpos($is_active1, 'inactive'), "Social Importer plugin not active");
34 34
 
35 35
         $stop_script = false;
36 36
 
37
-        $fb_app_id  = getenv( 'FACEBOOK_APP_ID' );
38
-        $fb_app_secret  = getenv( 'FACEBOOK_APP_SECRET' );
39
-        $yelp_key  = getenv( 'YELP_KEY' );
40
-        $yelp_key_secret  = getenv( 'YELP_KEY_SECRET' );
41
-        $yelp_token  = getenv( 'YELP_TOKEN' );
42
-        $yelp_token_secret  = getenv( 'YELP_TOKEN_SECRET' );
37
+        $fb_app_id = getenv('FACEBOOK_APP_ID');
38
+        $fb_app_secret = getenv('FACEBOOK_APP_SECRET');
39
+        $yelp_key = getenv('YELP_KEY');
40
+        $yelp_key_secret = getenv('YELP_KEY_SECRET');
41
+        $yelp_token = getenv('YELP_TOKEN');
42
+        $yelp_token_secret = getenv('YELP_TOKEN_SECRET');
43 43
 
44 44
         if (!$fb_app_id) {
45 45
             $this->logError("ENV variable FACEBOOK_APP_ID not available");
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             $stop_script = true;
72 72
         }
73 73
 
74
-        if($stop_script) {
74
+        if ($stop_script) {
75 75
             $this->logInfo("Stopping the script. Please fix the errors to continue");
76 76
             return;
77 77
         }
Please login to merge, or discard this patch.
tests/selenium/stest-42_Test_Dummy_Data.php 2 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -1,60 +1,60 @@
 block discarded – undo
1 1
 <?php
2 2
 class TestDummyData extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
16
-
17
-    public function testTestDummyData()
18
-    {
19
-        $this->logInfo('Testing dummy data......');
20
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings');
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->byLinkText('Dummy Data')->click();
23
-
24
-        $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
25
-        if (is_int(strpos($html, 'Yes Delete Please!'))) {
26
-            //delete event data
27
-        }
28
-
29
-
30
-        //make sure event manager plugin active
31
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
32
-        $this->waitForPageLoadAndCheckForErrors();
33
-        $is_active = $this->byId("geodirectory-events")->attribute('class');
34
-        $this->assertFalse( strpos($is_active, 'inactive'), "event manager plugin not active");
35
-        if (strpos($is_active, 'inactive')) {
36
-            return;
37
-        }
38
-
39
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings');
40
-        $this->waitForPageLoadAndCheckForErrors();
41
-        $this->byLinkText('Event Dummy Data')->click();
42
-
43
-        $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
44
-        if (is_int(strpos($html, 'Yes Delete Please!'))) {
45
-            //delete event data
46
-        }
47
-
48
-    }
49
-
50
-    public function tearDown()
51
-    {
52
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
53
-            //write current file number to completed.txt
54
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
55
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
56
-            fwrite($completed, $CurrentFileNumber);
57
-        }
58
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16
+
17
+	public function testTestDummyData()
18
+	{
19
+		$this->logInfo('Testing dummy data......');
20
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings');
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->byLinkText('Dummy Data')->click();
23
+
24
+		$html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML');
25
+		if (is_int(strpos($html, 'Yes Delete Please!'))) {
26
+			//delete event data
27
+		}
28
+
29
+
30
+		//make sure event manager plugin active
31
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
32
+		$this->waitForPageLoadAndCheckForErrors();
33
+		$is_active = $this->byId("geodirectory-events")->attribute('class');
34
+		$this->assertFalse( strpos($is_active, 'inactive'), "event manager plugin not active");
35
+		if (strpos($is_active, 'inactive')) {
36
+			return;
37
+		}
38
+
39
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings');
40
+		$this->waitForPageLoadAndCheckForErrors();
41
+		$this->byLinkText('Event Dummy Data')->click();
42
+
43
+		$html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML');
44
+		if (is_int(strpos($html, 'Yes Delete Please!'))) {
45
+			//delete event data
46
+		}
47
+
48
+	}
49
+
50
+	public function tearDown()
51
+	{
52
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
53
+			//write current file number to completed.txt
54
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
55
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
56
+			fwrite($completed, $CurrentFileNumber);
57
+		}
58
+	}
59 59
 }
60 60
 ?>
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
32 32
         $this->waitForPageLoadAndCheckForErrors();
33 33
         $is_active = $this->byId("geodirectory-events")->attribute('class');
34
-        $this->assertFalse( strpos($is_active, 'inactive'), "event manager plugin not active");
34
+        $this->assertFalse(strpos($is_active, 'inactive'), "event manager plugin not active");
35 35
         if (strpos($is_active, 'inactive')) {
36 36
             return;
37 37
         }
Please login to merge, or discard this patch.
tests/selenium/base.php 2 patches
Indentation   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -1,199 +1,199 @@
 block discarded – undo
1 1
 <?php
2 2
 class GD_Test extends PHPUnit_Extensions_Selenium2TestCase {
3 3
 
4
-    const GDTEST_BASE_URL = 'http://www.test.ci/selpress/';
5
-
6
-    public function setUp()
7
-    {
8
-        $this->setSeleniumServerRequestsTimeout(300);
9
-        $this->setBrowser('firefox');
10
-        $this->setBrowserUrl(self::GDTEST_BASE_URL);
11
-    }
12
-
13
-    function isTextPresent($search)
14
-    {
15
-        $source = $this->source();
16
-        if ( strpos((string)$source,$search) !== FALSE) {
17
-            return true;
18
-        } else {
19
-            return false;
20
-        }
21
-    }
22
-
23
-    function randomEmailID()
24
-    {
25
-        return md5(uniqid(rand(), true)).'@gmail.com';
26
-    }
27
-
28
-    function waitForPageLoadAndCheckForErrors($timeout=10000)
29
-    {
30
-        // Wait 10 seconds
31
-        $this->timeouts()->implicitWait($timeout);
32
-        $this->checkForErrors();
33
-        $this->checkForJsErrors();
34
-    }
35
-
36
-    function checkForErrors()
37
-    {
38
-        $elements = $this->elements($this->using('css selector')->value('.xdebug-error'));
39
-        if ($elements) {
40
-            $total = count($elements);
41
-            fwrite(STDOUT, $total.' errors found'. PHP_EOL);
42
-            $count = 0;
43
-            foreach ($elements as $i => $element) {
44
-                $count++;
45
-                if ($errors = $element->attribute('innerHTML')) {
46
-                    fwrite(STDOUT, "========================================================================". PHP_EOL);
47
-                    fwrite(STDOUT, strip_tags($errors). PHP_EOL);
48
-                    if ($count == $total) {
49
-                        fwrite(STDOUT, "========================================================================". PHP_EOL);
50
-                    }
51
-                }
52
-            }
53
-        }
54
-    }
55
-
56
-    function checkForJsErrors() {
57
-        if ($this->isElementExists('sel_js_error')) {
58
-            fwrite(STDOUT, 'Javascript errors found'. PHP_EOL);
59
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
60
-            echo $this->byId('sel_js_error')->attribute('innerHTML');
61
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
62
-        }
63
-    }
64
-
65
-    function maybeUserLogin($redirect, $force=false) {
66
-        if ($force) {
67
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/');
68
-            if ($this->isTextPresent("forgetmenot")) {
69
-                $this->byId('user_login')->value('[email protected]');
70
-                $this->byId('user_pass')->value('1');
4
+	const GDTEST_BASE_URL = 'http://www.test.ci/selpress/';
5
+
6
+	public function setUp()
7
+	{
8
+		$this->setSeleniumServerRequestsTimeout(300);
9
+		$this->setBrowser('firefox');
10
+		$this->setBrowserUrl(self::GDTEST_BASE_URL);
11
+	}
12
+
13
+	function isTextPresent($search)
14
+	{
15
+		$source = $this->source();
16
+		if ( strpos((string)$source,$search) !== FALSE) {
17
+			return true;
18
+		} else {
19
+			return false;
20
+		}
21
+	}
22
+
23
+	function randomEmailID()
24
+	{
25
+		return md5(uniqid(rand(), true)).'@gmail.com';
26
+	}
27
+
28
+	function waitForPageLoadAndCheckForErrors($timeout=10000)
29
+	{
30
+		// Wait 10 seconds
31
+		$this->timeouts()->implicitWait($timeout);
32
+		$this->checkForErrors();
33
+		$this->checkForJsErrors();
34
+	}
35
+
36
+	function checkForErrors()
37
+	{
38
+		$elements = $this->elements($this->using('css selector')->value('.xdebug-error'));
39
+		if ($elements) {
40
+			$total = count($elements);
41
+			fwrite(STDOUT, $total.' errors found'. PHP_EOL);
42
+			$count = 0;
43
+			foreach ($elements as $i => $element) {
44
+				$count++;
45
+				if ($errors = $element->attribute('innerHTML')) {
46
+					fwrite(STDOUT, "========================================================================". PHP_EOL);
47
+					fwrite(STDOUT, strip_tags($errors). PHP_EOL);
48
+					if ($count == $total) {
49
+						fwrite(STDOUT, "========================================================================". PHP_EOL);
50
+					}
51
+				}
52
+			}
53
+		}
54
+	}
55
+
56
+	function checkForJsErrors() {
57
+		if ($this->isElementExists('sel_js_error')) {
58
+			fwrite(STDOUT, 'Javascript errors found'. PHP_EOL);
59
+			fwrite(STDOUT, "========================================================================". PHP_EOL);
60
+			echo $this->byId('sel_js_error')->attribute('innerHTML');
61
+			fwrite(STDOUT, "========================================================================". PHP_EOL);
62
+		}
63
+	}
64
+
65
+	function maybeUserLogin($redirect, $force=false) {
66
+		if ($force) {
67
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/');
68
+			if ($this->isTextPresent("forgetmenot")) {
69
+				$this->byId('user_login')->value('[email protected]');
70
+				$this->byId('user_pass')->value('1');
71 71
 //                $this->byId('rememberme')->click();
72
-                // Submit the form
73
-                $this->byId('wp-submit')->submit();
74
-                $this->waitForPageLoadAndCheckForErrors();
75
-            }
76
-        }
77
-        $this->url($redirect);
78
-        $this->waitForPageLoadAndCheckForErrors();
79
-        if ($this->isTextPresent("Sign In")) {
80
-            $this->byId('user_login')->value('[email protected]');
81
-            $this->byId('user_pass')->value('1');
72
+				// Submit the form
73
+				$this->byId('wp-submit')->submit();
74
+				$this->waitForPageLoadAndCheckForErrors();
75
+			}
76
+		}
77
+		$this->url($redirect);
78
+		$this->waitForPageLoadAndCheckForErrors();
79
+		if ($this->isTextPresent("Sign In")) {
80
+			$this->byId('user_login')->value('[email protected]');
81
+			$this->byId('user_pass')->value('1');
82 82
 //            $this->byId('rememberme')->click();
83
-            // Submit the form
84
-            $this->byId('cus_loginform')->submit();
85
-            $this->waitForPageLoadAndCheckForErrors();
86
-            $this->url($redirect);
87
-        }
88
-    }
89
-
90
-    function maybeAdminLogin($redirect) {
91
-        $this->url($redirect);
92
-        $this->waitForPageLoadAndCheckForErrors();
93
-        if ($this->isTextPresent("forgetmenot")) {
94
-            $this->byId('user_login')->value('admin');
95
-            $this->byId('user_pass')->value('admin');
83
+			// Submit the form
84
+			$this->byId('cus_loginform')->submit();
85
+			$this->waitForPageLoadAndCheckForErrors();
86
+			$this->url($redirect);
87
+		}
88
+	}
89
+
90
+	function maybeAdminLogin($redirect) {
91
+		$this->url($redirect);
92
+		$this->waitForPageLoadAndCheckForErrors();
93
+		if ($this->isTextPresent("forgetmenot")) {
94
+			$this->byId('user_login')->value('admin');
95
+			$this->byId('user_pass')->value('admin');
96 96
 //            $this->byId('rememberme')->click();
97
-            // Submit the form
98
-            $this->byId('wp-submit')->submit();
99
-            $this->waitForPageLoadAndCheckForErrors();
100
-            $this->url($redirect);
101
-        }
102
-    }
103
-
104
-    function isElementExists($id = false, $by = 'id') {
105
-        if (!$id) {
106
-            return false;
107
-        }
108
-        $exists = true;
109
-        try {
110
-            if ($by == 'id') {
111
-                $this->byId($id);
112
-            } elseif ($by == 'xpath') {
113
-                $this->byXPath($id);
114
-            }
115
-
116
-        } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
117
-            if (PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement == $e->getCode()) {
118
-                $exists = false;
119
-            }
120
-        }
121
-        return $exists;
122
-    }
123
-
124
-    function ExecuteScript($script, $args=array()) {
125
-        $this->execute( array(
126
-            'script' => $script ,
127
-            'args'=>$args
128
-        ) );
129
-    }
130
-
131
-    function hideAdminBar() {
132
-        //admin bar causes problem with scroll. So hide admin bar while testing.
133
-        $this->ExecuteScript('jQuery("#wpadminbar").hide();');
134
-    }
135
-
136
-    function logInfo($string) {
137
-        fwrite(STDOUT, "Info: ".$string . PHP_EOL);
138
-    }
139
-
140
-    function logError($string) {
141
-        fwrite(STDOUT, "Error: ".$string . PHP_EOL);
142
-    }
143
-
144
-    function logWarning($string) {
145
-        fwrite(STDOUT, "Warning: ".$string . PHP_EOL);
146
-    }
147
-
148
-    function getCurrentFileNumber($file) {
149
-        preg_match('/test-([0-9]+)_/', $file, $match);
150
-        return (int) $match[1];
151
-    }
152
-
153
-    function getCompletedFileNumber() {
154
-        $completed = fopen("tests/selenium/completed.txt", "r") or die("Unable to open file!");
155
-        $content = fgets($completed);
156
-        fclose($completed);
157
-        return (int) $content;
158
-    }
159
-
160
-    function skipTest($current, $completed) {
161
-        if ($completed == 0 || $completed == 42 || $current == $completed) {
162
-            return false;
163
-        } elseif ($current < $completed) {
164
-            return true;
165
-        } else {
166
-            return false;
167
-        }
168
-    }
169
-
170
-    function maybeLogout() {
171
-        $this->url(self::GDTEST_BASE_URL);
172
-        $this->byXPath("//*[@id='gd-sidebar-wrapper']//ul[@class='geodir-loginbox-list']//a[@class='signin']")->click();
173
-        $this->waitForPageLoadAndCheckForErrors();
174
-    }
175
-
176
-    function maybeAdminLogout() {
177
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
178
-        $this->ExecuteScript('jQuery("#wp-admin-bar-my-account").addClass("hover");');
179
-        $this->byXPath("//*[@id='wp-admin-bar-logout']//a")->click();
180
-        $this->waitForPageLoadAndCheckForErrors();
181
-    }
182
-
183
-    function maybeActivatePlugin($id=false, $timeout=10000) {
184
-        if (!$id) {
185
-            return;
186
-        }
187
-        $plugin_name = ucwords(str_replace('-', ' ', $id));
188
-        $this->logInfo('Activating '.$plugin_name.' plugin......');
189
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
190
-        $this->waitForPageLoadAndCheckForErrors();
191
-        $this->hideAdminBar();
192
-        if (is_int(strpos($this->byId($id)->attribute('class'), 'inactive'))) {
193
-            $this->byXPath("//tr[@id='".$id."']//span[@class='activate']/a")->click();
194
-        }
195
-        $this->waitForPageLoadAndCheckForErrors($timeout);
196
-        $this->logInfo($plugin_name.' activated......');
197
-    }
97
+			// Submit the form
98
+			$this->byId('wp-submit')->submit();
99
+			$this->waitForPageLoadAndCheckForErrors();
100
+			$this->url($redirect);
101
+		}
102
+	}
103
+
104
+	function isElementExists($id = false, $by = 'id') {
105
+		if (!$id) {
106
+			return false;
107
+		}
108
+		$exists = true;
109
+		try {
110
+			if ($by == 'id') {
111
+				$this->byId($id);
112
+			} elseif ($by == 'xpath') {
113
+				$this->byXPath($id);
114
+			}
115
+
116
+		} catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
117
+			if (PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement == $e->getCode()) {
118
+				$exists = false;
119
+			}
120
+		}
121
+		return $exists;
122
+	}
123
+
124
+	function ExecuteScript($script, $args=array()) {
125
+		$this->execute( array(
126
+			'script' => $script ,
127
+			'args'=>$args
128
+		) );
129
+	}
130
+
131
+	function hideAdminBar() {
132
+		//admin bar causes problem with scroll. So hide admin bar while testing.
133
+		$this->ExecuteScript('jQuery("#wpadminbar").hide();');
134
+	}
135
+
136
+	function logInfo($string) {
137
+		fwrite(STDOUT, "Info: ".$string . PHP_EOL);
138
+	}
139
+
140
+	function logError($string) {
141
+		fwrite(STDOUT, "Error: ".$string . PHP_EOL);
142
+	}
143
+
144
+	function logWarning($string) {
145
+		fwrite(STDOUT, "Warning: ".$string . PHP_EOL);
146
+	}
147
+
148
+	function getCurrentFileNumber($file) {
149
+		preg_match('/test-([0-9]+)_/', $file, $match);
150
+		return (int) $match[1];
151
+	}
152
+
153
+	function getCompletedFileNumber() {
154
+		$completed = fopen("tests/selenium/completed.txt", "r") or die("Unable to open file!");
155
+		$content = fgets($completed);
156
+		fclose($completed);
157
+		return (int) $content;
158
+	}
159
+
160
+	function skipTest($current, $completed) {
161
+		if ($completed == 0 || $completed == 42 || $current == $completed) {
162
+			return false;
163
+		} elseif ($current < $completed) {
164
+			return true;
165
+		} else {
166
+			return false;
167
+		}
168
+	}
169
+
170
+	function maybeLogout() {
171
+		$this->url(self::GDTEST_BASE_URL);
172
+		$this->byXPath("//*[@id='gd-sidebar-wrapper']//ul[@class='geodir-loginbox-list']//a[@class='signin']")->click();
173
+		$this->waitForPageLoadAndCheckForErrors();
174
+	}
175
+
176
+	function maybeAdminLogout() {
177
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
178
+		$this->ExecuteScript('jQuery("#wp-admin-bar-my-account").addClass("hover");');
179
+		$this->byXPath("//*[@id='wp-admin-bar-logout']//a")->click();
180
+		$this->waitForPageLoadAndCheckForErrors();
181
+	}
182
+
183
+	function maybeActivatePlugin($id=false, $timeout=10000) {
184
+		if (!$id) {
185
+			return;
186
+		}
187
+		$plugin_name = ucwords(str_replace('-', ' ', $id));
188
+		$this->logInfo('Activating '.$plugin_name.' plugin......');
189
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
190
+		$this->waitForPageLoadAndCheckForErrors();
191
+		$this->hideAdminBar();
192
+		if (is_int(strpos($this->byId($id)->attribute('class'), 'inactive'))) {
193
+			$this->byXPath("//tr[@id='".$id."']//span[@class='activate']/a")->click();
194
+		}
195
+		$this->waitForPageLoadAndCheckForErrors($timeout);
196
+		$this->logInfo($plugin_name.' activated......');
197
+	}
198 198
 
199 199
 }
200 200
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     function isTextPresent($search)
14 14
     {
15 15
         $source = $this->source();
16
-        if ( strpos((string)$source,$search) !== FALSE) {
16
+        if (strpos((string) $source, $search) !== FALSE) {
17 17
             return true;
18 18
         } else {
19 19
             return false;
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         return md5(uniqid(rand(), true)).'@gmail.com';
26 26
     }
27 27
 
28
-    function waitForPageLoadAndCheckForErrors($timeout=10000)
28
+    function waitForPageLoadAndCheckForErrors($timeout = 10000)
29 29
     {
30 30
         // Wait 10 seconds
31 31
         $this->timeouts()->implicitWait($timeout);
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
         $elements = $this->elements($this->using('css selector')->value('.xdebug-error'));
39 39
         if ($elements) {
40 40
             $total = count($elements);
41
-            fwrite(STDOUT, $total.' errors found'. PHP_EOL);
41
+            fwrite(STDOUT, $total.' errors found'.PHP_EOL);
42 42
             $count = 0;
43 43
             foreach ($elements as $i => $element) {
44 44
                 $count++;
45 45
                 if ($errors = $element->attribute('innerHTML')) {
46
-                    fwrite(STDOUT, "========================================================================". PHP_EOL);
47
-                    fwrite(STDOUT, strip_tags($errors). PHP_EOL);
46
+                    fwrite(STDOUT, "========================================================================".PHP_EOL);
47
+                    fwrite(STDOUT, strip_tags($errors).PHP_EOL);
48 48
                     if ($count == $total) {
49
-                        fwrite(STDOUT, "========================================================================". PHP_EOL);
49
+                        fwrite(STDOUT, "========================================================================".PHP_EOL);
50 50
                     }
51 51
                 }
52 52
             }
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
 
56 56
     function checkForJsErrors() {
57 57
         if ($this->isElementExists('sel_js_error')) {
58
-            fwrite(STDOUT, 'Javascript errors found'. PHP_EOL);
59
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
58
+            fwrite(STDOUT, 'Javascript errors found'.PHP_EOL);
59
+            fwrite(STDOUT, "========================================================================".PHP_EOL);
60 60
             echo $this->byId('sel_js_error')->attribute('innerHTML');
61
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
61
+            fwrite(STDOUT, "========================================================================".PHP_EOL);
62 62
         }
63 63
     }
64 64
 
65
-    function maybeUserLogin($redirect, $force=false) {
65
+    function maybeUserLogin($redirect, $force = false) {
66 66
         if ($force) {
67 67
             $this->url(self::GDTEST_BASE_URL.'wp-admin/');
68 68
             if ($this->isTextPresent("forgetmenot")) {
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
         return $exists;
122 122
     }
123 123
 
124
-    function ExecuteScript($script, $args=array()) {
125
-        $this->execute( array(
126
-            'script' => $script ,
124
+    function ExecuteScript($script, $args = array()) {
125
+        $this->execute(array(
126
+            'script' => $script,
127 127
             'args'=>$args
128
-        ) );
128
+        ));
129 129
     }
130 130
 
131 131
     function hideAdminBar() {
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
     }
135 135
 
136 136
     function logInfo($string) {
137
-        fwrite(STDOUT, "Info: ".$string . PHP_EOL);
137
+        fwrite(STDOUT, "Info: ".$string.PHP_EOL);
138 138
     }
139 139
 
140 140
     function logError($string) {
141
-        fwrite(STDOUT, "Error: ".$string . PHP_EOL);
141
+        fwrite(STDOUT, "Error: ".$string.PHP_EOL);
142 142
     }
143 143
 
144 144
     function logWarning($string) {
145
-        fwrite(STDOUT, "Warning: ".$string . PHP_EOL);
145
+        fwrite(STDOUT, "Warning: ".$string.PHP_EOL);
146 146
     }
147 147
 
148 148
     function getCurrentFileNumber($file) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $this->waitForPageLoadAndCheckForErrors();
181 181
     }
182 182
 
183
-    function maybeActivatePlugin($id=false, $timeout=10000) {
183
+    function maybeActivatePlugin($id = false, $timeout = 10000) {
184 184
         if (!$id) {
185 185
             return;
186 186
         }
Please login to merge, or discard this patch.
tests/selenium/stest-09_Sort_Listing.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -1,40 +1,40 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 class SortListing extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testSortListing()
18
-    {
19
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=custom_fields&listing_type=gd_place');
20
-        $this->waitForPageLoadAndCheckForErrors();
21
-        $this->byId('gt-text')->click();
22
-        $this->waitForPageLoadAndCheckForErrors();
17
+	public function testSortListing()
18
+	{
19
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=custom_fields&listing_type=gd_place');
20
+		$this->waitForPageLoadAndCheckForErrors();
21
+		$this->byId('gt-text')->click();
22
+		$this->waitForPageLoadAndCheckForErrors();
23 23
 
24
-        $link = $this->byXPath("//li[@id='licontainer_new9']/div[contains(@class,'titlenew9')]");
25
-        $this->moveto($link);
26
-        $this->doubleclick();
27
-        $this->waitForPageLoadAndCheckForErrors();
28
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='admin_title']")->value('Price');
29
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='site_title']")->value('Price');
30
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='htmlvar_name']")->value('price');
31
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='clabels']")->value('Price');
32
-        $this->select($this->byXPath("//div[@id='field_frmnew9']//select[@id='is_active']"))->selectOptionByLabel('Yes');
33
-        $this->select($this->byXPath("//div[@id='field_frmnew9']//select[@id='show_on_listing']"))->selectOptionByLabel('Yes');
34
-        $this->select($this->byXPath("//div[@id='field_frmnew9']//select[@id='show_on_detail']"))->selectOptionByLabel('Yes');
35
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='cat_sort']")->click();
36
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='cat_filter']")->click();
37
-        $this->byXPath("//div[@id='field_frmnew9']//input[@id='save']")->click();
24
+		$link = $this->byXPath("//li[@id='licontainer_new9']/div[contains(@class,'titlenew9')]");
25
+		$this->moveto($link);
26
+		$this->doubleclick();
27
+		$this->waitForPageLoadAndCheckForErrors();
28
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='admin_title']")->value('Price');
29
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='site_title']")->value('Price');
30
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='htmlvar_name']")->value('price');
31
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='clabels']")->value('Price');
32
+		$this->select($this->byXPath("//div[@id='field_frmnew9']//select[@id='is_active']"))->selectOptionByLabel('Yes');
33
+		$this->select($this->byXPath("//div[@id='field_frmnew9']//select[@id='show_on_listing']"))->selectOptionByLabel('Yes');
34
+		$this->select($this->byXPath("//div[@id='field_frmnew9']//select[@id='show_on_detail']"))->selectOptionByLabel('Yes');
35
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='cat_sort']")->click();
36
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='cat_filter']")->click();
37
+		$this->byXPath("//div[@id='field_frmnew9']//input[@id='save']")->click();
38 38
 //        $this->byId('admin_title')->value('Price');
39 39
 //        $this->byId('site_title')->value('Price');
40 40
 //        $this->byId('htmlvar_name')->value('price');
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 //        $this->byId('cat_sort')->click();
46 46
 //        $this->byId('cat_filter')->click();
47 47
 //        $this->byId('save')->click();
48
-        $this->waitForPageLoadAndCheckForErrors();
48
+		$this->waitForPageLoadAndCheckForErrors();
49 49
 
50
-        $this->logInfo('Testing list sorting......');
51
-        //Make sure sorting options available
50
+		$this->logInfo('Testing list sorting......');
51
+		//Make sure sorting options available
52 52
 //        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=sorting_options&listing_type=gd_place');
53 53
 //        $this->waitForPageLoadAndCheckForErrors();
54 54
 //        $this->byId('gt-text-_-geodir_price')->click();
@@ -63,37 +63,37 @@  discard block
 block discarded – undo
63 63
 //        $this->byXPath("//div[@id='field_frmnew-1']//input[@id='save']")->click();
64 64
 //        $this->waitForPageLoadAndCheckForErrors();
65 65
 
66
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=sorting_options&listing_type=gd_place');
67
-        $this->waitForPageLoadAndCheckForErrors();
68
-        $this->byId('gt-float-_-overall_rating')->click();
69
-        $this->waitForPageLoadAndCheckForErrors();
70
-        $link = $this->byXPath("//li[@id='licontainer_new-1']/div");
71
-        $this->moveto($link);
72
-        $this->doubleclick();
73
-        $this->waitForPageLoadAndCheckForErrors();
74
-        $this->byXPath("//li[@id='licontainer_new-1']//input[@id='asc_title']")->value('Rating ASC');
75
-        $this->byXPath("//li[@id='licontainer_new-1']//input[@id='asc']")->click();
76
-        $this->byXPath("//li[@id='licontainer_new-1']//input[contains(@name,'is_default') and contains(@value,'overall_rating_asc')]")->click();
77
-        $this->byXPath("//li[@id='licontainer_new-1']//input[@id='desc']")->click();
78
-        $this->byXPath("//li[@id='licontainer_new-1']//input[@id='desc_title']")->value('Rating DESC');
79
-        $this->byXPath("//li[@id='licontainer_new-1']//input[@id='save']")->click();
80
-        $this->waitForPageLoadAndCheckForErrors();
66
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=sorting_options&listing_type=gd_place');
67
+		$this->waitForPageLoadAndCheckForErrors();
68
+		$this->byId('gt-float-_-overall_rating')->click();
69
+		$this->waitForPageLoadAndCheckForErrors();
70
+		$link = $this->byXPath("//li[@id='licontainer_new-1']/div");
71
+		$this->moveto($link);
72
+		$this->doubleclick();
73
+		$this->waitForPageLoadAndCheckForErrors();
74
+		$this->byXPath("//li[@id='licontainer_new-1']//input[@id='asc_title']")->value('Rating ASC');
75
+		$this->byXPath("//li[@id='licontainer_new-1']//input[@id='asc']")->click();
76
+		$this->byXPath("//li[@id='licontainer_new-1']//input[contains(@name,'is_default') and contains(@value,'overall_rating_asc')]")->click();
77
+		$this->byXPath("//li[@id='licontainer_new-1']//input[@id='desc']")->click();
78
+		$this->byXPath("//li[@id='licontainer_new-1']//input[@id='desc_title']")->value('Rating DESC');
79
+		$this->byXPath("//li[@id='licontainer_new-1']//input[@id='save']")->click();
80
+		$this->waitForPageLoadAndCheckForErrors();
81 81
 
82 82
 
83
-        $this->url(self::GDTEST_BASE_URL.'places/');
84
-        $this->waitForPageLoadAndCheckForErrors();
85
-        $this->select($this->byId('sort_by'))->selectOptionByLabel('Rating DESC');
86
-        $this->waitForPageLoadAndCheckForErrors();
87
-    }
83
+		$this->url(self::GDTEST_BASE_URL.'places/');
84
+		$this->waitForPageLoadAndCheckForErrors();
85
+		$this->select($this->byId('sort_by'))->selectOptionByLabel('Rating DESC');
86
+		$this->waitForPageLoadAndCheckForErrors();
87
+	}
88 88
 
89
-    public function tearDown()
90
-    {
91
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
92
-            //write current file number to completed.txt
93
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
94
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
95
-            fwrite($completed, $CurrentFileNumber);
96
-        }
97
-    }
89
+	public function tearDown()
90
+	{
91
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
92
+			//write current file number to completed.txt
93
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
94
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
95
+			fwrite($completed, $CurrentFileNumber);
96
+		}
97
+	}
98 98
 }
99 99
 ?>
100 100
\ No newline at end of file
Please login to merge, or discard this patch.
tests/selenium/stest-21_Search_Near_Me.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 class SearchNearMe extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testSearchNearMe()
18
-    {
19
-        $this->logInfo('Test search near me......');
20
-        $this->logInfo('Skipping since user need to share the location manually......');
17
+	public function testSearchNearMe()
18
+	{
19
+		$this->logInfo('Test search near me......');
20
+		$this->logInfo('Skipping since user need to share the location manually......');
21 21
 //        $this->logInfo('Test search near me......');
22 22
 //        //make sure event manager plugin active
23 23
 //        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
 //        $this->waitForPageLoadAndCheckForErrors();
45 45
 //        $this->assertTrue( $this->isTextPresent("Search Places For"), "Not in search results page");
46 46
 
47
-    }
47
+	}
48 48
 
49
-    public function tearDown()
50
-    {
51
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
52
-            //write current file number to completed.txt
53
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
54
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
55
-            fwrite($completed, $CurrentFileNumber);
56
-        }
57
-    }
49
+	public function tearDown()
50
+	{
51
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
52
+			//write current file number to completed.txt
53
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
54
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
55
+			fwrite($completed, $CurrentFileNumber);
56
+		}
57
+	}
58 58
 }
59 59
 ?>
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
tests/selenium/stest-16_Add_New_Price.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddNewPrice extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testAddNewPrice()
18
-    {
19
-        $this->logInfo('Add a new price......');
20
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_manager&gd_pagetype=addeditprice');
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->assertTrue( $this->isTextPresent("Add Price"), "Add Price text not found");
23
-        $this->byId('title')->value('Premium Plus');
24
-        $this->byId('days')->value('0');
25
-        $this->byName('gd_amount')->value('5');
26
-        $this->select($this->byName('gd_status'))->selectOptionByValue(1);
27
-        $this->byName('submit')->click();
28
-        $this->waitForPageLoadAndCheckForErrors();
29
-    }
17
+	public function testAddNewPrice()
18
+	{
19
+		$this->logInfo('Add a new price......');
20
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_manager&gd_pagetype=addeditprice');
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->assertTrue( $this->isTextPresent("Add Price"), "Add Price text not found");
23
+		$this->byId('title')->value('Premium Plus');
24
+		$this->byId('days')->value('0');
25
+		$this->byName('gd_amount')->value('5');
26
+		$this->select($this->byName('gd_status'))->selectOptionByValue(1);
27
+		$this->byName('submit')->click();
28
+		$this->waitForPageLoadAndCheckForErrors();
29
+	}
30 30
 
31
-    public function tearDown()
32
-    {
33
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
34
-            //write current file number to completed.txt
35
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
36
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
37
-            fwrite($completed, $CurrentFileNumber);
38
-        }
39
-    }
31
+	public function tearDown()
32
+	{
33
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
34
+			//write current file number to completed.txt
35
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
36
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
37
+			fwrite($completed, $CurrentFileNumber);
38
+		}
39
+	}
40 40
 }
41 41
 ?>
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         $this->logInfo('Add a new price......');
20 20
         $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_manager&gd_pagetype=addeditprice');
21 21
         $this->waitForPageLoadAndCheckForErrors();
22
-        $this->assertTrue( $this->isTextPresent("Add Price"), "Add Price text not found");
22
+        $this->assertTrue($this->isTextPresent("Add Price"), "Add Price text not found");
23 23
         $this->byId('title')->value('Premium Plus');
24 24
         $this->byId('days')->value('0');
25 25
         $this->byName('gd_amount')->value('5');
Please login to merge, or discard this patch.
tests/selenium/stest-25_Author_Page.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,38 +1,38 @@
 block discarded – undo
1 1
 <?php
2 2
 class AuthorPage extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testAuthorPage()
18
-    {
19
-        //test loggedin
20
-        $this->logInfo('Testing author page......');
21
-        $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place');
22
-        $this->waitForPageLoadAndCheckForErrors();
23
-        $this->assertTrue( $this->isTextPresent("Places by"), "Not in Author page");
17
+	public function testAuthorPage()
18
+	{
19
+		//test loggedin
20
+		$this->logInfo('Testing author page......');
21
+		$this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place');
22
+		$this->waitForPageLoadAndCheckForErrors();
23
+		$this->assertTrue( $this->isTextPresent("Places by"), "Not in Author page");
24 24
 
25
-        //Todo: test when not logged in
26
-    }
25
+		//Todo: test when not logged in
26
+	}
27 27
 
28
-    public function tearDown()
29
-    {
30
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
31
-            //write current file number to completed.txt
32
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
33
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
34
-            fwrite($completed, $CurrentFileNumber);
35
-        }
36
-    }
28
+	public function tearDown()
29
+	{
30
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
31
+			//write current file number to completed.txt
32
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
33
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
34
+			fwrite($completed, $CurrentFileNumber);
35
+		}
36
+	}
37 37
 }
38 38
 ?>
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         $this->logInfo('Testing author page......');
21 21
         $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place');
22 22
         $this->waitForPageLoadAndCheckForErrors();
23
-        $this->assertTrue( $this->isTextPresent("Places by"), "Not in Author page");
23
+        $this->assertTrue($this->isTextPresent("Places by"), "Not in Author page");
24 24
 
25 25
         //Todo: test when not logged in
26 26
     }
Please login to merge, or discard this patch.
tests/selenium/stest-37_Marker_Cluster.php 2 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@
 block discarded – undo
1 1
 <?php
2 2
 class MarkerCluster extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
16
-
17
-    public function testMarkerCluster()
18
-    {
19
-        $this->logInfo('Testing marker cluster......');
20
-        //make sure marker cluster plugin active
21
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
-        $this->waitForPageLoadAndCheckForErrors();
23
-
24
-        $is_active = $this->byId("geodirectory-marker-cluster")->attribute('class');
25
-        if (is_int(strpos($is_active, 'inactive'))) {
26
-            //Activate Geodirectory Marker Cluster
27
-            $this->maybeActivatePlugin("geodirectory-marker-cluster", 20000);
28
-            //go back to plugin page
29
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
-        }
31
-
32
-        $is_active1 = $this->byId("geodirectory-marker-cluster")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "Marker Cluster plugin not active");
34
-
35
-
36
-        //make sure marker cluster enabled in home map
37
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_marker_cluster_settings');
38
-        $this->byName('save')->click();
39
-        $this->waitForPageLoadAndCheckForErrors();
40
-
41
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'location/');
42
-        if (!$this->isElementExists('//div[text()=2]', 'xpath')) {
43
-            $this->logError('Marker cluster not found in home page.');
44
-        }
45
-    }
46
-
47
-    public function tearDown()
48
-    {
49
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
50
-            //write current file number to completed.txt
51
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
52
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
53
-            fwrite($completed, $CurrentFileNumber);
54
-        }
55
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16
+
17
+	public function testMarkerCluster()
18
+	{
19
+		$this->logInfo('Testing marker cluster......');
20
+		//make sure marker cluster plugin active
21
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
22
+		$this->waitForPageLoadAndCheckForErrors();
23
+
24
+		$is_active = $this->byId("geodirectory-marker-cluster")->attribute('class');
25
+		if (is_int(strpos($is_active, 'inactive'))) {
26
+			//Activate Geodirectory Marker Cluster
27
+			$this->maybeActivatePlugin("geodirectory-marker-cluster", 20000);
28
+			//go back to plugin page
29
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
30
+		}
31
+
32
+		$is_active1 = $this->byId("geodirectory-marker-cluster")->attribute('class');
33
+		$this->assertFalse( strpos($is_active1, 'inactive'), "Marker Cluster plugin not active");
34
+
35
+
36
+		//make sure marker cluster enabled in home map
37
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_marker_cluster_settings');
38
+		$this->byName('save')->click();
39
+		$this->waitForPageLoadAndCheckForErrors();
40
+
41
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'location/');
42
+		if (!$this->isElementExists('//div[text()=2]', 'xpath')) {
43
+			$this->logError('Marker cluster not found in home page.');
44
+		}
45
+	}
46
+
47
+	public function tearDown()
48
+	{
49
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
50
+			//write current file number to completed.txt
51
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
52
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
53
+			fwrite($completed, $CurrentFileNumber);
54
+		}
55
+	}
56 56
 }
57 57
 ?>
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         }
31 31
 
32 32
         $is_active1 = $this->byId("geodirectory-marker-cluster")->attribute('class');
33
-        $this->assertFalse( strpos($is_active1, 'inactive'), "Marker Cluster plugin not active");
33
+        $this->assertFalse(strpos($is_active1, 'inactive'), "Marker Cluster plugin not active");
34 34
 
35 35
 
36 36
         //make sure marker cluster enabled in home map
Please login to merge, or discard this patch.