From 12550112fdc21f3589ba6f3844b4f4cd077a5a0f Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Wed, 19 Nov 2014 11:28:03 -0500 Subject: [PATCH 1/3] Remove base URL from selenium tests to make the Selenium IDE happy --- tests/selenium/Account Plans.html | 196 ------------------ .../selenium/Add Media Skeleton Present.html | 2 +- .../selenium/Calendar Add Show Skeleton.html | 2 +- .../Calendar Day Week Month Views.html | 2 +- tests/selenium/Calendar Skeleton Present.html | 2 +- tests/selenium/Library Skeleton Present.html | 2 +- tests/selenium/Listen Button Skeleton.html | 2 +- tests/selenium/Login and Logout.html | 2 +- tests/selenium/Login.html | 2 +- tests/selenium/Preferences Skeletons.html | 2 +- tests/selenium/System Menu Contents.html | 2 +- 11 files changed, 10 insertions(+), 206 deletions(-) delete mode 100644 tests/selenium/Account Plans.html diff --git a/tests/selenium/Account Plans.html b/tests/selenium/Account Plans.html deleted file mode 100644 index a320b9dfb..000000000 --- a/tests/selenium/Account Plans.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - -Account Plans - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Account Plans
open/billing/upgrade
clickAndWaitlink=Account Plans
verifyElementPresentid=hobbyist_grid_price
verifyElementPresentid=starter_grid_price
verifyElementPresentid=plus_grid_price
verifyElementPresentid=premium_grid_price
verifyTextid=hobbyist_grid_price$9.95 / month
verifyTextid=starter_grid_price$39.95 / month
verifyTextid=plus_grid_price$64.95 / month
verifyTextid=premium_grid_price$99.95 / month
verifyElementPresentid=current_plan
verifyElementPresentid=newproductbillingcycle-monthly
verifyElementPresentid=newproductbillingcycle-annually
verifyElementPresentid=newproductid-25
verifyElementPresentid=newproductid-26
verifyElementPresentid=newproductid-27
verifyElementPresentid=newproductid-28
verifyElementPresentcss=span.subtotal
verifyElementPresentid=firstname
verifyElementPresentid=lastname
verifyElementPresentid=companyname
verifyElementPresentid=email
verifyElementPresentid=address1
verifyElementPresentid=address2
verifyElementPresentid=city
verifyElementPresentid=state
verifyElementPresentid=postcode
verifyElementPresentid=country
verifyElementPresentid=phonenumber
verifyElementPresentid=securityqid
verifyElementPresentid=securityqans
verifyElementPresentid=customfields-7
verifyElementPresentid=customfields-71
verifyElementPresentid=paymentmethod-paypal
verifyElementPresent//div[@id='total_box']/b[2]
verifyElementPresentcss=input[type="submit"]
- - diff --git a/tests/selenium/Add Media Skeleton Present.html b/tests/selenium/Add Media Skeleton Present.html index 597721829..d9def30cf 100644 --- a/tests/selenium/Add Media Skeleton Present.html +++ b/tests/selenium/Add Media Skeleton Present.html @@ -3,7 +3,7 @@ - + Add Media Skeleton Present diff --git a/tests/selenium/Calendar Add Show Skeleton.html b/tests/selenium/Calendar Add Show Skeleton.html index d16810637..6ab57a89e 100644 --- a/tests/selenium/Calendar Add Show Skeleton.html +++ b/tests/selenium/Calendar Add Show Skeleton.html @@ -3,7 +3,7 @@ - + Calendar Add Show Skeleton diff --git a/tests/selenium/Calendar Day Week Month Views.html b/tests/selenium/Calendar Day Week Month Views.html index 6923d1c8a..6cefa5625 100644 --- a/tests/selenium/Calendar Day Week Month Views.html +++ b/tests/selenium/Calendar Day Week Month Views.html @@ -3,7 +3,7 @@ - + Calendar Day Week Month Views diff --git a/tests/selenium/Calendar Skeleton Present.html b/tests/selenium/Calendar Skeleton Present.html index 9275f8ecb..6aeb2f102 100644 --- a/tests/selenium/Calendar Skeleton Present.html +++ b/tests/selenium/Calendar Skeleton Present.html @@ -3,7 +3,7 @@ - + Calendar Skeleton Present diff --git a/tests/selenium/Library Skeleton Present.html b/tests/selenium/Library Skeleton Present.html index 4c34a993b..a6f01315b 100644 --- a/tests/selenium/Library Skeleton Present.html +++ b/tests/selenium/Library Skeleton Present.html @@ -3,7 +3,7 @@ - + Library Skeleton Present diff --git a/tests/selenium/Listen Button Skeleton.html b/tests/selenium/Listen Button Skeleton.html index 5fb225fd6..b0f783879 100644 --- a/tests/selenium/Listen Button Skeleton.html +++ b/tests/selenium/Listen Button Skeleton.html @@ -3,7 +3,7 @@ - + Listen Button Skeleton diff --git a/tests/selenium/Login and Logout.html b/tests/selenium/Login and Logout.html index 5a72b31de..1cc6a906a 100644 --- a/tests/selenium/Login and Logout.html +++ b/tests/selenium/Login and Logout.html @@ -3,7 +3,7 @@ - + Login and Logout diff --git a/tests/selenium/Login.html b/tests/selenium/Login.html index a51883ea7..83aaf18d7 100644 --- a/tests/selenium/Login.html +++ b/tests/selenium/Login.html @@ -3,7 +3,7 @@ - + Login diff --git a/tests/selenium/Preferences Skeletons.html b/tests/selenium/Preferences Skeletons.html index 67fab75ef..47f114551 100644 --- a/tests/selenium/Preferences Skeletons.html +++ b/tests/selenium/Preferences Skeletons.html @@ -3,7 +3,7 @@ - + Preferences Skeletons diff --git a/tests/selenium/System Menu Contents.html b/tests/selenium/System Menu Contents.html index 2a2a4077c..a064cabbb 100644 --- a/tests/selenium/System Menu Contents.html +++ b/tests/selenium/System Menu Contents.html @@ -3,7 +3,7 @@ - + System Menu Contents From 48ae8ac69c7adf923ed21b397db229799368fe5d Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 19 Nov 2014 14:10:53 -0500 Subject: [PATCH 2/3] Scheduler->removeItems optimization --- airtime_mvc/application/models/Scheduler.php | 50 +++++++------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 39415beaa..05b55bdba 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -1112,9 +1112,12 @@ class Application_Model_Scheduler $removedItems = CcScheduleQuery::create()->findPks($scheduledIds); - //check to make sure all items selected are up to date - foreach ($removedItems as $removedItem) { + // This array is used to keep track of every show instance that was + // effected by the track deletion. It will be used later on to + // remove gaps in the schedule and adjust crossfade times. + $effectedInstanceIds = array(); + foreach ($removedItems as $removedItem) { $instance = $removedItem->getCcShowInstances($this->con); //check if instance is linked and if so get the schedule items @@ -1122,25 +1125,22 @@ class Application_Model_Scheduler if (!$cancelShow && $instance->getCcShow()->isLinked()) { //returns all linked instances if linked $ccShowInstances = $this->getInstances($instance->getDbId()); + $instanceIds = array(); foreach ($ccShowInstances as $ccShowInstance) { $instanceIds[] = $ccShowInstance->getDbId(); } - /* - * Find all the schedule items that are in the same position - * as the selected item by the user. - * The position of each track is the same across each linked instance - */ + $effectedInstanceIds = array_merge($effectedInstanceIds, $instanceIds); + + // Delete the same track, represented by $removedItem, in + // each linked show instance. $itemsToDelete = CcScheduleQuery::create() ->filterByDbPosition($removedItem->getDbPosition()) ->filterByDbInstanceId($instanceIds, Criteria::IN) - ->find(); - foreach ($itemsToDelete as $item) { - if (!$removedItems->contains($item)) { - $removedItems->append($item); - } - } + ->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL) + ->delete($this->con); } + //check to truncate the currently playing item instead of deleting it. if ($removedItem->isCurrentItem($this->epochNow)) { @@ -1165,29 +1165,11 @@ class Application_Model_Scheduler } else { $removedItem->delete($this->con); } - - // update is_scheduled in cc_files but only if - // the file is not scheduled somewhere else - $fileId = $removedItem->getDbFileId(); - // check if the removed item is scheduled somewhere else - $futureScheduledFiles = Application_Model_Schedule::getAllFutureScheduledFiles(); - if (!is_null($fileId) && !in_array($fileId, $futureScheduledFiles)) { - $db_file = CcFilesQuery::create()->findPk($fileId, $this->con); - $db_file->setDbIsScheduled(false)->save($this->con); - } } + Application_Model_StoredFile::updatePastFilesIsScheduled(); if ($adjustSched === true) { - //get the show instances of the shows we must adjust times for. - foreach ($removedItems as $item) { - - $instance = $item->getDBInstanceId(); - if (!in_array($instance, $showInstances)) { - $showInstances[] = $instance; - } - } - - foreach ($showInstances as $instance) { + foreach ($effectedInstanceIds as $instance) { $this->removeGaps($instance); $this->calculateCrossfades($instance); } @@ -1195,7 +1177,7 @@ class Application_Model_Scheduler //update the status flag in cc_schedule. $instances = CcShowInstancesQuery::create() - ->filterByPrimaryKeys($showInstances) + ->filterByPrimaryKeys($effectedInstanceIds) ->find($this->con); foreach ($instances as $instance) { From 00fbda193e2e0ccd6459eb5dc0a37888e4d7e4e2 Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 19 Nov 2014 17:09:54 -0500 Subject: [PATCH 3/3] Schedule->removeItems optimization fix for deleting the current playing track --- airtime_mvc/application/models/Scheduler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 05b55bdba..4208ff5c7 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -1119,6 +1119,7 @@ class Application_Model_Scheduler foreach ($removedItems as $removedItem) { $instance = $removedItem->getCcShowInstances($this->con); + $effectedInstanceIds[] = $instance->getDbId(); //check if instance is linked and if so get the schedule items //for all linked instances so we can delete them too