@@ -1,33 +1,33 @@ |
||
1 | 1 | <?php |
2 | 2 | class CheckNotifications 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 testCheckNotifications() |
|
18 | - { |
|
19 | - $this->logInfo('Check notifications......'); |
|
20 | - $this->logInfo('Skipping since its not possible......'); |
|
21 | - } |
|
17 | + public function testCheckNotifications() |
|
18 | + { |
|
19 | + $this->logInfo('Check notifications......'); |
|
20 | + $this->logInfo('Skipping since its not possible......'); |
|
21 | + } |
|
22 | 22 | |
23 | - public function tearDown() |
|
24 | - { |
|
25 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
26 | - //write current file number to completed.txt |
|
27 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
28 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
29 | - fwrite($completed, $CurrentFileNumber); |
|
30 | - } |
|
31 | - } |
|
23 | + public function tearDown() |
|
24 | + { |
|
25 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
26 | + //write current file number to completed.txt |
|
27 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
28 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
29 | + fwrite($completed, $CurrentFileNumber); |
|
30 | + } |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | ?> |
34 | 34 | \ No newline at end of file |
@@ -1,57 +1,57 @@ |
||
1 | 1 | <?php |
2 | 2 | class BrowseGDPages 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 testBrowseGDPages() |
|
18 | - { |
|
19 | - //Browse all GD pages and catch errors and warnings |
|
20 | - $this->logInfo('Testing home page......'); |
|
21 | - $this->url(self::GDTEST_BASE_URL); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
23 | - |
|
24 | - $this->logInfo('Testing listing page......'); |
|
25 | - $this->url(self::GDTEST_BASE_URL.'places/'); |
|
26 | - $this->waitForPageLoadAndCheckForErrors(); |
|
27 | - |
|
28 | - $this->logInfo('Testing listing country page......'); |
|
29 | - $this->url(self::GDTEST_BASE_URL.'places/united-states/'); |
|
30 | - $this->waitForPageLoadAndCheckForErrors(); |
|
31 | - |
|
32 | - $this->logInfo('Testing add listing page......'); |
|
33 | - $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
|
34 | - $this->waitForPageLoadAndCheckForErrors(); |
|
35 | - |
|
36 | - $this->logInfo('Testing add event page......'); |
|
37 | - $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
|
38 | - $this->waitForPageLoadAndCheckForErrors(); |
|
39 | - |
|
40 | - $this->logInfo('Testing detail page......'); |
|
41 | - $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/'); |
|
42 | - $this->waitForPageLoadAndCheckForErrors(); |
|
43 | - |
|
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 testBrowseGDPages() |
|
18 | + { |
|
19 | + //Browse all GD pages and catch errors and warnings |
|
20 | + $this->logInfo('Testing home page......'); |
|
21 | + $this->url(self::GDTEST_BASE_URL); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | + |
|
24 | + $this->logInfo('Testing listing page......'); |
|
25 | + $this->url(self::GDTEST_BASE_URL.'places/'); |
|
26 | + $this->waitForPageLoadAndCheckForErrors(); |
|
27 | + |
|
28 | + $this->logInfo('Testing listing country page......'); |
|
29 | + $this->url(self::GDTEST_BASE_URL.'places/united-states/'); |
|
30 | + $this->waitForPageLoadAndCheckForErrors(); |
|
31 | + |
|
32 | + $this->logInfo('Testing add listing page......'); |
|
33 | + $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
|
34 | + $this->waitForPageLoadAndCheckForErrors(); |
|
35 | + |
|
36 | + $this->logInfo('Testing add event page......'); |
|
37 | + $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
|
38 | + $this->waitForPageLoadAndCheckForErrors(); |
|
39 | + |
|
40 | + $this->logInfo('Testing detail page......'); |
|
41 | + $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/'); |
|
42 | + $this->waitForPageLoadAndCheckForErrors(); |
|
43 | + |
|
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 |
@@ -1,42 +1,42 @@ |
||
1 | 1 | <?php |
2 | 2 | class Favourites 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 testFavourites() |
|
18 | - { |
|
19 | - $this->logInfo('Testing Favorites......'); |
|
20 | - $this->url(self::GDTEST_BASE_URL.'places/'); |
|
21 | - $this->waitForPageLoadAndCheckForErrors(); |
|
22 | - $elements = $this->elements($this->using('css selector')->value('.geodir-addtofav-icon')); |
|
23 | - if ($elements) { |
|
24 | - $elements[0]->click(); |
|
25 | - } |
|
26 | - $this->waitForPageLoadAndCheckForErrors(); |
|
27 | - $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place&list=favourite'); |
|
28 | - $this->waitForPageLoadAndCheckForErrors(); |
|
29 | - $this->assertTrue( $this->isTextPresent("Favorite Places"), "Not in Favourites page"); |
|
30 | - } |
|
17 | + public function testFavourites() |
|
18 | + { |
|
19 | + $this->logInfo('Testing Favorites......'); |
|
20 | + $this->url(self::GDTEST_BASE_URL.'places/'); |
|
21 | + $this->waitForPageLoadAndCheckForErrors(); |
|
22 | + $elements = $this->elements($this->using('css selector')->value('.geodir-addtofav-icon')); |
|
23 | + if ($elements) { |
|
24 | + $elements[0]->click(); |
|
25 | + } |
|
26 | + $this->waitForPageLoadAndCheckForErrors(); |
|
27 | + $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place&list=favourite'); |
|
28 | + $this->waitForPageLoadAndCheckForErrors(); |
|
29 | + $this->assertTrue( $this->isTextPresent("Favorite Places"), "Not in Favourites page"); |
|
30 | + } |
|
31 | 31 | |
32 | - public function tearDown() |
|
33 | - { |
|
34 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
35 | - //write current file number to completed.txt |
|
36 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
37 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
38 | - fwrite($completed, $CurrentFileNumber); |
|
39 | - } |
|
40 | - } |
|
32 | + public function tearDown() |
|
33 | + { |
|
34 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
35 | + //write current file number to completed.txt |
|
36 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
37 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
38 | + fwrite($completed, $CurrentFileNumber); |
|
39 | + } |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | ?> |
43 | 43 | \ No newline at end of file |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $this->waitForPageLoadAndCheckForErrors(); |
27 | 27 | $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place&list=favourite'); |
28 | 28 | $this->waitForPageLoadAndCheckForErrors(); |
29 | - $this->assertTrue( $this->isTextPresent("Favorite Places"), "Not in Favourites page"); |
|
29 | + $this->assertTrue($this->isTextPresent("Favorite Places"), "Not in Favourites page"); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function tearDown() |
@@ -1,44 +1,44 @@ |
||
1 | 1 | <?php |
2 | 2 | class GoogleAnalytics 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 testGoogleAnalytics() |
|
18 | - { |
|
19 | - $this->logInfo('Testing google analytics......'); |
|
20 | - //make sure Google Analytics Authorized |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
23 | - $this->byLinkText('Google Analytics')->click(); |
|
17 | + public function testGoogleAnalytics() |
|
18 | + { |
|
19 | + $this->logInfo('Testing google analytics......'); |
|
20 | + //make sure Google Analytics Authorized |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | + $this->byLinkText('Google Analytics')->click(); |
|
24 | 24 | |
25 | - $value = $this->byId('geodir_ga_id')->value(); |
|
26 | - if (empty($value)) { |
|
27 | - echo "Google Analytics not configured"; |
|
28 | - } |
|
25 | + $value = $this->byId('geodir_ga_id')->value(); |
|
26 | + if (empty($value)) { |
|
27 | + echo "Google Analytics not configured"; |
|
28 | + } |
|
29 | 29 | |
30 | - $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/'); |
|
31 | - $this->waitForPageLoadAndCheckForErrors(); |
|
32 | - } |
|
30 | + $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/'); |
|
31 | + $this->waitForPageLoadAndCheckForErrors(); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
37 | - //write current file number to completed.txt |
|
38 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
39 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
40 | - fwrite($completed, $CurrentFileNumber); |
|
41 | - } |
|
42 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
37 | + //write current file number to completed.txt |
|
38 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
39 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
40 | + fwrite($completed, $CurrentFileNumber); |
|
41 | + } |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | ?> |
45 | 45 | \ No newline at end of file |
@@ -1,65 +1,65 @@ |
||
1 | 1 | <?php |
2 | 2 | class CreateNewCPT 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 testCreateNewCPT() |
|
18 | - { |
|
19 | - $this->logInfo('Testing new CPT......'); |
|
20 | - //make sure custom post types plugin active |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
17 | + public function testCreateNewCPT() |
|
18 | + { |
|
19 | + $this->logInfo('Testing new CPT......'); |
|
20 | + //make sure custom post types plugin active |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | 23 | |
24 | - $is_active = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | - //Activate Geodirectory Custom Post Types |
|
27 | - $this->maybeActivatePlugin("geodirectory-custom-post-types", 20000); |
|
28 | - //go back to plugin page |
|
29 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
30 | - } |
|
24 | + $is_active = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | + //Activate Geodirectory Custom Post Types |
|
27 | + $this->maybeActivatePlugin("geodirectory-custom-post-types", 20000); |
|
28 | + //go back to plugin page |
|
29 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
30 | + } |
|
31 | 31 | |
32 | - $is_active1 = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
32 | + $is_active1 = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
34 | 34 | |
35 | 35 | |
36 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts'); |
|
37 | - $this->waitForPageLoadAndCheckForErrors(); |
|
38 | - if ($this->isTextPresent("gd_hotel")) { |
|
39 | - echo "Hotel post type already found. Please delete it first"; |
|
40 | - return; |
|
41 | - } |
|
36 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts'); |
|
37 | + $this->waitForPageLoadAndCheckForErrors(); |
|
38 | + if ($this->isTextPresent("gd_hotel")) { |
|
39 | + echo "Hotel post type already found. Please delete it first"; |
|
40 | + return; |
|
41 | + } |
|
42 | 42 | |
43 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts&action=cp_addedit'); |
|
44 | - $this->waitForPageLoadAndCheckForErrors(); |
|
45 | - $this->assertTrue( $this->isTextPresent("Post Type"), "Post Type text not found"); |
|
46 | - $this->byId('geodir_custom_post_type')->value('hotel'); |
|
47 | - $this->byId('geodir_listing_slug')->value('hotels'); |
|
48 | - $this->byId('geodir_listing_order')->value('10'); |
|
49 | - $this->byId('geodir_name')->value('Hotels'); |
|
50 | - $this->byId('geodir_singular_name')->value('Hotel'); |
|
51 | - $this->byName('geodir_save_post_type')->click(); |
|
52 | - $this->waitForPageLoadAndCheckForErrors(); |
|
53 | - } |
|
43 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts&action=cp_addedit'); |
|
44 | + $this->waitForPageLoadAndCheckForErrors(); |
|
45 | + $this->assertTrue( $this->isTextPresent("Post Type"), "Post Type text not found"); |
|
46 | + $this->byId('geodir_custom_post_type')->value('hotel'); |
|
47 | + $this->byId('geodir_listing_slug')->value('hotels'); |
|
48 | + $this->byId('geodir_listing_order')->value('10'); |
|
49 | + $this->byId('geodir_name')->value('Hotels'); |
|
50 | + $this->byId('geodir_singular_name')->value('Hotel'); |
|
51 | + $this->byName('geodir_save_post_type')->click(); |
|
52 | + $this->waitForPageLoadAndCheckForErrors(); |
|
53 | + } |
|
54 | 54 | |
55 | - public function tearDown() |
|
56 | - { |
|
57 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
58 | - //write current file number to completed.txt |
|
59 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
60 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
61 | - fwrite($completed, $CurrentFileNumber); |
|
62 | - } |
|
63 | - } |
|
55 | + public function tearDown() |
|
56 | + { |
|
57 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
58 | + //write current file number to completed.txt |
|
59 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
60 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
61 | + fwrite($completed, $CurrentFileNumber); |
|
62 | + } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | ?> |
66 | 66 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $is_active1 = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts'); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts&action=cp_addedit'); |
44 | 44 | $this->waitForPageLoadAndCheckForErrors(); |
45 | - $this->assertTrue( $this->isTextPresent("Post Type"), "Post Type text not found"); |
|
45 | + $this->assertTrue($this->isTextPresent("Post Type"), "Post Type text not found"); |
|
46 | 46 | $this->byId('geodir_custom_post_type')->value('hotel'); |
47 | 47 | $this->byId('geodir_listing_slug')->value('hotels'); |
48 | 48 | $this->byId('geodir_listing_order')->value('10'); |
@@ -1,164 +1,164 @@ |
||
1 | 1 | <?php |
2 | 2 | class CheckShortcodes 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 testCheckShortcodes() |
|
18 | - { |
|
19 | - $this->logInfo('Testing shortcodes......'); |
|
20 | - |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
23 | - $this->byId('title')->value('Shortcode Test: Home Page Map'); |
|
24 | - $this->byId('content')->value('[gd_homepage_map width=100% height=300 scrollwheel=false]'); |
|
25 | - $this->byId('publish')->click(); |
|
26 | - $this->waitForPageLoadAndCheckForErrors(); |
|
27 | - $this->byLinkText('View page')->click(); |
|
28 | - $this->waitForPageLoadAndCheckForErrors(); |
|
29 | - $this->assertTrue( $this->isTextPresent("geodir-map-home-page"), "Home page map not found"); |
|
30 | - |
|
31 | - |
|
32 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
33 | - $this->waitForPageLoadAndCheckForErrors(); |
|
34 | - $this->byId('title')->value('Shortcode Test: Custom Post Type Categories'); |
|
35 | - $this->byId('content')->value('[gd_cpt_categories show_count=1]'); |
|
36 | - $this->byId('publish')->click(); |
|
37 | - $this->waitForPageLoadAndCheckForErrors(); |
|
38 | - $this->byLinkText('View page')->click(); |
|
39 | - $this->waitForPageLoadAndCheckForErrors(); |
|
40 | - $this->assertTrue( $this->isTextPresent("gd-cptcats-widget"), "Custom Post Type Categories not found"); |
|
41 | - |
|
42 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
43 | - $this->waitForPageLoadAndCheckForErrors(); |
|
44 | - $this->byId('title')->value('Shortcode Test: Listings Page Map'); |
|
45 | - $this->byId('content')->value('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]'); |
|
46 | - $this->byId('publish')->click(); |
|
47 | - $this->waitForPageLoadAndCheckForErrors(); |
|
48 | - $this->byLinkText('View page')->click(); |
|
49 | - $this->waitForPageLoadAndCheckForErrors(); |
|
50 | - $this->assertTrue( $this->isTextPresent("geodir-map-listing-page"), "Listings Page Map not found"); |
|
51 | - |
|
52 | - |
|
53 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
54 | - $this->waitForPageLoadAndCheckForErrors(); |
|
55 | - $this->byId('title')->value('Shortcode Test: Listing Slider'); |
|
56 | - $this->byId('content')->value('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]'); |
|
57 | - $this->byId('publish')->click(); |
|
58 | - $this->waitForPageLoadAndCheckForErrors(); |
|
59 | - $this->byLinkText('View page')->click(); |
|
60 | - $this->waitForPageLoadAndCheckForErrors(); |
|
61 | - $this->assertTrue( $this->isTextPresent("geodir_widget_carousel"), "Listing Slider not found"); |
|
62 | - |
|
63 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
64 | - $this->waitForPageLoadAndCheckForErrors(); |
|
65 | - $this->byId('title')->value('Shortcode Test: Login Box'); |
|
66 | - $this->byId('content')->value('[gd_login_box]'); |
|
67 | - $this->byId('publish')->click(); |
|
68 | - $this->waitForPageLoadAndCheckForErrors(); |
|
69 | - $this->byLinkText('View page')->click(); |
|
70 | - $this->waitForPageLoadAndCheckForErrors(); |
|
71 | - $this->assertTrue( $this->isTextPresent("geodir-loginbox-list"), "Login Box not found"); |
|
72 | - |
|
73 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
74 | - $this->waitForPageLoadAndCheckForErrors(); |
|
75 | - $this->byId('title')->value('Shortcode Test: Popular Post Category'); |
|
76 | - $this->byId('content')->value('[gd_popular_post_category category_limit=10]'); |
|
77 | - $this->byId('publish')->click(); |
|
78 | - $this->waitForPageLoadAndCheckForErrors(); |
|
79 | - $this->byLinkText('View page')->click(); |
|
80 | - $this->waitForPageLoadAndCheckForErrors(); |
|
81 | - $this->assertTrue( $this->isTextPresent("geodir-popular-cat-list"), "Popular Post Category not found"); |
|
82 | - |
|
83 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
84 | - $this->waitForPageLoadAndCheckForErrors(); |
|
85 | - $this->byId('title')->value('Shortcode Test: Popular Post View'); |
|
86 | - $this->byId('content')->value('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]'); |
|
87 | - $this->byId('publish')->click(); |
|
88 | - $this->waitForPageLoadAndCheckForErrors(); |
|
89 | - $this->byLinkText('View page')->click(); |
|
90 | - $this->waitForPageLoadAndCheckForErrors(); |
|
91 | - $this->assertTrue( $this->isTextPresent("geodir_category_list_view"), "Popular Post View not found"); |
|
92 | - |
|
93 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
94 | - $this->waitForPageLoadAndCheckForErrors(); |
|
95 | - $this->byId('title')->value('Shortcode Test: Recent Review'); |
|
96 | - $this->byId('content')->value('[gd_recent_reviews count=5]'); |
|
97 | - $this->byId('publish')->click(); |
|
98 | - $this->waitForPageLoadAndCheckForErrors(); |
|
99 | - $this->byLinkText('View page')->click(); |
|
100 | - $this->waitForPageLoadAndCheckForErrors(); |
|
101 | - $this->assertTrue( $this->isTextPresent("geodir_sc_recent_reviews"), "Recent Review not found"); |
|
102 | - |
|
103 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
104 | - $this->waitForPageLoadAndCheckForErrors(); |
|
105 | - $this->byId('title')->value('Shortcode Test: Related Listings'); |
|
106 | - $this->byId('content')->value('[gd_related_listings relate_to=tags layout=3 add_location_filter=true list_sort=featured character_count=0]'); |
|
107 | - $this->byId('publish')->click(); |
|
108 | - $this->waitForPageLoadAndCheckForErrors(); |
|
109 | - $this->byLinkText('View page')->click(); |
|
110 | - $this->waitForPageLoadAndCheckForErrors(); |
|
111 | - $this->assertTrue( $this->isTextPresent("geodir_location_listing"), "Related Listings not found"); |
|
112 | - |
|
113 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
114 | - $this->waitForPageLoadAndCheckForErrors(); |
|
115 | - $this->byId('title')->value('Shortcode Test: Search'); |
|
116 | - $this->byId('content')->value('[gd_advanced_search]'); |
|
117 | - $this->byId('publish')->click(); |
|
118 | - $this->waitForPageLoadAndCheckForErrors(); |
|
119 | - $this->byLinkText('View page')->click(); |
|
120 | - $this->waitForPageLoadAndCheckForErrors(); |
|
121 | - $this->assertTrue( $this->isTextPresent("geodir-map-home-page"), "Search not found"); |
|
122 | - |
|
123 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
124 | - $this->waitForPageLoadAndCheckForErrors(); |
|
125 | - $this->byId('title')->value('Shortcode Test: GD Listings'); |
|
126 | - $this->byId('content')->value('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]'); |
|
127 | - $this->byId('publish')->click(); |
|
128 | - $this->waitForPageLoadAndCheckForErrors(); |
|
129 | - $this->byLinkText('View page')->click(); |
|
130 | - $this->waitForPageLoadAndCheckForErrors(); |
|
131 | - $this->assertTrue( $this->isTextPresent("geodir-sc-gd-listings"), "GD Listings not found"); |
|
132 | - |
|
133 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
134 | - $this->waitForPageLoadAndCheckForErrors(); |
|
135 | - $this->byId('title')->value('Shortcode Test: GD Best of'); |
|
136 | - $this->byId('content')->value('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]'); |
|
137 | - $this->byId('publish')->click(); |
|
138 | - $this->waitForPageLoadAndCheckForErrors(); |
|
139 | - $this->byLinkText('View page')->click(); |
|
140 | - $this->waitForPageLoadAndCheckForErrors(); |
|
141 | - $this->assertTrue( $this->isTextPresent("geodir_bestof_widget"), "GD Best of not found"); |
|
142 | - |
|
143 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
144 | - $this->waitForPageLoadAndCheckForErrors(); |
|
145 | - $this->byId('title')->value('Shortcode Test: Add Listing Form'); |
|
146 | - $this->byId('content')->value('[gd_add_listing listing_type=gd_event login_msg="Please register and login to submit listings" show_login=true]'); |
|
147 | - $this->byId('publish')->click(); |
|
148 | - $this->waitForPageLoadAndCheckForErrors(); |
|
149 | - $this->byLinkText('View page')->click(); |
|
150 | - $this->waitForPageLoadAndCheckForErrors(); |
|
151 | - $this->assertTrue( $this->isTextPresent("geodir-add-listing-submit"), "Add Listing Form not found"); |
|
152 | - } |
|
153 | - |
|
154 | - public function tearDown() |
|
155 | - { |
|
156 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
157 | - //write current file number to completed.txt |
|
158 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
159 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
160 | - fwrite($completed, $CurrentFileNumber); |
|
161 | - } |
|
162 | - } |
|
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 testCheckShortcodes() |
|
18 | + { |
|
19 | + $this->logInfo('Testing shortcodes......'); |
|
20 | + |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | + $this->byId('title')->value('Shortcode Test: Home Page Map'); |
|
24 | + $this->byId('content')->value('[gd_homepage_map width=100% height=300 scrollwheel=false]'); |
|
25 | + $this->byId('publish')->click(); |
|
26 | + $this->waitForPageLoadAndCheckForErrors(); |
|
27 | + $this->byLinkText('View page')->click(); |
|
28 | + $this->waitForPageLoadAndCheckForErrors(); |
|
29 | + $this->assertTrue( $this->isTextPresent("geodir-map-home-page"), "Home page map not found"); |
|
30 | + |
|
31 | + |
|
32 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
33 | + $this->waitForPageLoadAndCheckForErrors(); |
|
34 | + $this->byId('title')->value('Shortcode Test: Custom Post Type Categories'); |
|
35 | + $this->byId('content')->value('[gd_cpt_categories show_count=1]'); |
|
36 | + $this->byId('publish')->click(); |
|
37 | + $this->waitForPageLoadAndCheckForErrors(); |
|
38 | + $this->byLinkText('View page')->click(); |
|
39 | + $this->waitForPageLoadAndCheckForErrors(); |
|
40 | + $this->assertTrue( $this->isTextPresent("gd-cptcats-widget"), "Custom Post Type Categories not found"); |
|
41 | + |
|
42 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
43 | + $this->waitForPageLoadAndCheckForErrors(); |
|
44 | + $this->byId('title')->value('Shortcode Test: Listings Page Map'); |
|
45 | + $this->byId('content')->value('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]'); |
|
46 | + $this->byId('publish')->click(); |
|
47 | + $this->waitForPageLoadAndCheckForErrors(); |
|
48 | + $this->byLinkText('View page')->click(); |
|
49 | + $this->waitForPageLoadAndCheckForErrors(); |
|
50 | + $this->assertTrue( $this->isTextPresent("geodir-map-listing-page"), "Listings Page Map not found"); |
|
51 | + |
|
52 | + |
|
53 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
54 | + $this->waitForPageLoadAndCheckForErrors(); |
|
55 | + $this->byId('title')->value('Shortcode Test: Listing Slider'); |
|
56 | + $this->byId('content')->value('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]'); |
|
57 | + $this->byId('publish')->click(); |
|
58 | + $this->waitForPageLoadAndCheckForErrors(); |
|
59 | + $this->byLinkText('View page')->click(); |
|
60 | + $this->waitForPageLoadAndCheckForErrors(); |
|
61 | + $this->assertTrue( $this->isTextPresent("geodir_widget_carousel"), "Listing Slider not found"); |
|
62 | + |
|
63 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
64 | + $this->waitForPageLoadAndCheckForErrors(); |
|
65 | + $this->byId('title')->value('Shortcode Test: Login Box'); |
|
66 | + $this->byId('content')->value('[gd_login_box]'); |
|
67 | + $this->byId('publish')->click(); |
|
68 | + $this->waitForPageLoadAndCheckForErrors(); |
|
69 | + $this->byLinkText('View page')->click(); |
|
70 | + $this->waitForPageLoadAndCheckForErrors(); |
|
71 | + $this->assertTrue( $this->isTextPresent("geodir-loginbox-list"), "Login Box not found"); |
|
72 | + |
|
73 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
74 | + $this->waitForPageLoadAndCheckForErrors(); |
|
75 | + $this->byId('title')->value('Shortcode Test: Popular Post Category'); |
|
76 | + $this->byId('content')->value('[gd_popular_post_category category_limit=10]'); |
|
77 | + $this->byId('publish')->click(); |
|
78 | + $this->waitForPageLoadAndCheckForErrors(); |
|
79 | + $this->byLinkText('View page')->click(); |
|
80 | + $this->waitForPageLoadAndCheckForErrors(); |
|
81 | + $this->assertTrue( $this->isTextPresent("geodir-popular-cat-list"), "Popular Post Category not found"); |
|
82 | + |
|
83 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
84 | + $this->waitForPageLoadAndCheckForErrors(); |
|
85 | + $this->byId('title')->value('Shortcode Test: Popular Post View'); |
|
86 | + $this->byId('content')->value('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]'); |
|
87 | + $this->byId('publish')->click(); |
|
88 | + $this->waitForPageLoadAndCheckForErrors(); |
|
89 | + $this->byLinkText('View page')->click(); |
|
90 | + $this->waitForPageLoadAndCheckForErrors(); |
|
91 | + $this->assertTrue( $this->isTextPresent("geodir_category_list_view"), "Popular Post View not found"); |
|
92 | + |
|
93 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
94 | + $this->waitForPageLoadAndCheckForErrors(); |
|
95 | + $this->byId('title')->value('Shortcode Test: Recent Review'); |
|
96 | + $this->byId('content')->value('[gd_recent_reviews count=5]'); |
|
97 | + $this->byId('publish')->click(); |
|
98 | + $this->waitForPageLoadAndCheckForErrors(); |
|
99 | + $this->byLinkText('View page')->click(); |
|
100 | + $this->waitForPageLoadAndCheckForErrors(); |
|
101 | + $this->assertTrue( $this->isTextPresent("geodir_sc_recent_reviews"), "Recent Review not found"); |
|
102 | + |
|
103 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
104 | + $this->waitForPageLoadAndCheckForErrors(); |
|
105 | + $this->byId('title')->value('Shortcode Test: Related Listings'); |
|
106 | + $this->byId('content')->value('[gd_related_listings relate_to=tags layout=3 add_location_filter=true list_sort=featured character_count=0]'); |
|
107 | + $this->byId('publish')->click(); |
|
108 | + $this->waitForPageLoadAndCheckForErrors(); |
|
109 | + $this->byLinkText('View page')->click(); |
|
110 | + $this->waitForPageLoadAndCheckForErrors(); |
|
111 | + $this->assertTrue( $this->isTextPresent("geodir_location_listing"), "Related Listings not found"); |
|
112 | + |
|
113 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
114 | + $this->waitForPageLoadAndCheckForErrors(); |
|
115 | + $this->byId('title')->value('Shortcode Test: Search'); |
|
116 | + $this->byId('content')->value('[gd_advanced_search]'); |
|
117 | + $this->byId('publish')->click(); |
|
118 | + $this->waitForPageLoadAndCheckForErrors(); |
|
119 | + $this->byLinkText('View page')->click(); |
|
120 | + $this->waitForPageLoadAndCheckForErrors(); |
|
121 | + $this->assertTrue( $this->isTextPresent("geodir-map-home-page"), "Search not found"); |
|
122 | + |
|
123 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
124 | + $this->waitForPageLoadAndCheckForErrors(); |
|
125 | + $this->byId('title')->value('Shortcode Test: GD Listings'); |
|
126 | + $this->byId('content')->value('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]'); |
|
127 | + $this->byId('publish')->click(); |
|
128 | + $this->waitForPageLoadAndCheckForErrors(); |
|
129 | + $this->byLinkText('View page')->click(); |
|
130 | + $this->waitForPageLoadAndCheckForErrors(); |
|
131 | + $this->assertTrue( $this->isTextPresent("geodir-sc-gd-listings"), "GD Listings not found"); |
|
132 | + |
|
133 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
134 | + $this->waitForPageLoadAndCheckForErrors(); |
|
135 | + $this->byId('title')->value('Shortcode Test: GD Best of'); |
|
136 | + $this->byId('content')->value('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]'); |
|
137 | + $this->byId('publish')->click(); |
|
138 | + $this->waitForPageLoadAndCheckForErrors(); |
|
139 | + $this->byLinkText('View page')->click(); |
|
140 | + $this->waitForPageLoadAndCheckForErrors(); |
|
141 | + $this->assertTrue( $this->isTextPresent("geodir_bestof_widget"), "GD Best of not found"); |
|
142 | + |
|
143 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
|
144 | + $this->waitForPageLoadAndCheckForErrors(); |
|
145 | + $this->byId('title')->value('Shortcode Test: Add Listing Form'); |
|
146 | + $this->byId('content')->value('[gd_add_listing listing_type=gd_event login_msg="Please register and login to submit listings" show_login=true]'); |
|
147 | + $this->byId('publish')->click(); |
|
148 | + $this->waitForPageLoadAndCheckForErrors(); |
|
149 | + $this->byLinkText('View page')->click(); |
|
150 | + $this->waitForPageLoadAndCheckForErrors(); |
|
151 | + $this->assertTrue( $this->isTextPresent("geodir-add-listing-submit"), "Add Listing Form not found"); |
|
152 | + } |
|
153 | + |
|
154 | + public function tearDown() |
|
155 | + { |
|
156 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
157 | + //write current file number to completed.txt |
|
158 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
159 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
160 | + fwrite($completed, $CurrentFileNumber); |
|
161 | + } |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | ?> |
165 | 165 | \ No newline at end of file |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->waitForPageLoadAndCheckForErrors(); |
27 | 27 | $this->byLinkText('View page')->click(); |
28 | 28 | $this->waitForPageLoadAndCheckForErrors(); |
29 | - $this->assertTrue( $this->isTextPresent("geodir-map-home-page"), "Home page map not found"); |
|
29 | + $this->assertTrue($this->isTextPresent("geodir-map-home-page"), "Home page map not found"); |
|
30 | 30 | |
31 | 31 | |
32 | 32 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->waitForPageLoadAndCheckForErrors(); |
38 | 38 | $this->byLinkText('View page')->click(); |
39 | 39 | $this->waitForPageLoadAndCheckForErrors(); |
40 | - $this->assertTrue( $this->isTextPresent("gd-cptcats-widget"), "Custom Post Type Categories not found"); |
|
40 | + $this->assertTrue($this->isTextPresent("gd-cptcats-widget"), "Custom Post Type Categories not found"); |
|
41 | 41 | |
42 | 42 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
43 | 43 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->waitForPageLoadAndCheckForErrors(); |
48 | 48 | $this->byLinkText('View page')->click(); |
49 | 49 | $this->waitForPageLoadAndCheckForErrors(); |
50 | - $this->assertTrue( $this->isTextPresent("geodir-map-listing-page"), "Listings Page Map not found"); |
|
50 | + $this->assertTrue($this->isTextPresent("geodir-map-listing-page"), "Listings Page Map not found"); |
|
51 | 51 | |
52 | 52 | |
53 | 53 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->waitForPageLoadAndCheckForErrors(); |
59 | 59 | $this->byLinkText('View page')->click(); |
60 | 60 | $this->waitForPageLoadAndCheckForErrors(); |
61 | - $this->assertTrue( $this->isTextPresent("geodir_widget_carousel"), "Listing Slider not found"); |
|
61 | + $this->assertTrue($this->isTextPresent("geodir_widget_carousel"), "Listing Slider not found"); |
|
62 | 62 | |
63 | 63 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
64 | 64 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $this->waitForPageLoadAndCheckForErrors(); |
69 | 69 | $this->byLinkText('View page')->click(); |
70 | 70 | $this->waitForPageLoadAndCheckForErrors(); |
71 | - $this->assertTrue( $this->isTextPresent("geodir-loginbox-list"), "Login Box not found"); |
|
71 | + $this->assertTrue($this->isTextPresent("geodir-loginbox-list"), "Login Box not found"); |
|
72 | 72 | |
73 | 73 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
74 | 74 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->waitForPageLoadAndCheckForErrors(); |
79 | 79 | $this->byLinkText('View page')->click(); |
80 | 80 | $this->waitForPageLoadAndCheckForErrors(); |
81 | - $this->assertTrue( $this->isTextPresent("geodir-popular-cat-list"), "Popular Post Category not found"); |
|
81 | + $this->assertTrue($this->isTextPresent("geodir-popular-cat-list"), "Popular Post Category not found"); |
|
82 | 82 | |
83 | 83 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
84 | 84 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->waitForPageLoadAndCheckForErrors(); |
89 | 89 | $this->byLinkText('View page')->click(); |
90 | 90 | $this->waitForPageLoadAndCheckForErrors(); |
91 | - $this->assertTrue( $this->isTextPresent("geodir_category_list_view"), "Popular Post View not found"); |
|
91 | + $this->assertTrue($this->isTextPresent("geodir_category_list_view"), "Popular Post View not found"); |
|
92 | 92 | |
93 | 93 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
94 | 94 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->waitForPageLoadAndCheckForErrors(); |
99 | 99 | $this->byLinkText('View page')->click(); |
100 | 100 | $this->waitForPageLoadAndCheckForErrors(); |
101 | - $this->assertTrue( $this->isTextPresent("geodir_sc_recent_reviews"), "Recent Review not found"); |
|
101 | + $this->assertTrue($this->isTextPresent("geodir_sc_recent_reviews"), "Recent Review not found"); |
|
102 | 102 | |
103 | 103 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
104 | 104 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $this->waitForPageLoadAndCheckForErrors(); |
109 | 109 | $this->byLinkText('View page')->click(); |
110 | 110 | $this->waitForPageLoadAndCheckForErrors(); |
111 | - $this->assertTrue( $this->isTextPresent("geodir_location_listing"), "Related Listings not found"); |
|
111 | + $this->assertTrue($this->isTextPresent("geodir_location_listing"), "Related Listings not found"); |
|
112 | 112 | |
113 | 113 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
114 | 114 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $this->waitForPageLoadAndCheckForErrors(); |
119 | 119 | $this->byLinkText('View page')->click(); |
120 | 120 | $this->waitForPageLoadAndCheckForErrors(); |
121 | - $this->assertTrue( $this->isTextPresent("geodir-map-home-page"), "Search not found"); |
|
121 | + $this->assertTrue($this->isTextPresent("geodir-map-home-page"), "Search not found"); |
|
122 | 122 | |
123 | 123 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
124 | 124 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $this->waitForPageLoadAndCheckForErrors(); |
129 | 129 | $this->byLinkText('View page')->click(); |
130 | 130 | $this->waitForPageLoadAndCheckForErrors(); |
131 | - $this->assertTrue( $this->isTextPresent("geodir-sc-gd-listings"), "GD Listings not found"); |
|
131 | + $this->assertTrue($this->isTextPresent("geodir-sc-gd-listings"), "GD Listings not found"); |
|
132 | 132 | |
133 | 133 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
134 | 134 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $this->waitForPageLoadAndCheckForErrors(); |
139 | 139 | $this->byLinkText('View page')->click(); |
140 | 140 | $this->waitForPageLoadAndCheckForErrors(); |
141 | - $this->assertTrue( $this->isTextPresent("geodir_bestof_widget"), "GD Best of not found"); |
|
141 | + $this->assertTrue($this->isTextPresent("geodir_bestof_widget"), "GD Best of not found"); |
|
142 | 142 | |
143 | 143 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/post-new.php?post_type=page'); |
144 | 144 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->waitForPageLoadAndCheckForErrors(); |
149 | 149 | $this->byLinkText('View page')->click(); |
150 | 150 | $this->waitForPageLoadAndCheckForErrors(); |
151 | - $this->assertTrue( $this->isTextPresent("geodir-add-listing-submit"), "Add Listing Form not found"); |
|
151 | + $this->assertTrue($this->isTextPresent("geodir-add-listing-submit"), "Add Listing Form not found"); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | public function tearDown() |
@@ -1,58 +1,58 @@ |
||
1 | 1 | <?php |
2 | 2 | class SortReview 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 testSortReview() |
|
18 | - { |
|
19 | - $this->logInfo('sorting reviews......'); |
|
20 | - //make sure advance search filters plugin active |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
17 | + public function testSortReview() |
|
18 | + { |
|
19 | + $this->logInfo('sorting reviews......'); |
|
20 | + //make sure advance search filters plugin active |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | 23 | |
24 | - $is_active = $this->byId("geodirectory-review-rating-manager")->attribute('class'); |
|
25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | - //Activate Geodirectory Review Rating Manager |
|
27 | - $this->maybeActivatePlugin("geodirectory-review-rating-manager", 20000); |
|
28 | - //go back to plugin page |
|
29 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
30 | - } |
|
24 | + $is_active = $this->byId("geodirectory-review-rating-manager")->attribute('class'); |
|
25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | + //Activate Geodirectory Review Rating Manager |
|
27 | + $this->maybeActivatePlugin("geodirectory-review-rating-manager", 20000); |
|
28 | + //go back to plugin page |
|
29 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
30 | + } |
|
31 | 31 | |
32 | - $is_active1 = $this->byId("geodirectory-review-rating-manager")->attribute('class'); |
|
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Review Rating Manager plugin not active"); |
|
32 | + $is_active1 = $this->byId("geodirectory-review-rating-manager")->attribute('class'); |
|
33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "Review Rating Manager plugin not active"); |
|
34 | 34 | |
35 | - //Make sure Enable comment list sorting checked. |
|
36 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=multirating_fields&subtab=geodir_multirating_options'); |
|
37 | - $this->waitForPageLoadAndCheckForErrors(); |
|
38 | - $is_checked = $this->byId('geodir_reviewrating_enable_sorting')->attribute('checked'); |
|
39 | - if (!$is_checked) { |
|
40 | - $this->byId('geodir_reviewrating_enable_sorting')->click(); |
|
41 | - $this->byName('save')->click(); |
|
42 | - $this->waitForPageLoadAndCheckForErrors(); |
|
43 | - } |
|
44 | - $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/test-listing/?comment_sorting=high_rating'); |
|
45 | - $this->waitForPageLoadAndCheckForErrors(); |
|
46 | - } |
|
35 | + //Make sure Enable comment list sorting checked. |
|
36 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=multirating_fields&subtab=geodir_multirating_options'); |
|
37 | + $this->waitForPageLoadAndCheckForErrors(); |
|
38 | + $is_checked = $this->byId('geodir_reviewrating_enable_sorting')->attribute('checked'); |
|
39 | + if (!$is_checked) { |
|
40 | + $this->byId('geodir_reviewrating_enable_sorting')->click(); |
|
41 | + $this->byName('save')->click(); |
|
42 | + $this->waitForPageLoadAndCheckForErrors(); |
|
43 | + } |
|
44 | + $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/test-listing/?comment_sorting=high_rating'); |
|
45 | + $this->waitForPageLoadAndCheckForErrors(); |
|
46 | + } |
|
47 | 47 | |
48 | - public function tearDown() |
|
49 | - { |
|
50 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
51 | - //write current file number to completed.txt |
|
52 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
53 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
54 | - fwrite($completed, $CurrentFileNumber); |
|
55 | - } |
|
56 | - } |
|
48 | + public function tearDown() |
|
49 | + { |
|
50 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
51 | + //write current file number to completed.txt |
|
52 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
53 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
54 | + fwrite($completed, $CurrentFileNumber); |
|
55 | + } |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | ?> |
59 | 59 | \ No newline at end of file |
@@ -30,7 +30,7 @@ |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $is_active1 = $this->byId("geodirectory-review-rating-manager")->attribute('class'); |
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Review Rating Manager plugin not active"); |
|
33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "Review Rating Manager plugin not active"); |
|
34 | 34 | |
35 | 35 | //Make sure Enable comment list sorting checked. |
36 | 36 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=multirating_fields&subtab=geodir_multirating_options'); |
@@ -1,70 +1,70 @@ |
||
1 | 1 | <?php |
2 | 2 | class AddListing 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 testAddListing() |
|
18 | - { |
|
19 | - $this->logInfo('Add GD Place listing......'); |
|
20 | - $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
|
21 | - $this->waitForPageLoadAndCheckForErrors(); |
|
22 | - if ($this->isTextPresent("Sign In")) { |
|
23 | - $this->byId('user_login')->value('[email protected]'); |
|
24 | - $this->byId('user_pass')->value('1'); |
|
25 | - $this->byId('rememberme')->click(); |
|
26 | - // Submit the form |
|
27 | - $this->byId('cus_loginform')->submit(); |
|
28 | - $this->waitForPageLoadAndCheckForErrors(); |
|
29 | - $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
|
30 | - } |
|
31 | - $this->assertTrue( $this->isTextPresent("Add Place"), "Add Place text not found"); |
|
32 | - $this->byId('post_title')->value('Test Listing'); |
|
33 | - $this->byId('post_desc')->value('Test Desc'); |
|
34 | - $this->byId('post_tags')->value('tag1,tag2'); |
|
35 | - $this->ExecuteScript('jQuery("select#gd_placecategory").show();'); |
|
36 | - $this->select($this->byXPath("//select[@id='gd_placecategory']"))->selectOptionByLabel('Attractions'); |
|
37 | - $this->waitForPageLoadAndCheckForErrors(2000); |
|
38 | - $this->byId('post_address')->value('wall street'); |
|
39 | - $this->byId('post_address')->value('10006'); |
|
40 | - $this->byId('post_set_address_button')->click(); |
|
41 | - $this->waitForPageLoadAndCheckForErrors(); |
|
42 | - $this->byId('geodir_timing')->value('10.00 am to 6 pm every day'); |
|
43 | - $this->byId('geodir_contact')->value('444444444444'); |
|
44 | - $this->byId('geodir_email')->value('[email protected]'); |
|
45 | - $this->byId('geodir_website')->value('http://test.com'); |
|
46 | - $this->byId('geodir_twitter')->value('http://twitter.com/test'); |
|
47 | - $this->byId('geodir_facebook')->value('http://facebook.com/test'); |
|
48 | - $this->byId('geodir_special_offers')->value('Test Offer'); |
|
49 | - $this->byId('geodir_accept_term_condition')->click(); |
|
50 | - // Submit the form |
|
51 | - $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
|
52 | - $this->waitForPageLoadAndCheckForErrors(); |
|
53 | - $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
54 | - // Submit the form |
|
55 | - $this->byClassName('geodir_publish_button')->click(); |
|
56 | - $this->waitForPageLoadAndCheckForErrors(); |
|
57 | - $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
58 | - } |
|
17 | + public function testAddListing() |
|
18 | + { |
|
19 | + $this->logInfo('Add GD Place listing......'); |
|
20 | + $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
|
21 | + $this->waitForPageLoadAndCheckForErrors(); |
|
22 | + if ($this->isTextPresent("Sign In")) { |
|
23 | + $this->byId('user_login')->value('[email protected]'); |
|
24 | + $this->byId('user_pass')->value('1'); |
|
25 | + $this->byId('rememberme')->click(); |
|
26 | + // Submit the form |
|
27 | + $this->byId('cus_loginform')->submit(); |
|
28 | + $this->waitForPageLoadAndCheckForErrors(); |
|
29 | + $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
|
30 | + } |
|
31 | + $this->assertTrue( $this->isTextPresent("Add Place"), "Add Place text not found"); |
|
32 | + $this->byId('post_title')->value('Test Listing'); |
|
33 | + $this->byId('post_desc')->value('Test Desc'); |
|
34 | + $this->byId('post_tags')->value('tag1,tag2'); |
|
35 | + $this->ExecuteScript('jQuery("select#gd_placecategory").show();'); |
|
36 | + $this->select($this->byXPath("//select[@id='gd_placecategory']"))->selectOptionByLabel('Attractions'); |
|
37 | + $this->waitForPageLoadAndCheckForErrors(2000); |
|
38 | + $this->byId('post_address')->value('wall street'); |
|
39 | + $this->byId('post_address')->value('10006'); |
|
40 | + $this->byId('post_set_address_button')->click(); |
|
41 | + $this->waitForPageLoadAndCheckForErrors(); |
|
42 | + $this->byId('geodir_timing')->value('10.00 am to 6 pm every day'); |
|
43 | + $this->byId('geodir_contact')->value('444444444444'); |
|
44 | + $this->byId('geodir_email')->value('[email protected]'); |
|
45 | + $this->byId('geodir_website')->value('http://test.com'); |
|
46 | + $this->byId('geodir_twitter')->value('http://twitter.com/test'); |
|
47 | + $this->byId('geodir_facebook')->value('http://facebook.com/test'); |
|
48 | + $this->byId('geodir_special_offers')->value('Test Offer'); |
|
49 | + $this->byId('geodir_accept_term_condition')->click(); |
|
50 | + // Submit the form |
|
51 | + $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
|
52 | + $this->waitForPageLoadAndCheckForErrors(); |
|
53 | + $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
54 | + // Submit the form |
|
55 | + $this->byClassName('geodir_publish_button')->click(); |
|
56 | + $this->waitForPageLoadAndCheckForErrors(); |
|
57 | + $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
58 | + } |
|
59 | 59 | |
60 | - public function tearDown() |
|
61 | - { |
|
62 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
63 | - //write current file number to completed.txt |
|
64 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
65 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
66 | - fwrite($completed, $CurrentFileNumber); |
|
67 | - } |
|
68 | - } |
|
60 | + public function tearDown() |
|
61 | + { |
|
62 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
63 | + //write current file number to completed.txt |
|
64 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
65 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
66 | + fwrite($completed, $CurrentFileNumber); |
|
67 | + } |
|
68 | + } |
|
69 | 69 | } |
70 | 70 | ?> |
71 | 71 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $this->waitForPageLoadAndCheckForErrors(); |
29 | 29 | $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_place'); |
30 | 30 | } |
31 | - $this->assertTrue( $this->isTextPresent("Add Place"), "Add Place text not found"); |
|
31 | + $this->assertTrue($this->isTextPresent("Add Place"), "Add Place text not found"); |
|
32 | 32 | $this->byId('post_title')->value('Test Listing'); |
33 | 33 | $this->byId('post_desc')->value('Test Desc'); |
34 | 34 | $this->byId('post_tags')->value('tag1,tag2'); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | // Submit the form |
51 | 51 | $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
52 | 52 | $this->waitForPageLoadAndCheckForErrors(); |
53 | - $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
53 | + $this->assertTrue($this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
54 | 54 | // Submit the form |
55 | 55 | $this->byClassName('geodir_publish_button')->click(); |
56 | 56 | $this->waitForPageLoadAndCheckForErrors(); |
57 | - $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
57 | + $this->assertTrue($this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function tearDown() |
@@ -1,69 +1,69 @@ |
||
1 | 1 | <?php |
2 | 2 | class LocationlessCPT 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 testLocationlessCPT() |
|
18 | - { |
|
19 | - $this->logInfo('Testing locationless CPT......'); |
|
20 | - //make sure custom post types plugin active |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
17 | + public function testLocationlessCPT() |
|
18 | + { |
|
19 | + $this->logInfo('Testing locationless CPT......'); |
|
20 | + //make sure custom post types plugin active |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | 23 | |
24 | - $is_active = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | - //Activate Geodirectory Custom Post Types |
|
27 | - $this->maybeActivatePlugin("geodirectory-custom-post-types", 20000); |
|
28 | - //go back to plugin page |
|
29 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
30 | - } |
|
24 | + $is_active = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | + //Activate Geodirectory Custom Post Types |
|
27 | + $this->maybeActivatePlugin("geodirectory-custom-post-types", 20000); |
|
28 | + //go back to plugin page |
|
29 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
30 | + } |
|
31 | 31 | |
32 | - $is_active1 = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
32 | + $is_active1 = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
|
33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
34 | 34 | |
35 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts'); |
|
36 | - $this->waitForPageLoadAndCheckForErrors(); |
|
37 | - if ($this->isTextPresent("gd_product")) { |
|
38 | - echo "Product post type already found. Please delete it to test a locationless CPT"; |
|
39 | - return; |
|
40 | - } |
|
35 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts'); |
|
36 | + $this->waitForPageLoadAndCheckForErrors(); |
|
37 | + if ($this->isTextPresent("gd_product")) { |
|
38 | + echo "Product post type already found. Please delete it to test a locationless CPT"; |
|
39 | + return; |
|
40 | + } |
|
41 | 41 | |
42 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts&action=cp_addedit'); |
|
43 | - $this->waitForPageLoadAndCheckForErrors(); |
|
44 | - $this->assertTrue( $this->isTextPresent("Post Type"), "Post Type text not found"); |
|
45 | - $this->byId('geodir_custom_post_type')->value('product'); |
|
46 | - $this->byId('geodir_listing_slug')->value('products'); |
|
47 | - $this->byId('geodir_listing_order')->value('10'); |
|
48 | - $this->byId('geodir_name')->value('Products'); |
|
49 | - $this->byId('geodir_singular_name')->value('Product'); |
|
50 | - $this->byName('geodir_save_post_type')->click(); |
|
51 | - $this->waitForPageLoadAndCheckForErrors(); |
|
42 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts&action=cp_addedit'); |
|
43 | + $this->waitForPageLoadAndCheckForErrors(); |
|
44 | + $this->assertTrue( $this->isTextPresent("Post Type"), "Post Type text not found"); |
|
45 | + $this->byId('geodir_custom_post_type')->value('product'); |
|
46 | + $this->byId('geodir_listing_slug')->value('products'); |
|
47 | + $this->byId('geodir_listing_order')->value('10'); |
|
48 | + $this->byId('geodir_name')->value('Products'); |
|
49 | + $this->byId('geodir_singular_name')->value('Product'); |
|
50 | + $this->byName('geodir_save_post_type')->click(); |
|
51 | + $this->waitForPageLoadAndCheckForErrors(); |
|
52 | 52 | |
53 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings'); |
|
54 | - $this->waitForPageLoadAndCheckForErrors(); |
|
55 | - //Todo:find a way to click chosen dropdown |
|
53 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings'); |
|
54 | + $this->waitForPageLoadAndCheckForErrors(); |
|
55 | + //Todo:find a way to click chosen dropdown |
|
56 | 56 | |
57 | - } |
|
57 | + } |
|
58 | 58 | |
59 | - public function tearDown() |
|
60 | - { |
|
61 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
62 | - //write current file number to completed.txt |
|
63 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
64 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
65 | - fwrite($completed, $CurrentFileNumber); |
|
66 | - } |
|
67 | - } |
|
59 | + public function tearDown() |
|
60 | + { |
|
61 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
62 | + //write current file number to completed.txt |
|
63 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
64 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
65 | + fwrite($completed, $CurrentFileNumber); |
|
66 | + } |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | ?> |
70 | 70 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $is_active1 = $this->byId("geodirectory-custom-post-types")->attribute('class'); |
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "Custom Post Types plugin not active"); |
|
34 | 34 | |
35 | 35 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts'); |
36 | 36 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_posts&action=cp_addedit'); |
43 | 43 | $this->waitForPageLoadAndCheckForErrors(); |
44 | - $this->assertTrue( $this->isTextPresent("Post Type"), "Post Type text not found"); |
|
44 | + $this->assertTrue($this->isTextPresent("Post Type"), "Post Type text not found"); |
|
45 | 45 | $this->byId('geodir_custom_post_type')->value('product'); |
46 | 46 | $this->byId('geodir_listing_slug')->value('products'); |
47 | 47 | $this->byId('geodir_listing_order')->value('10'); |