@@ -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'); |
@@ -1,23 +1,23 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class ImportExport 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 testImportExport() |
|
18 | - { |
|
19 | - $this->logInfo('Import Export......'); |
|
20 | - $this->logInfo('Skipping Import Export since its not possible......'); |
|
17 | + public function testImportExport() |
|
18 | + { |
|
19 | + $this->logInfo('Import Export......'); |
|
20 | + $this->logInfo('Skipping Import Export since its not possible......'); |
|
21 | 21 | // //export listing |
22 | 22 | // $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=import_export'); |
23 | 23 | // $this->waitForPageLoadAndCheckForErrors(); |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | // $this->byId('gd_ie_excats_submit')->click(); |
29 | 29 | // $this->waitForPageLoadAndCheckForErrors(); |
30 | 30 | |
31 | - //Todo: find a way to test import |
|
32 | - } |
|
31 | + //Todo: find a way to test import |
|
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,35 +1,35 @@ |
||
1 | 1 | <?php |
2 | 2 | class ExpiryListing 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 testExpiryListing() |
|
18 | - { |
|
19 | - $this->logInfo('Testing expiry listing......'); |
|
20 | - $this->logInfo('Skipping Import Export since its not possible......'); |
|
17 | + public function testExpiryListing() |
|
18 | + { |
|
19 | + $this->logInfo('Testing expiry listing......'); |
|
20 | + $this->logInfo('Skipping Import Export since its not possible......'); |
|
21 | 21 | // $this->url(self::GDTEST_BASE_URL); |
22 | 22 | // $this->waitForPageLoadAndCheckForErrors(); |
23 | - } |
|
23 | + } |
|
24 | 24 | |
25 | - public function tearDown() |
|
26 | - { |
|
27 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
28 | - //write current file number to completed.txt |
|
29 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
30 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
31 | - fwrite($completed, $CurrentFileNumber); |
|
32 | - } |
|
33 | - } |
|
25 | + public function tearDown() |
|
26 | + { |
|
27 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
28 | + //write current file number to completed.txt |
|
29 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
30 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
31 | + fwrite($completed, $CurrentFileNumber); |
|
32 | + } |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | ?> |
36 | 36 | \ No newline at end of file |
@@ -1,110 +1,110 @@ |
||
1 | 1 | <?php |
2 | 2 | class EventToBusiness 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 testEventToBusiness() |
|
18 | - { |
|
19 | - //make sure event manager plugin active |
|
20 | - $this->logInfo('Testing events......'); |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
17 | + public function testEventToBusiness() |
|
18 | + { |
|
19 | + //make sure event manager plugin active |
|
20 | + $this->logInfo('Testing events......'); |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | 23 | |
24 | - $is_active = $this->byId("geodirectory-events")->attribute('class'); |
|
25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | - //Activate Geodirectory Events |
|
27 | - $this->maybeActivatePlugin("geodirectory-events", 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-events")->attribute('class'); |
|
25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | + //Activate Geodirectory Events |
|
27 | + $this->maybeActivatePlugin("geodirectory-events", 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-events")->attribute('class'); |
|
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Events plugin not active"); |
|
32 | + $is_active1 = $this->byId("geodirectory-events")->attribute('class'); |
|
33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "Events plugin not active"); |
|
34 | 34 | |
35 | 35 | |
36 | - // Event post type -> Allow post type to add from frontend |
|
37 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings'); |
|
38 | - $this->waitForPageLoadAndCheckForErrors(); |
|
39 | - $this->byLinkText('Navigation')->click(); |
|
40 | - $this->ExecuteScript('jQuery("#geodir_allow_posttype_frontend").show();'); |
|
41 | - $this->select($this->byId('geodir_allow_posttype_frontend'))->selectOptionByLabel('Event'); |
|
42 | - $this->byName('save')->click(); |
|
43 | - $this->waitForPageLoadAndCheckForErrors(); |
|
36 | + // Event post type -> Allow post type to add from frontend |
|
37 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings'); |
|
38 | + $this->waitForPageLoadAndCheckForErrors(); |
|
39 | + $this->byLinkText('Navigation')->click(); |
|
40 | + $this->ExecuteScript('jQuery("#geodir_allow_posttype_frontend").show();'); |
|
41 | + $this->select($this->byId('geodir_allow_posttype_frontend'))->selectOptionByLabel('Event'); |
|
42 | + $this->byName('save')->click(); |
|
43 | + $this->waitForPageLoadAndCheckForErrors(); |
|
44 | 44 | |
45 | - $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
|
46 | - $this->waitForPageLoadAndCheckForErrors(); |
|
47 | - if ($this->isTextPresent("Sign In")) { |
|
48 | - $this->byId('user_login')->value('[email protected]'); |
|
49 | - $this->byId('user_pass')->value('12345'); |
|
50 | - $this->byId('rememberme')->click(); |
|
51 | - // Submit the form |
|
52 | - $this->byId('cus_loginform')->submit(); |
|
53 | - $this->waitForPageLoadAndCheckForErrors(); |
|
54 | - $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
|
55 | - } |
|
56 | - $this->assertTrue( $this->isTextPresent("Add Event"), "Add Event text not found"); |
|
57 | - //event info |
|
58 | - $this->byId('is_recurring_n')->click(); |
|
59 | - $this->byId('event_start')->value('2016-01-01'); |
|
60 | - $this->byId('event_end')->value('2016-01-31'); |
|
61 | - $this->byId('all_day')->click(); |
|
45 | + $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
|
46 | + $this->waitForPageLoadAndCheckForErrors(); |
|
47 | + if ($this->isTextPresent("Sign In")) { |
|
48 | + $this->byId('user_login')->value('[email protected]'); |
|
49 | + $this->byId('user_pass')->value('12345'); |
|
50 | + $this->byId('rememberme')->click(); |
|
51 | + // Submit the form |
|
52 | + $this->byId('cus_loginform')->submit(); |
|
53 | + $this->waitForPageLoadAndCheckForErrors(); |
|
54 | + $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
|
55 | + } |
|
56 | + $this->assertTrue( $this->isTextPresent("Add Event"), "Add Event text not found"); |
|
57 | + //event info |
|
58 | + $this->byId('is_recurring_n')->click(); |
|
59 | + $this->byId('event_start')->value('2016-01-01'); |
|
60 | + $this->byId('event_end')->value('2016-01-31'); |
|
61 | + $this->byId('all_day')->click(); |
|
62 | 62 | |
63 | 63 | |
64 | - if ($this->isTextPresent("Business Owner/Associate")) { |
|
64 | + if ($this->isTextPresent("Business Owner/Associate")) { |
|
65 | 65 | // $elements = $this->elements($this->using('name')->value('claimed')); |
66 | 66 | // $elements[0]->click(); |
67 | 67 | // $this->byXPath("//input[contains(@name,'claimed') and contains(@value,'0')]")->click(); |
68 | - $this->ExecuteScript('jQuery("#geodir_claimed_row input:radio:first").prop("checked", true).trigger("click");'); |
|
69 | - } |
|
68 | + $this->ExecuteScript('jQuery("#geodir_claimed_row input:radio:first").prop("checked", true).trigger("click");'); |
|
69 | + } |
|
70 | 70 | |
71 | - $this->byId('post_title')->value('Test Event'); |
|
72 | - $this->byId('post_desc')->value('Test Desc'); |
|
73 | - $this->byId('post_tags')->value('tag1,tag2'); |
|
74 | - $this->ExecuteScript('jQuery("select#gd_eventcategory").show();'); |
|
75 | - $this->select($this->byXPath("//select[@id='gd_eventcategory']"))->selectOptionByLabel('Events'); |
|
76 | - $this->waitForPageLoadAndCheckForErrors(2000); |
|
77 | - $this->byId('post_address')->value('wall street'); |
|
78 | - $this->byId('post_address')->value('10006'); |
|
79 | - $this->byId('post_set_address_button')->click(); |
|
80 | - $this->waitForPageLoadAndCheckForErrors(); |
|
81 | - $this->byId('geodir_timing')->value('10.00 am to 6 pm every day'); |
|
82 | - $this->byId('geodir_contact')->value('444444444444'); |
|
83 | - $this->byId('geodir_email')->value('[email protected]'); |
|
84 | - $this->byId('geodir_website')->value('http://test.com'); |
|
85 | - $this->byId('geodir_twitter')->value('http://twitter.com/test'); |
|
86 | - $this->byId('geodir_facebook')->value('http://facebook.com/test'); |
|
87 | - $this->byId('geodir_special_offers')->value('Test Offer'); |
|
88 | - $this->byId('geodir_accept_term_condition')->click(); |
|
89 | - // Submit the form |
|
90 | - $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
|
91 | - $this->waitForPageLoadAndCheckForErrors(); |
|
92 | - $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
93 | - // Submit the form |
|
94 | - $this->byClassName('geodir_publish_button')->click(); |
|
95 | - $this->waitForPageLoadAndCheckForErrors(); |
|
96 | - $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
71 | + $this->byId('post_title')->value('Test Event'); |
|
72 | + $this->byId('post_desc')->value('Test Desc'); |
|
73 | + $this->byId('post_tags')->value('tag1,tag2'); |
|
74 | + $this->ExecuteScript('jQuery("select#gd_eventcategory").show();'); |
|
75 | + $this->select($this->byXPath("//select[@id='gd_eventcategory']"))->selectOptionByLabel('Events'); |
|
76 | + $this->waitForPageLoadAndCheckForErrors(2000); |
|
77 | + $this->byId('post_address')->value('wall street'); |
|
78 | + $this->byId('post_address')->value('10006'); |
|
79 | + $this->byId('post_set_address_button')->click(); |
|
80 | + $this->waitForPageLoadAndCheckForErrors(); |
|
81 | + $this->byId('geodir_timing')->value('10.00 am to 6 pm every day'); |
|
82 | + $this->byId('geodir_contact')->value('444444444444'); |
|
83 | + $this->byId('geodir_email')->value('[email protected]'); |
|
84 | + $this->byId('geodir_website')->value('http://test.com'); |
|
85 | + $this->byId('geodir_twitter')->value('http://twitter.com/test'); |
|
86 | + $this->byId('geodir_facebook')->value('http://facebook.com/test'); |
|
87 | + $this->byId('geodir_special_offers')->value('Test Offer'); |
|
88 | + $this->byId('geodir_accept_term_condition')->click(); |
|
89 | + // Submit the form |
|
90 | + $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
|
91 | + $this->waitForPageLoadAndCheckForErrors(); |
|
92 | + $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
93 | + // Submit the form |
|
94 | + $this->byClassName('geodir_publish_button')->click(); |
|
95 | + $this->waitForPageLoadAndCheckForErrors(); |
|
96 | + $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
97 | 97 | |
98 | - } |
|
98 | + } |
|
99 | 99 | |
100 | - public function tearDown() |
|
101 | - { |
|
102 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
103 | - //write current file number to completed.txt |
|
104 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
105 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
106 | - fwrite($completed, $CurrentFileNumber); |
|
107 | - } |
|
108 | - } |
|
100 | + public function tearDown() |
|
101 | + { |
|
102 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
103 | + //write current file number to completed.txt |
|
104 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
105 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
106 | + fwrite($completed, $CurrentFileNumber); |
|
107 | + } |
|
108 | + } |
|
109 | 109 | } |
110 | 110 | ?> |
111 | 111 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $is_active1 = $this->byId("geodirectory-events")->attribute('class'); |
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Events plugin not active"); |
|
33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "Events plugin not active"); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | // Event post type -> Allow post type to add from frontend |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->waitForPageLoadAndCheckForErrors(); |
54 | 54 | $this->url(self::GDTEST_BASE_URL.'add-listing/?listing_type=gd_event'); |
55 | 55 | } |
56 | - $this->assertTrue( $this->isTextPresent("Add Event"), "Add Event text not found"); |
|
56 | + $this->assertTrue($this->isTextPresent("Add Event"), "Add Event text not found"); |
|
57 | 57 | //event info |
58 | 58 | $this->byId('is_recurring_n')->click(); |
59 | 59 | $this->byId('event_start')->value('2016-01-01'); |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | // Submit the form |
90 | 90 | $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
91 | 91 | $this->waitForPageLoadAndCheckForErrors(); |
92 | - $this->assertTrue( $this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
92 | + $this->assertTrue($this->isTextPresent("This is a preview of your listing"), "Not in preview page."); |
|
93 | 93 | // Submit the form |
94 | 94 | $this->byClassName('geodir_publish_button')->click(); |
95 | 95 | $this->waitForPageLoadAndCheckForErrors(); |
96 | - $this->assertTrue( $this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
96 | + $this->assertTrue($this->isTextPresent("Thank you, your information has been successfully received"), "Not in success page"); |
|
97 | 97 | |
98 | 98 | } |
99 | 99 |
@@ -1,149 +1,149 @@ |
||
1 | 1 | <?php |
2 | 2 | class BuddyPress 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 testBuddyPress() |
|
18 | - { |
|
19 | - $this->logInfo('Testing buddypress......'); |
|
20 | - //make sure BuddyPress core plugin active |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
23 | - |
|
24 | - $is_active = $this->byId("buddypress")->attribute('class'); |
|
25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | - //Activate Geodirectory buddypress |
|
27 | - $this->maybeActivatePlugin("buddypress", 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("buddypress")->attribute('class'); |
|
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "buddypress plugin not active"); |
|
34 | - |
|
35 | - //make sure BuddyPress Integration plugin active |
|
36 | - $is_active = $this->byId("geodirectory-buddypress-integration")->attribute('class'); |
|
37 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
38 | - //Activate Geodirectory buddypress integration |
|
39 | - $this->maybeActivatePlugin("geodirectory-buddypress-integration", 20000); |
|
40 | - //go back to plugin page |
|
41 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
42 | - } |
|
43 | - |
|
44 | - $is_active1 = $this->byId("geodirectory-buddypress-integration")->attribute('class'); |
|
45 | - $this->assertFalse( strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active"); |
|
46 | - |
|
47 | - |
|
48 | - //Make sure "Use BuddyPress registration form" checked. |
|
49 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_buddypress&subtab=gdbuddypress_settings'); |
|
50 | - $this->waitForPageLoadAndCheckForErrors(); |
|
51 | - $this->prepareSession()->currentWindow()->maximize(); |
|
52 | - |
|
53 | - $to_save = false; |
|
54 | - |
|
55 | - $options = array( |
|
56 | - 'geodir_buddypress_bp_register', |
|
57 | - 'geodir_buddypress_link_listing', |
|
58 | - 'geodir_buddypress_link_favorite', |
|
59 | - 'geodir_buddypress_link_author', |
|
60 | - 'geodir_buddypress_show_feature_image' |
|
61 | - ); |
|
62 | - |
|
63 | - foreach ($options as $option) { |
|
64 | - $is_checked = $this->byId($option)->attribute('checked'); |
|
65 | - if (!$is_checked) { |
|
66 | - $this->byId($option)->click(); |
|
67 | - $to_save = true; |
|
68 | - } |
|
69 | - } |
|
70 | - |
|
71 | - if ($to_save) { |
|
72 | - $this->byName('save')->click(); |
|
73 | - $this->waitForPageLoadAndCheckForErrors(); |
|
74 | - } |
|
75 | - |
|
76 | - |
|
77 | - $this->url(self::GDTEST_BASE_URL.'gd-login/'); |
|
78 | - $this->waitForPageLoadAndCheckForErrors(); |
|
79 | - $this->assertTrue( $this->isTextPresent("Sign In"), "No text found"); |
|
80 | - $this->assertFalse( $this->isTextPresent("Sign Up Now"), "Sign up now text found in buddypress login"); |
|
81 | - |
|
82 | - $this->byClassName('goedir-newuser-link')->click(); |
|
83 | - $this->waitForPageLoadAndCheckForErrors(); |
|
84 | - $this->assertTrue( $this->isTextPresent("Create an Account"), "Create an Account text not found"); |
|
85 | - |
|
86 | - //register |
|
87 | - $this->byId('signup_username')->value('testuser123'); |
|
88 | - $this->byId('signup_email')->value('[email protected]'); |
|
89 | - $this->byId('signup_password')->value('test12345'); |
|
90 | - $this->byId('signup_password_confirm')->value('test12345'); |
|
91 | - $this->byId('field_1')->value('Test User'); |
|
92 | - $this->byId('signup_submit')->click(); |
|
93 | - $this->waitForPageLoadAndCheckForErrors(); |
|
94 | - $this->assertTrue( $this->isTextPresent("Check Your Email To Activate Your Account"), "BuddyPress Signup not successful"); |
|
95 | - |
|
96 | - |
|
97 | - //check listings page for errors |
|
98 | - $this->url(self::GDTEST_BASE_URL.'members/admin/listings/'); |
|
99 | - $this->waitForPageLoadAndCheckForErrors(); |
|
100 | - $this->assertTrue( $this->isTextPresent("Places"), "Not in listings page"); |
|
101 | - |
|
102 | - //check favorites page for errors |
|
103 | - $this->url(self::GDTEST_BASE_URL.'members/admin/favorites/'); |
|
104 | - $this->waitForPageLoadAndCheckForErrors(); |
|
105 | - $this->assertTrue( $this->isTextPresent("Places"), "Not in favorites page"); |
|
106 | - |
|
107 | - //check reviews page for errors |
|
108 | - $this->url(self::GDTEST_BASE_URL.'members/admin/reviews/'); |
|
109 | - $this->waitForPageLoadAndCheckForErrors(); |
|
110 | - $this->assertTrue( $this->isTextPresent("Places"), "Not in reviews page"); |
|
111 | - |
|
112 | - //test all buddypress pages and catch errors and warnings |
|
113 | - $this->url(self::GDTEST_BASE_URL.'members/'); |
|
114 | - $this->waitForPageLoadAndCheckForErrors(); |
|
115 | - |
|
116 | - $this->url(self::GDTEST_BASE_URL.'members/admin/'); |
|
117 | - $this->waitForPageLoadAndCheckForErrors(); |
|
118 | - |
|
119 | - $this->url(self::GDTEST_BASE_URL.'members/admin/profile/'); |
|
120 | - $this->waitForPageLoadAndCheckForErrors(); |
|
121 | - |
|
122 | - $this->url(self::GDTEST_BASE_URL.'members/admin/notifications/'); |
|
123 | - $this->waitForPageLoadAndCheckForErrors(); |
|
124 | - |
|
125 | - $this->url(self::GDTEST_BASE_URL.'members/admin/messages/'); |
|
126 | - $this->waitForPageLoadAndCheckForErrors(); |
|
127 | - |
|
128 | - $this->url(self::GDTEST_BASE_URL.'members/admin/friends/'); |
|
129 | - $this->waitForPageLoadAndCheckForErrors(); |
|
130 | - |
|
131 | - $this->url(self::GDTEST_BASE_URL.'members/admin/groups/'); |
|
132 | - $this->waitForPageLoadAndCheckForErrors(); |
|
133 | - |
|
134 | - $this->url(self::GDTEST_BASE_URL.'members/admin/listings/'); |
|
135 | - $this->waitForPageLoadAndCheckForErrors(); |
|
136 | - |
|
137 | - } |
|
138 | - |
|
139 | - public function tearDown() |
|
140 | - { |
|
141 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
142 | - //write current file number to completed.txt |
|
143 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
144 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
145 | - fwrite($completed, $CurrentFileNumber); |
|
146 | - } |
|
147 | - } |
|
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 testBuddyPress() |
|
18 | + { |
|
19 | + $this->logInfo('Testing buddypress......'); |
|
20 | + //make sure BuddyPress core plugin active |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | + |
|
24 | + $is_active = $this->byId("buddypress")->attribute('class'); |
|
25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | + //Activate Geodirectory buddypress |
|
27 | + $this->maybeActivatePlugin("buddypress", 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("buddypress")->attribute('class'); |
|
33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "buddypress plugin not active"); |
|
34 | + |
|
35 | + //make sure BuddyPress Integration plugin active |
|
36 | + $is_active = $this->byId("geodirectory-buddypress-integration")->attribute('class'); |
|
37 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
38 | + //Activate Geodirectory buddypress integration |
|
39 | + $this->maybeActivatePlugin("geodirectory-buddypress-integration", 20000); |
|
40 | + //go back to plugin page |
|
41 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
42 | + } |
|
43 | + |
|
44 | + $is_active1 = $this->byId("geodirectory-buddypress-integration")->attribute('class'); |
|
45 | + $this->assertFalse( strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active"); |
|
46 | + |
|
47 | + |
|
48 | + //Make sure "Use BuddyPress registration form" checked. |
|
49 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=geodir_buddypress&subtab=gdbuddypress_settings'); |
|
50 | + $this->waitForPageLoadAndCheckForErrors(); |
|
51 | + $this->prepareSession()->currentWindow()->maximize(); |
|
52 | + |
|
53 | + $to_save = false; |
|
54 | + |
|
55 | + $options = array( |
|
56 | + 'geodir_buddypress_bp_register', |
|
57 | + 'geodir_buddypress_link_listing', |
|
58 | + 'geodir_buddypress_link_favorite', |
|
59 | + 'geodir_buddypress_link_author', |
|
60 | + 'geodir_buddypress_show_feature_image' |
|
61 | + ); |
|
62 | + |
|
63 | + foreach ($options as $option) { |
|
64 | + $is_checked = $this->byId($option)->attribute('checked'); |
|
65 | + if (!$is_checked) { |
|
66 | + $this->byId($option)->click(); |
|
67 | + $to_save = true; |
|
68 | + } |
|
69 | + } |
|
70 | + |
|
71 | + if ($to_save) { |
|
72 | + $this->byName('save')->click(); |
|
73 | + $this->waitForPageLoadAndCheckForErrors(); |
|
74 | + } |
|
75 | + |
|
76 | + |
|
77 | + $this->url(self::GDTEST_BASE_URL.'gd-login/'); |
|
78 | + $this->waitForPageLoadAndCheckForErrors(); |
|
79 | + $this->assertTrue( $this->isTextPresent("Sign In"), "No text found"); |
|
80 | + $this->assertFalse( $this->isTextPresent("Sign Up Now"), "Sign up now text found in buddypress login"); |
|
81 | + |
|
82 | + $this->byClassName('goedir-newuser-link')->click(); |
|
83 | + $this->waitForPageLoadAndCheckForErrors(); |
|
84 | + $this->assertTrue( $this->isTextPresent("Create an Account"), "Create an Account text not found"); |
|
85 | + |
|
86 | + //register |
|
87 | + $this->byId('signup_username')->value('testuser123'); |
|
88 | + $this->byId('signup_email')->value('[email protected]'); |
|
89 | + $this->byId('signup_password')->value('test12345'); |
|
90 | + $this->byId('signup_password_confirm')->value('test12345'); |
|
91 | + $this->byId('field_1')->value('Test User'); |
|
92 | + $this->byId('signup_submit')->click(); |
|
93 | + $this->waitForPageLoadAndCheckForErrors(); |
|
94 | + $this->assertTrue( $this->isTextPresent("Check Your Email To Activate Your Account"), "BuddyPress Signup not successful"); |
|
95 | + |
|
96 | + |
|
97 | + //check listings page for errors |
|
98 | + $this->url(self::GDTEST_BASE_URL.'members/admin/listings/'); |
|
99 | + $this->waitForPageLoadAndCheckForErrors(); |
|
100 | + $this->assertTrue( $this->isTextPresent("Places"), "Not in listings page"); |
|
101 | + |
|
102 | + //check favorites page for errors |
|
103 | + $this->url(self::GDTEST_BASE_URL.'members/admin/favorites/'); |
|
104 | + $this->waitForPageLoadAndCheckForErrors(); |
|
105 | + $this->assertTrue( $this->isTextPresent("Places"), "Not in favorites page"); |
|
106 | + |
|
107 | + //check reviews page for errors |
|
108 | + $this->url(self::GDTEST_BASE_URL.'members/admin/reviews/'); |
|
109 | + $this->waitForPageLoadAndCheckForErrors(); |
|
110 | + $this->assertTrue( $this->isTextPresent("Places"), "Not in reviews page"); |
|
111 | + |
|
112 | + //test all buddypress pages and catch errors and warnings |
|
113 | + $this->url(self::GDTEST_BASE_URL.'members/'); |
|
114 | + $this->waitForPageLoadAndCheckForErrors(); |
|
115 | + |
|
116 | + $this->url(self::GDTEST_BASE_URL.'members/admin/'); |
|
117 | + $this->waitForPageLoadAndCheckForErrors(); |
|
118 | + |
|
119 | + $this->url(self::GDTEST_BASE_URL.'members/admin/profile/'); |
|
120 | + $this->waitForPageLoadAndCheckForErrors(); |
|
121 | + |
|
122 | + $this->url(self::GDTEST_BASE_URL.'members/admin/notifications/'); |
|
123 | + $this->waitForPageLoadAndCheckForErrors(); |
|
124 | + |
|
125 | + $this->url(self::GDTEST_BASE_URL.'members/admin/messages/'); |
|
126 | + $this->waitForPageLoadAndCheckForErrors(); |
|
127 | + |
|
128 | + $this->url(self::GDTEST_BASE_URL.'members/admin/friends/'); |
|
129 | + $this->waitForPageLoadAndCheckForErrors(); |
|
130 | + |
|
131 | + $this->url(self::GDTEST_BASE_URL.'members/admin/groups/'); |
|
132 | + $this->waitForPageLoadAndCheckForErrors(); |
|
133 | + |
|
134 | + $this->url(self::GDTEST_BASE_URL.'members/admin/listings/'); |
|
135 | + $this->waitForPageLoadAndCheckForErrors(); |
|
136 | + |
|
137 | + } |
|
138 | + |
|
139 | + public function tearDown() |
|
140 | + { |
|
141 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
142 | + //write current file number to completed.txt |
|
143 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
144 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
145 | + fwrite($completed, $CurrentFileNumber); |
|
146 | + } |
|
147 | + } |
|
148 | 148 | } |
149 | 149 | ?> |
150 | 150 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $is_active1 = $this->byId("buddypress")->attribute('class'); |
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "buddypress plugin not active"); |
|
33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "buddypress plugin not active"); |
|
34 | 34 | |
35 | 35 | //make sure BuddyPress Integration plugin active |
36 | 36 | $is_active = $this->byId("geodirectory-buddypress-integration")->attribute('class'); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | $is_active1 = $this->byId("geodirectory-buddypress-integration")->attribute('class'); |
45 | - $this->assertFalse( strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active"); |
|
45 | + $this->assertFalse(strpos($is_active1, 'inactive'), "geodirectory buddypress integration plugin not active"); |
|
46 | 46 | |
47 | 47 | |
48 | 48 | //Make sure "Use BuddyPress registration form" checked. |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | |
77 | 77 | $this->url(self::GDTEST_BASE_URL.'gd-login/'); |
78 | 78 | $this->waitForPageLoadAndCheckForErrors(); |
79 | - $this->assertTrue( $this->isTextPresent("Sign In"), "No text found"); |
|
80 | - $this->assertFalse( $this->isTextPresent("Sign Up Now"), "Sign up now text found in buddypress login"); |
|
79 | + $this->assertTrue($this->isTextPresent("Sign In"), "No text found"); |
|
80 | + $this->assertFalse($this->isTextPresent("Sign Up Now"), "Sign up now text found in buddypress login"); |
|
81 | 81 | |
82 | 82 | $this->byClassName('goedir-newuser-link')->click(); |
83 | 83 | $this->waitForPageLoadAndCheckForErrors(); |
84 | - $this->assertTrue( $this->isTextPresent("Create an Account"), "Create an Account text not found"); |
|
84 | + $this->assertTrue($this->isTextPresent("Create an Account"), "Create an Account text not found"); |
|
85 | 85 | |
86 | 86 | //register |
87 | 87 | $this->byId('signup_username')->value('testuser123'); |
@@ -91,23 +91,23 @@ discard block |
||
91 | 91 | $this->byId('field_1')->value('Test User'); |
92 | 92 | $this->byId('signup_submit')->click(); |
93 | 93 | $this->waitForPageLoadAndCheckForErrors(); |
94 | - $this->assertTrue( $this->isTextPresent("Check Your Email To Activate Your Account"), "BuddyPress Signup not successful"); |
|
94 | + $this->assertTrue($this->isTextPresent("Check Your Email To Activate Your Account"), "BuddyPress Signup not successful"); |
|
95 | 95 | |
96 | 96 | |
97 | 97 | //check listings page for errors |
98 | 98 | $this->url(self::GDTEST_BASE_URL.'members/admin/listings/'); |
99 | 99 | $this->waitForPageLoadAndCheckForErrors(); |
100 | - $this->assertTrue( $this->isTextPresent("Places"), "Not in listings page"); |
|
100 | + $this->assertTrue($this->isTextPresent("Places"), "Not in listings page"); |
|
101 | 101 | |
102 | 102 | //check favorites page for errors |
103 | 103 | $this->url(self::GDTEST_BASE_URL.'members/admin/favorites/'); |
104 | 104 | $this->waitForPageLoadAndCheckForErrors(); |
105 | - $this->assertTrue( $this->isTextPresent("Places"), "Not in favorites page"); |
|
105 | + $this->assertTrue($this->isTextPresent("Places"), "Not in favorites page"); |
|
106 | 106 | |
107 | 107 | //check reviews page for errors |
108 | 108 | $this->url(self::GDTEST_BASE_URL.'members/admin/reviews/'); |
109 | 109 | $this->waitForPageLoadAndCheckForErrors(); |
110 | - $this->assertTrue( $this->isTextPresent("Places"), "Not in reviews page"); |
|
110 | + $this->assertTrue($this->isTextPresent("Places"), "Not in reviews page"); |
|
111 | 111 | |
112 | 112 | //test all buddypress pages and catch errors and warnings |
113 | 113 | $this->url(self::GDTEST_BASE_URL.'members/'); |
@@ -1,59 +1,59 @@ |
||
1 | 1 | <?php |
2 | 2 | class NewLocation 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 testNewLocation() |
|
18 | - { |
|
19 | - $this->logInfo('Testing new location......'); |
|
20 | - //make sure multi locations plugin active |
|
21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
17 | + public function testNewLocation() |
|
18 | + { |
|
19 | + $this->logInfo('Testing new location......'); |
|
20 | + //make sure multi locations plugin active |
|
21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
23 | 23 | |
24 | - $is_active = $this->byId("geodirectory-location-manager")->attribute('class'); |
|
25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | - //Activate Geodirectory Location Manager |
|
27 | - $this->maybeActivatePlugin("geodirectory-location-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-location-manager")->attribute('class'); |
|
25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
26 | + //Activate Geodirectory Location Manager |
|
27 | + $this->maybeActivatePlugin("geodirectory-location-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-location-manager")->attribute('class'); |
|
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Location Manager plugin not active"); |
|
32 | + $is_active1 = $this->byId("geodirectory-location-manager")->attribute('class'); |
|
33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "Location Manager plugin not active"); |
|
34 | 34 | |
35 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=managelocation_fields&subtab=geodir_location_addedit'); |
|
36 | - $this->waitForPageLoadAndCheckForErrors(); |
|
37 | - $this->prepareSession()->currentWindow()->maximize(); |
|
38 | - $this->byId('gd_city')->value('Bengaluru'); |
|
39 | - $this->byId('gd_region')->value('Karnataka'); |
|
40 | - $this->waitForPageLoadAndCheckForErrors(); |
|
35 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=managelocation_fields&subtab=geodir_location_addedit'); |
|
36 | + $this->waitForPageLoadAndCheckForErrors(); |
|
37 | + $this->prepareSession()->currentWindow()->maximize(); |
|
38 | + $this->byId('gd_city')->value('Bengaluru'); |
|
39 | + $this->byId('gd_region')->value('Karnataka'); |
|
40 | + $this->waitForPageLoadAndCheckForErrors(); |
|
41 | 41 | // $this->byId('gd_city')->value('texas'); |
42 | - $this->byId('gd_set_address_button')->click(); |
|
43 | - $this->waitForPageLoadAndCheckForErrors(); |
|
44 | - $this->byId('geodir_location_save')->click(); |
|
45 | - $this->waitForPageLoadAndCheckForErrors(); |
|
46 | - $this->assertTrue( $this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found"); |
|
47 | - } |
|
42 | + $this->byId('gd_set_address_button')->click(); |
|
43 | + $this->waitForPageLoadAndCheckForErrors(); |
|
44 | + $this->byId('geodir_location_save')->click(); |
|
45 | + $this->waitForPageLoadAndCheckForErrors(); |
|
46 | + $this->assertTrue( $this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found"); |
|
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 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $is_active1 = $this->byId("geodirectory-location-manager")->attribute('class'); |
33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "Location Manager plugin not active"); |
|
33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "Location Manager plugin not active"); |
|
34 | 34 | |
35 | 35 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=managelocation_fields&subtab=geodir_location_addedit'); |
36 | 36 | $this->waitForPageLoadAndCheckForErrors(); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->waitForPageLoadAndCheckForErrors(); |
44 | 44 | $this->byId('geodir_location_save')->click(); |
45 | 45 | $this->waitForPageLoadAndCheckForErrors(); |
46 | - $this->assertTrue( $this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found"); |
|
46 | + $this->assertTrue($this->isTextPresent("Location saved successfully."), "'Location saved successfully' text not found"); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function tearDown() |
@@ -1,37 +1,37 @@ |
||
1 | 1 | <?php |
2 | 2 | class DeleteListing 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 testDeleteListing() |
|
18 | - { |
|
19 | - $this->logInfo('Delete Listing......'); |
|
20 | - $this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true); |
|
21 | - $this->waitForPageLoadAndCheckForErrors(); |
|
22 | - $this->byClassName('geodir-delete')->click(); |
|
23 | - $this->acceptAlert(); |
|
24 | - $this->waitForPageLoadAndCheckForErrors(); |
|
25 | - } |
|
17 | + public function testDeleteListing() |
|
18 | + { |
|
19 | + $this->logInfo('Delete Listing......'); |
|
20 | + $this->maybeUserLogin(self::GDTEST_BASE_URL.'author/test-user/?geodir_dashbord=true&stype=gd_place', true); |
|
21 | + $this->waitForPageLoadAndCheckForErrors(); |
|
22 | + $this->byClassName('geodir-delete')->click(); |
|
23 | + $this->acceptAlert(); |
|
24 | + $this->waitForPageLoadAndCheckForErrors(); |
|
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 |