@@ -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 |
@@ -1,67 +1,67 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | class Initialize 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 | - } else { |
|
| 12 | - $this->prepareSession()->currentWindow()->maximize(); |
|
| 13 | - } |
|
| 14 | - |
|
| 15 | - } |
|
| 16 | - |
|
| 17 | - public function testInitialize() |
|
| 18 | - { |
|
| 19 | - // Check plugins available |
|
| 20 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 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 | + } else { |
|
| 12 | + $this->prepareSession()->currentWindow()->maximize(); |
|
| 13 | + } |
|
| 14 | + |
|
| 15 | + } |
|
| 16 | + |
|
| 17 | + public function testInitialize() |
|
| 18 | + { |
|
| 19 | + // Check plugins available |
|
| 20 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 21 | 21 | // echo $this->source(); |
| 22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 23 | - |
|
| 24 | - $stop_script = false; |
|
| 25 | - |
|
| 26 | - $plugins = array( |
|
| 27 | - 'geodirectory', |
|
| 28 | - 'geodirectory-advance-search-filters', |
|
| 29 | - 'geodirectory-affiliatewp-integration', |
|
| 30 | - 'geodirectory-ajax-duplicate-alert', |
|
| 31 | - 'geodirectory-buddypress-integration', |
|
| 32 | - 'geodirectory-claim-manager', |
|
| 33 | - 'geodirectory-custom-post-types', |
|
| 34 | - 'geodirectory-events', |
|
| 35 | - 'gd-booster', |
|
| 36 | - 'geodirectory-location-manager', |
|
| 37 | - 'geodirectory-marker-cluster', |
|
| 38 | - 'geodirectory-payment-manager', |
|
| 39 | - 'geodirectory-re-captcha', |
|
| 40 | - 'geodirectory-review-rating-manager', |
|
| 41 | - 'geodirectory-social-importer', |
|
| 42 | - 'stripe-payment-geodirectory-add-on', |
|
| 43 | - 'buddypress', |
|
| 22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 23 | + |
|
| 24 | + $stop_script = false; |
|
| 25 | + |
|
| 26 | + $plugins = array( |
|
| 27 | + 'geodirectory', |
|
| 28 | + 'geodirectory-advance-search-filters', |
|
| 29 | + 'geodirectory-affiliatewp-integration', |
|
| 30 | + 'geodirectory-ajax-duplicate-alert', |
|
| 31 | + 'geodirectory-buddypress-integration', |
|
| 32 | + 'geodirectory-claim-manager', |
|
| 33 | + 'geodirectory-custom-post-types', |
|
| 34 | + 'geodirectory-events', |
|
| 35 | + 'gd-booster', |
|
| 36 | + 'geodirectory-location-manager', |
|
| 37 | + 'geodirectory-marker-cluster', |
|
| 38 | + 'geodirectory-payment-manager', |
|
| 39 | + 'geodirectory-re-captcha', |
|
| 40 | + 'geodirectory-review-rating-manager', |
|
| 41 | + 'geodirectory-social-importer', |
|
| 42 | + 'stripe-payment-geodirectory-add-on', |
|
| 43 | + 'buddypress', |
|
| 44 | 44 | // 'wordpress-database-reset' |
| 45 | - ); |
|
| 45 | + ); |
|
| 46 | 46 | |
| 47 | - foreach ($plugins as $plugin) { |
|
| 48 | - if (!$this->isElementExists($plugin)) { |
|
| 49 | - $plugin_name = ucwords(str_replace('-', ' ', $plugin)); |
|
| 50 | - $this->logError($plugin_name.' not installed'); |
|
| 51 | - $stop_script = true; |
|
| 52 | - } |
|
| 53 | - } |
|
| 47 | + foreach ($plugins as $plugin) { |
|
| 48 | + if (!$this->isElementExists($plugin)) { |
|
| 49 | + $plugin_name = ucwords(str_replace('-', ' ', $plugin)); |
|
| 50 | + $this->logError($plugin_name.' not installed'); |
|
| 51 | + $stop_script = true; |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - if($stop_script) { |
|
| 56 | - $this->logError("Stopping the script. Please fix the errors to continue"); |
|
| 57 | - return; |
|
| 58 | - } |
|
| 55 | + if($stop_script) { |
|
| 56 | + $this->logError("Stopping the script. Please fix the errors to continue"); |
|
| 57 | + return; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | 60 | |
| 61 | - //Activate WordPress database reset |
|
| 62 | - //$this->maybeActivatePlugin("wordpress-database-reset"); |
|
| 61 | + //Activate WordPress database reset |
|
| 62 | + //$this->maybeActivatePlugin("wordpress-database-reset"); |
|
| 63 | 63 | |
| 64 | - //reset the db |
|
| 64 | + //reset the db |
|
| 65 | 65 | // $this->logInfo('Resetting WordPress database......'); |
| 66 | 66 | // $this->url(self::GDTEST_BASE_URL.'wp-admin/tools.php?page=database-reset'); |
| 67 | 67 | // $this->waitForPageLoadAndCheckForErrors(); |
@@ -75,194 +75,194 @@ discard block |
||
| 75 | 75 | // $this->acceptAlert(); |
| 76 | 76 | // $this->waitForPageLoadAndCheckForErrors(); |
| 77 | 77 | |
| 78 | - // make sure all plugins not active. We will activate it programatically. |
|
| 79 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 80 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 81 | - $this->hideAdminBar(); |
|
| 78 | + // make sure all plugins not active. We will activate it programatically. |
|
| 79 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 80 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 81 | + $this->hideAdminBar(); |
|
| 82 | 82 | |
| 83 | 83 | // if(($key = array_search('wordpress-database-reset', $plugins)) !== false) { |
| 84 | 84 | // unset($plugins[$key]); |
| 85 | 85 | // } |
| 86 | 86 | |
| 87 | - foreach ($plugins as $plugin) { |
|
| 88 | - if (!is_int(strpos($this->byId($plugin)->attribute('class'), 'inactive'))) { |
|
| 89 | - $plugin_name = ucwords(str_replace('-', ' ', $plugin)); |
|
| 90 | - $this->logError($plugin_name." is active. Please deactivate it. It will be activated programatically."); |
|
| 91 | - $stop_script = true; |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - |
|
| 96 | - if($stop_script) { |
|
| 97 | - $this->logInfo("Stopping the script. Please fix the errors to continue"); |
|
| 98 | - return; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - //make sure GDF theme installed |
|
| 102 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/themes.php'); |
|
| 103 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 104 | - if (!$this->isElementExists("GeoDirectory_framework-name")) { |
|
| 105 | - $this->logError("GeoDirectory Framework theme not installed"); |
|
| 106 | - $stop_script = true; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - if (!$this->isElementExists("gdf_test_child-name")) { |
|
| 110 | - $this->logError("GDF child theme not installed"); |
|
| 111 | - $stop_script = true; |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - if($stop_script) { |
|
| 115 | - $this->logError("Stopping the script. Please fix the errors to continue"); |
|
| 116 | - return; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - //Activate GDF theme if not active |
|
| 120 | - $this->logInfo('Checking GDF theme......'); |
|
| 121 | - $is_active = $this->byXPath("//div[contains(@class, 'theme') and contains(@class, 'active')]")->attribute('aria-describedby'); |
|
| 122 | - if (strpos($is_active, 'gdf_test_child-name')) { |
|
| 123 | - //GDF already active |
|
| 124 | - } else { |
|
| 125 | - //Activate GDF |
|
| 126 | - $this->logInfo('Activating GDF theme......'); |
|
| 127 | - $this->byXPath("//div[contains(@aria-describedby, 'gdf_test_child-action') and contains(@aria-describedby, 'gdf_test_child-name')]//div[@class='theme-actions']//a[contains(@class, 'activate')]")->click(); |
|
| 128 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 129 | - $this->assertTrue( $this->isTextPresent("New theme activated"), "'New theme activated' text not found"); |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - //Activate Geodirectory core |
|
| 133 | - $this->maybeActivatePlugin("geodirectory", 20000); |
|
| 134 | - |
|
| 135 | - //set default location |
|
| 136 | - $this->logInfo('Setting default location......'); |
|
| 137 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=default_location_settings'); |
|
| 138 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 139 | - $this->byId('city')->value('New York'); |
|
| 140 | - $this->byId('set_address_button')->click(); |
|
| 141 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 142 | - $this->byId('location_save')->click(); |
|
| 143 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 144 | - $this->assertTrue( $this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found"); |
|
| 145 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 146 | - |
|
| 147 | - //install place dummy data |
|
| 148 | - $this->logInfo('Installing place dummy data......'); |
|
| 149 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory'); |
|
| 150 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 151 | - //$this->byLinkText('Dummy Data')->click(); |
|
| 152 | - $this->byXPath("//dd[@id='dummy_data_settings']/a")->click(); |
|
| 153 | - $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML'); |
|
| 154 | - if (strpos($html, 'Yes Delete Please!')) { |
|
| 155 | - //delete old place data |
|
| 156 | - $this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click(); |
|
| 157 | - $this->acceptAlert(); |
|
| 158 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 159 | - } |
|
| 160 | - $this->select($this->byXPath("//div[@id='sub_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10'); |
|
| 161 | - $this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click(); |
|
| 162 | - $this->waitForPageLoadAndCheckForErrors(60000); |
|
| 163 | - |
|
| 164 | - //make sure dummy data installed |
|
| 165 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory'); |
|
| 166 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 167 | - $this->byXPath("//dd[@id='dummy_data_settings']/a")->click(); |
|
| 168 | - $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML'); |
|
| 169 | - $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly"); |
|
| 170 | - |
|
| 171 | - |
|
| 172 | - //Activate Geodirectory Events |
|
| 173 | - $this->maybeActivatePlugin("geodirectory-events", 20000); |
|
| 174 | - |
|
| 175 | - //install Events dummy data |
|
| 176 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory'); |
|
| 177 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 178 | - $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click(); |
|
| 179 | - $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML'); |
|
| 180 | - if (strpos($html, 'Yes Delete Please!')) { |
|
| 181 | - //delete old data |
|
| 182 | - $this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click(); |
|
| 183 | - $this->acceptAlert(); |
|
| 184 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 185 | - } |
|
| 186 | - $this->select($this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10'); |
|
| 187 | - $this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click(); |
|
| 188 | - $this->waitForPageLoadAndCheckForErrors(60000); |
|
| 189 | - |
|
| 190 | - //make sure Events dummy data installed |
|
| 191 | - $this->logInfo('Checking events dummy data installed properly or not......'); |
|
| 192 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings&active_tab=gdevent_dummy_data_settings'); |
|
| 193 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 194 | - $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click(); |
|
| 195 | - $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML'); |
|
| 196 | - $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly"); |
|
| 197 | - |
|
| 198 | - //set home page |
|
| 199 | - $this->logInfo('Setting home page......'); |
|
| 200 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/options-reading.php'); |
|
| 201 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 202 | - $this->byXPath("//input[@value='page']")->click(); |
|
| 203 | - $this->select($this->byId("page_on_front"))->selectOptionByLabel('GD Home page'); |
|
| 204 | - $this->byId("submit")->click(); |
|
| 205 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 206 | - $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 207 | - |
|
| 208 | - //Enable registration |
|
| 209 | - $this->logInfo('Enabling registration......'); |
|
| 210 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/options-general.php'); |
|
| 211 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 212 | - $this->byId("users_can_register")->click(); |
|
| 213 | - $this->byId("submit")->click(); |
|
| 214 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 215 | - $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 216 | - |
|
| 217 | - //Permalinks |
|
| 218 | - $this->logInfo('Setting permalinks......'); |
|
| 219 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/options-permalink.php'); |
|
| 220 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 221 | - $this->byXPath("(//input[@name='selection'])[5]")->click(); |
|
| 222 | - $this->byId("submit")->click(); |
|
| 223 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 87 | + foreach ($plugins as $plugin) { |
|
| 88 | + if (!is_int(strpos($this->byId($plugin)->attribute('class'), 'inactive'))) { |
|
| 89 | + $plugin_name = ucwords(str_replace('-', ' ', $plugin)); |
|
| 90 | + $this->logError($plugin_name." is active. Please deactivate it. It will be activated programatically."); |
|
| 91 | + $stop_script = true; |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + |
|
| 96 | + if($stop_script) { |
|
| 97 | + $this->logInfo("Stopping the script. Please fix the errors to continue"); |
|
| 98 | + return; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + //make sure GDF theme installed |
|
| 102 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/themes.php'); |
|
| 103 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 104 | + if (!$this->isElementExists("GeoDirectory_framework-name")) { |
|
| 105 | + $this->logError("GeoDirectory Framework theme not installed"); |
|
| 106 | + $stop_script = true; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + if (!$this->isElementExists("gdf_test_child-name")) { |
|
| 110 | + $this->logError("GDF child theme not installed"); |
|
| 111 | + $stop_script = true; |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + if($stop_script) { |
|
| 115 | + $this->logError("Stopping the script. Please fix the errors to continue"); |
|
| 116 | + return; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + //Activate GDF theme if not active |
|
| 120 | + $this->logInfo('Checking GDF theme......'); |
|
| 121 | + $is_active = $this->byXPath("//div[contains(@class, 'theme') and contains(@class, 'active')]")->attribute('aria-describedby'); |
|
| 122 | + if (strpos($is_active, 'gdf_test_child-name')) { |
|
| 123 | + //GDF already active |
|
| 124 | + } else { |
|
| 125 | + //Activate GDF |
|
| 126 | + $this->logInfo('Activating GDF theme......'); |
|
| 127 | + $this->byXPath("//div[contains(@aria-describedby, 'gdf_test_child-action') and contains(@aria-describedby, 'gdf_test_child-name')]//div[@class='theme-actions']//a[contains(@class, 'activate')]")->click(); |
|
| 128 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 129 | + $this->assertTrue( $this->isTextPresent("New theme activated"), "'New theme activated' text not found"); |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + //Activate Geodirectory core |
|
| 133 | + $this->maybeActivatePlugin("geodirectory", 20000); |
|
| 134 | + |
|
| 135 | + //set default location |
|
| 136 | + $this->logInfo('Setting default location......'); |
|
| 137 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=default_location_settings'); |
|
| 138 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 139 | + $this->byId('city')->value('New York'); |
|
| 140 | + $this->byId('set_address_button')->click(); |
|
| 141 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 142 | + $this->byId('location_save')->click(); |
|
| 143 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 144 | + $this->assertTrue( $this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found"); |
|
| 145 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 146 | + |
|
| 147 | + //install place dummy data |
|
| 148 | + $this->logInfo('Installing place dummy data......'); |
|
| 149 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory'); |
|
| 150 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 151 | + //$this->byLinkText('Dummy Data')->click(); |
|
| 152 | + $this->byXPath("//dd[@id='dummy_data_settings']/a")->click(); |
|
| 153 | + $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML'); |
|
| 154 | + if (strpos($html, 'Yes Delete Please!')) { |
|
| 155 | + //delete old place data |
|
| 156 | + $this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click(); |
|
| 157 | + $this->acceptAlert(); |
|
| 158 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 159 | + } |
|
| 160 | + $this->select($this->byXPath("//div[@id='sub_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10'); |
|
| 161 | + $this->byXPath("//div[@id='sub_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click(); |
|
| 162 | + $this->waitForPageLoadAndCheckForErrors(60000); |
|
| 163 | + |
|
| 164 | + //make sure dummy data installed |
|
| 165 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory'); |
|
| 166 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 167 | + $this->byXPath("//dd[@id='dummy_data_settings']/a")->click(); |
|
| 168 | + $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML'); |
|
| 169 | + $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly"); |
|
| 170 | + |
|
| 171 | + |
|
| 172 | + //Activate Geodirectory Events |
|
| 173 | + $this->maybeActivatePlugin("geodirectory-events", 20000); |
|
| 174 | + |
|
| 175 | + //install Events dummy data |
|
| 176 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory'); |
|
| 177 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 178 | + $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click(); |
|
| 179 | + $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML'); |
|
| 180 | + if (strpos($html, 'Yes Delete Please!')) { |
|
| 181 | + //delete old data |
|
| 182 | + $this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_delete']")->click(); |
|
| 183 | + $this->acceptAlert(); |
|
| 184 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 185 | + } |
|
| 186 | + $this->select($this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//select[@class='selected_sample_data']"))->selectOptionByLabel('10'); |
|
| 187 | + $this->byXPath("//div[@id='sub_gdevent_dummy_data_settings']//a[@id='geodir_dummy_insert']")->click(); |
|
| 188 | + $this->waitForPageLoadAndCheckForErrors(60000); |
|
| 189 | + |
|
| 190 | + //make sure Events dummy data installed |
|
| 191 | + $this->logInfo('Checking events dummy data installed properly or not......'); |
|
| 192 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=general_settings&active_tab=gdevent_dummy_data_settings'); |
|
| 193 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 194 | + $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click(); |
|
| 195 | + $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML'); |
|
| 196 | + $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly"); |
|
| 197 | + |
|
| 198 | + //set home page |
|
| 199 | + $this->logInfo('Setting home page......'); |
|
| 200 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/options-reading.php'); |
|
| 201 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 202 | + $this->byXPath("//input[@value='page']")->click(); |
|
| 203 | + $this->select($this->byId("page_on_front"))->selectOptionByLabel('GD Home page'); |
|
| 204 | + $this->byId("submit")->click(); |
|
| 205 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 206 | + $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 207 | + |
|
| 208 | + //Enable registration |
|
| 209 | + $this->logInfo('Enabling registration......'); |
|
| 210 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/options-general.php'); |
|
| 211 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 212 | + $this->byId("users_can_register")->click(); |
|
| 213 | + $this->byId("submit")->click(); |
|
| 214 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 215 | + $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 216 | + |
|
| 217 | + //Permalinks |
|
| 218 | + $this->logInfo('Setting permalinks......'); |
|
| 219 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/options-permalink.php'); |
|
| 220 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 221 | + $this->byXPath("(//input[@name='selection'])[5]")->click(); |
|
| 222 | + $this->byId("submit")->click(); |
|
| 223 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 224 | 224 | // echo $this->source(); |
| 225 | - $this->assertTrue( $this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found"); |
|
| 226 | - |
|
| 227 | - //create and assign menu |
|
| 228 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php'); |
|
| 229 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 230 | - $this->assertTrue( $this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found"); |
|
| 231 | - $this->logInfo('Creating new menu......'); |
|
| 232 | - $this->byId('menu-name')->value('Primary'); |
|
| 233 | - $this->byId('save_menu_header')->click(); |
|
| 234 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 235 | - |
|
| 236 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php'); |
|
| 237 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 238 | - $this->assertTrue( $this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found"); |
|
| 239 | - $this->logInfo('Setting menu location......'); |
|
| 240 | - $this->byId('locations-main-nav')->click(); |
|
| 241 | - $this->byId('save_menu_header')->click(); |
|
| 242 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 243 | - $this->assertTrue( $this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found"); |
|
| 244 | - |
|
| 245 | - // Assign menu |
|
| 246 | - $this->logInfo('Assigning menu......'); |
|
| 247 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_navigation_settings'); |
|
| 248 | - $this->ExecuteScript('jQuery("#geodir_theme_location_nav").show();'); |
|
| 249 | - $this->select($this->byId('geodir_theme_location_nav'))->selectOptionByLabel('The Main Menu'); |
|
| 250 | - $this->byName('save')->click(); |
|
| 251 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 252 | - |
|
| 253 | - //Logout |
|
| 254 | - $this->maybeAdminLogout(); |
|
| 255 | - } |
|
| 256 | - |
|
| 257 | - public function tearDown() |
|
| 258 | - { |
|
| 259 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
| 260 | - //write current file number to completed.txt |
|
| 261 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
| 262 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
| 263 | - fwrite($completed, $CurrentFileNumber); |
|
| 264 | - } |
|
| 265 | - } |
|
| 225 | + $this->assertTrue( $this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found"); |
|
| 226 | + |
|
| 227 | + //create and assign menu |
|
| 228 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php'); |
|
| 229 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 230 | + $this->assertTrue( $this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found"); |
|
| 231 | + $this->logInfo('Creating new menu......'); |
|
| 232 | + $this->byId('menu-name')->value('Primary'); |
|
| 233 | + $this->byId('save_menu_header')->click(); |
|
| 234 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 235 | + |
|
| 236 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php'); |
|
| 237 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 238 | + $this->assertTrue( $this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found"); |
|
| 239 | + $this->logInfo('Setting menu location......'); |
|
| 240 | + $this->byId('locations-main-nav')->click(); |
|
| 241 | + $this->byId('save_menu_header')->click(); |
|
| 242 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 243 | + $this->assertTrue( $this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found"); |
|
| 244 | + |
|
| 245 | + // Assign menu |
|
| 246 | + $this->logInfo('Assigning menu......'); |
|
| 247 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_navigation_settings'); |
|
| 248 | + $this->ExecuteScript('jQuery("#geodir_theme_location_nav").show();'); |
|
| 249 | + $this->select($this->byId('geodir_theme_location_nav'))->selectOptionByLabel('The Main Menu'); |
|
| 250 | + $this->byName('save')->click(); |
|
| 251 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 252 | + |
|
| 253 | + //Logout |
|
| 254 | + $this->maybeAdminLogout(); |
|
| 255 | + } |
|
| 256 | + |
|
| 257 | + public function tearDown() |
|
| 258 | + { |
|
| 259 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
| 260 | + //write current file number to completed.txt |
|
| 261 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
| 262 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
| 263 | + fwrite($completed, $CurrentFileNumber); |
|
| 264 | + } |
|
| 265 | + } |
|
| 266 | 266 | |
| 267 | 267 | } |
| 268 | 268 | ?> |
| 269 | 269 | \ No newline at end of file |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if($stop_script) { |
|
| 55 | + if ($stop_script) { |
|
| 56 | 56 | $this->logError("Stopping the script. Please fix the errors to continue"); |
| 57 | 57 | return; |
| 58 | 58 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| 96 | - if($stop_script) { |
|
| 96 | + if ($stop_script) { |
|
| 97 | 97 | $this->logInfo("Stopping the script. Please fix the errors to continue"); |
| 98 | 98 | return; |
| 99 | 99 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $stop_script = true; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if($stop_script) { |
|
| 114 | + if ($stop_script) { |
|
| 115 | 115 | $this->logError("Stopping the script. Please fix the errors to continue"); |
| 116 | 116 | return; |
| 117 | 117 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $this->logInfo('Activating GDF theme......'); |
| 127 | 127 | $this->byXPath("//div[contains(@aria-describedby, 'gdf_test_child-action') and contains(@aria-describedby, 'gdf_test_child-name')]//div[@class='theme-actions']//a[contains(@class, 'activate')]")->click(); |
| 128 | 128 | $this->waitForPageLoadAndCheckForErrors(); |
| 129 | - $this->assertTrue( $this->isTextPresent("New theme activated"), "'New theme activated' text not found"); |
|
| 129 | + $this->assertTrue($this->isTextPresent("New theme activated"), "'New theme activated' text not found"); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | //Activate Geodirectory core |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $this->waitForPageLoadAndCheckForErrors(); |
| 142 | 142 | $this->byId('location_save')->click(); |
| 143 | 143 | $this->waitForPageLoadAndCheckForErrors(); |
| 144 | - $this->assertTrue( $this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found"); |
|
| 144 | + $this->assertTrue($this->isTextPresent("Your settings have been saved"), "'Your settings have been saved' text not found"); |
|
| 145 | 145 | $this->waitForPageLoadAndCheckForErrors(); |
| 146 | 146 | |
| 147 | 147 | //install place dummy data |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $this->waitForPageLoadAndCheckForErrors(); |
| 167 | 167 | $this->byXPath("//dd[@id='dummy_data_settings']/a")->click(); |
| 168 | 168 | $html = $this->byId('sub_dummy_data_settings')->attribute('innerHTML'); |
| 169 | - $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly"); |
|
| 169 | + $this->assertTrue(is_int(strpos($html, 'Yes Delete Please!')), "Places Demo data not installed correctly"); |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | //Activate Geodirectory Events |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $this->waitForPageLoadAndCheckForErrors(); |
| 194 | 194 | $this->byXPath("//dd[@id='gdevent_dummy_data_settings']/a")->click(); |
| 195 | 195 | $html = $this->byId('sub_gdevent_dummy_data_settings')->attribute('innerHTML'); |
| 196 | - $this->assertTrue( is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly"); |
|
| 196 | + $this->assertTrue(is_int(strpos($html, 'Yes Delete Please!')), "Events Demo data not installed correctly"); |
|
| 197 | 197 | |
| 198 | 198 | //set home page |
| 199 | 199 | $this->logInfo('Setting home page......'); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $this->select($this->byId("page_on_front"))->selectOptionByLabel('GD Home page'); |
| 204 | 204 | $this->byId("submit")->click(); |
| 205 | 205 | $this->waitForPageLoadAndCheckForErrors(); |
| 206 | - $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 206 | + $this->assertTrue($this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 207 | 207 | |
| 208 | 208 | //Enable registration |
| 209 | 209 | $this->logInfo('Enabling registration......'); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $this->byId("users_can_register")->click(); |
| 213 | 213 | $this->byId("submit")->click(); |
| 214 | 214 | $this->waitForPageLoadAndCheckForErrors(); |
| 215 | - $this->assertTrue( $this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 215 | + $this->assertTrue($this->isTextPresent("Settings saved"), "'Settings saved' text not found"); |
|
| 216 | 216 | |
| 217 | 217 | //Permalinks |
| 218 | 218 | $this->logInfo('Setting permalinks......'); |
@@ -222,12 +222,12 @@ discard block |
||
| 222 | 222 | $this->byId("submit")->click(); |
| 223 | 223 | $this->waitForPageLoadAndCheckForErrors(); |
| 224 | 224 | // echo $this->source(); |
| 225 | - $this->assertTrue( $this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found"); |
|
| 225 | + $this->assertTrue($this->isTextPresent("Permalink structure updated"), "'Permalink structure updated' text not found"); |
|
| 226 | 226 | |
| 227 | 227 | //create and assign menu |
| 228 | 228 | $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php'); |
| 229 | 229 | $this->waitForPageLoadAndCheckForErrors(); |
| 230 | - $this->assertTrue( $this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found"); |
|
| 230 | + $this->assertTrue($this->isTextPresent("Give your menu a name above, then click Create Menu."), "'Create Menu' text not found"); |
|
| 231 | 231 | $this->logInfo('Creating new menu......'); |
| 232 | 232 | $this->byId('menu-name')->value('Primary'); |
| 233 | 233 | $this->byId('save_menu_header')->click(); |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | $this->url(self::GDTEST_BASE_URL.'wp-admin/nav-menus.php'); |
| 237 | 237 | $this->waitForPageLoadAndCheckForErrors(); |
| 238 | - $this->assertTrue( $this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found"); |
|
| 238 | + $this->assertTrue($this->isTextPresent("Add menu items from the column on the left"), "'Add menu items from the column on the left' text not found"); |
|
| 239 | 239 | $this->logInfo('Setting menu location......'); |
| 240 | 240 | $this->byId('locations-main-nav')->click(); |
| 241 | 241 | $this->byId('save_menu_header')->click(); |
| 242 | 242 | $this->waitForPageLoadAndCheckForErrors(); |
| 243 | - $this->assertTrue( $this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found"); |
|
| 243 | + $this->assertTrue($this->isTextPresent("<strong>Primary</strong> has been updated"), "'Primary has been updated' text not found"); |
|
| 244 | 244 | |
| 245 | 245 | // Assign menu |
| 246 | 246 | $this->logInfo('Assigning menu......'); |
@@ -1,79 +1,79 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | class Stripe 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 testStripe() |
|
| 18 | - { |
|
| 19 | - $this->logInfo('Testing stripe......'); |
|
| 20 | - //make sure Stripe payment plugin active |
|
| 21 | - $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 22 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 17 | + public function testStripe() |
|
| 18 | + { |
|
| 19 | + $this->logInfo('Testing stripe......'); |
|
| 20 | + //make sure Stripe payment plugin active |
|
| 21 | + $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 22 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 23 | 23 | |
| 24 | - $is_active = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class'); |
|
| 25 | - if (is_int(strpos($is_active, 'inactive'))) { |
|
| 26 | - //Activate Geodirectory stripe payment geodirectory add on |
|
| 27 | - $this->maybeActivatePlugin("stripe-payment-geodirectory-add-on", 20000); |
|
| 28 | - //go back to plugin page |
|
| 29 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php'); |
|
| 30 | - } |
|
| 24 | + $is_active = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class'); |
|
| 25 | + if (is_int(strpos($is_active, 'inactive'))) { |
|
| 26 | + //Activate Geodirectory stripe payment geodirectory add on |
|
| 27 | + $this->maybeActivatePlugin("stripe-payment-geodirectory-add-on", 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("stripe-payment-geodirectory-add-on")->attribute('class'); |
|
| 33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active"); |
|
| 32 | + $is_active1 = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class'); |
|
| 33 | + $this->assertFalse( strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active"); |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | - $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options'); |
|
| 37 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 36 | + $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options'); |
|
| 37 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 38 | 38 | |
| 39 | - $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place'); |
|
| 40 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 41 | - $this->byClassName('geodir-upgrade')->click(); |
|
| 42 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 43 | - $this->byXPath("(//div[@class='geodir_package']/input[@type='radio'])[2]")->click(); |
|
| 44 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 45 | - if ($this->isTextPresent("Business Owner/Associate")) { |
|
| 39 | + $this->url(self::GDTEST_BASE_URL.'author/admin/?geodir_dashbord=true&stype=gd_place'); |
|
| 40 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 41 | + $this->byClassName('geodir-upgrade')->click(); |
|
| 42 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 43 | + $this->byXPath("(//div[@class='geodir_package']/input[@type='radio'])[2]")->click(); |
|
| 44 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 45 | + if ($this->isTextPresent("Business Owner/Associate")) { |
|
| 46 | 46 | // $elements = $this->elements($this->using('name')->value('claimed')); |
| 47 | 47 | // $elements[0]->click(); |
| 48 | 48 | // $this->byXPath("//input[contains(@name,'claimed') and contains(@value,'0')]")->click(); |
| 49 | - $this->ExecuteScript('jQuery("#geodir_claimed_row input:radio:first").prop("checked", true).trigger("click");'); |
|
| 50 | - } |
|
| 51 | - $this->byId('geodir_accept_term_condition')->click(); |
|
| 52 | - $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
|
| 53 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 54 | - $this->byXPath("//input[@name='Submit and Pay']")->click(); |
|
| 55 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 56 | - $this->ExecuteScript('jQuery("#gd_pmethod_stripe").prop("checked", true).trigger("click");'); |
|
| 57 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 58 | - $this->byId('gd_checkout_paynow')->click(); |
|
| 49 | + $this->ExecuteScript('jQuery("#geodir_claimed_row input:radio:first").prop("checked", true).trigger("click");'); |
|
| 50 | + } |
|
| 51 | + $this->byId('geodir_accept_term_condition')->click(); |
|
| 52 | + $this->byXPath("//div[@id='geodir-add-listing-submit']//input[@type='submit']")->click(); |
|
| 53 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 54 | + $this->byXPath("//input[@name='Submit and Pay']")->click(); |
|
| 55 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 56 | + $this->ExecuteScript('jQuery("#gd_pmethod_stripe").prop("checked", true).trigger("click");'); |
|
| 57 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 58 | + $this->byId('gd_checkout_paynow')->click(); |
|
| 59 | 59 | // $this->waitForPageLoadAndCheckForErrors(); |
| 60 | 60 | // $this->byId('email')->value('[email protected]'); |
| 61 | 61 | // $this->byId('card_number')->value('4242424242424242'); |
| 62 | 62 | // $this->byId('cc-exp')->value('12 / 20'); |
| 63 | 63 | // $this->byId('cc-csc')->value('333'); |
| 64 | 64 | // $this->byId('submitButton')->click(); |
| 65 | - $this->logInfo('Skipping stripe payment since cross-site scripting not possible......'); |
|
| 66 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 67 | - } |
|
| 65 | + $this->logInfo('Skipping stripe payment since cross-site scripting not possible......'); |
|
| 66 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - public function tearDown() |
|
| 70 | - { |
|
| 71 | - if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
| 72 | - //write current file number to completed.txt |
|
| 73 | - $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
| 74 | - $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
| 75 | - fwrite($completed, $CurrentFileNumber); |
|
| 76 | - } |
|
| 77 | - } |
|
| 69 | + public function tearDown() |
|
| 70 | + { |
|
| 71 | + if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) { |
|
| 72 | + //write current file number to completed.txt |
|
| 73 | + $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)); |
|
| 74 | + $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!"); |
|
| 75 | + fwrite($completed, $CurrentFileNumber); |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | 78 | } |
| 79 | 79 | ?> |
| 80 | 80 | \ No newline at end of file |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $is_active1 = $this->byId("stripe-payment-geodirectory-add-on")->attribute('class'); |
| 33 | - $this->assertFalse( strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active"); |
|
| 33 | + $this->assertFalse(strpos($is_active1, 'inactive'), "stripe payment geodirectory add on plugin not active"); |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | $this->url(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options'); |
@@ -1,45 +1,45 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | class LoginUser 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 testLogin() |
|
| 18 | - { |
|
| 19 | - $this->logInfo('Logging in new user......'); |
|
| 20 | - $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1'); |
|
| 21 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 22 | - $this->assertTrue( $this->isTextPresent("Sign In"), "No text found"); |
|
| 23 | - $this->byId('user_login')->value('[email protected]'); |
|
| 24 | - $this->byId('user_pass')->value('1'); |
|
| 17 | + public function testLogin() |
|
| 18 | + { |
|
| 19 | + $this->logInfo('Logging in new user......'); |
|
| 20 | + $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1'); |
|
| 21 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 22 | + $this->assertTrue( $this->isTextPresent("Sign In"), "No text found"); |
|
| 23 | + $this->byId('user_login')->value('[email protected]'); |
|
| 24 | + $this->byId('user_pass')->value('1'); |
|
| 25 | 25 | // $this->byId('rememberme')->click(); |
| 26 | - // Submit the form |
|
| 27 | - $this->byId('cus_loginform')->submit(); |
|
| 28 | - $this->waitForPageLoadAndCheckForErrors(); |
|
| 29 | - $this->assertFalse( $this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password."); |
|
| 30 | - $this->assertTrue( $this->isTextPresent("Add Listing"), "Add Listing text not found"); |
|
| 26 | + // Submit the form |
|
| 27 | + $this->byId('cus_loginform')->submit(); |
|
| 28 | + $this->waitForPageLoadAndCheckForErrors(); |
|
| 29 | + $this->assertFalse( $this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password."); |
|
| 30 | + $this->assertTrue( $this->isTextPresent("Add Listing"), "Add Listing text not found"); |
|
| 31 | 31 | |
| 32 | - } |
|
| 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 | ?> |
| 46 | 46 | \ No newline at end of file |
@@ -19,15 +19,15 @@ |
||
| 19 | 19 | $this->logInfo('Logging in new user......'); |
| 20 | 20 | $this->url(self::GDTEST_BASE_URL.'gd-login/?signup=1'); |
| 21 | 21 | $this->waitForPageLoadAndCheckForErrors(); |
| 22 | - $this->assertTrue( $this->isTextPresent("Sign In"), "No text found"); |
|
| 22 | + $this->assertTrue($this->isTextPresent("Sign In"), "No text found"); |
|
| 23 | 23 | $this->byId('user_login')->value('[email protected]'); |
| 24 | 24 | $this->byId('user_pass')->value('1'); |
| 25 | 25 | // $this->byId('rememberme')->click(); |
| 26 | 26 | // Submit the form |
| 27 | 27 | $this->byId('cus_loginform')->submit(); |
| 28 | 28 | $this->waitForPageLoadAndCheckForErrors(); |
| 29 | - $this->assertFalse( $this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password."); |
|
| 30 | - $this->assertTrue( $this->isTextPresent("Add Listing"), "Add Listing text not found"); |
|
| 29 | + $this->assertFalse($this->isTextPresent("Invalid Username/Password."), "Invalid Username/Password."); |
|
| 30 | + $this->assertTrue($this->isTextPresent("Add Listing"), "Add Listing text not found"); |
|
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | |