? NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
20 Jan 2023

Pull Request for Issue # .

Summary of Changes

Testing Instructions

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2023
Category JavaScript Administration com_media NPM Change
avatar dgrammatiko dgrammatiko - open - 20 Jan 2023
avatar dgrammatiko dgrammatiko - change - 20 Jan 2023
Status New Pending
avatar dgrammatiko dgrammatiko - change - 20 Jan 2023
Labels Added: NPM Resource Changed ?
avatar richard67
richard67 - comment - 21 Jan 2023

@dgrammatiko It seems it needs to adapt the system tests to the change of this PR because they fail at a step described with "MediaListCest: Test that it is possible to select multiple":

MediaListCest: Test that it is possible to select multiple
Signature: MediaListCest:selectMultipleItems
Test: tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php:selectMultipleItems
Scenario --
 I do administrator login 
  [Cookies] [{"name":"1c8d64544099297a7b26be2910220d97","value":"k19ep7v9flmbthko0smo05htk6","path":"/","domain":"localhost","expiry":1674328661,"secure":false,"httpOnly":false}]
  [Snapshot] Restored "ci-admin" session snapshot
 I create directory "images/test-dir"
   I get config "cmsPath"
   I get config "localUser"
 Created /tests/www/mysql/images/test-dir
 I am on page "administrator/index.php?option=com_media&..."
  [GET] http://localhost/mysql/administrator/index.php?option=com_media&path=local-images:/
 I wait for media loaded 
   I wait for element {"class":"media-loader"},3
   I wait for element not visible {"class":"media-loader"}
   I wait 0.5
 I click "//div[contains(@class, 'media-browser-item-inf..."
 I click holding shiftkey "//div[contains(@class, 'media-browser-item-info') and normalize-space(text()) = 'powered_by.png']/parent::div"
   I execute in selenium "Closure"
 I see number of elements {"css":".media-browser-item....},2
 I delete directory "images/test-dir"
   I get config "cmsPath"
 Deleted /tests/www/mysql/images/test-dir
 I execute js "window.sessionStorage.removeItem("joomla...."
  Screenshot and page source were saved into '/********/src/tests/Codeception/_output/' dir
 FAIL 
------------------------------------------------------------
Time: 2.67 minutes, Memory: 16.00 MB
There was 1 failure:
---------
1) MediaListCest: Test that it is possible to select multiple
 Test  tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php:selectMultipleItems
 Step  See number of elements {"css":".media-browser-item.selected"},2
 Fail  Number of elements counted differs from expected number
Failed asserting that 1 matches expected 2.
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jan 2023
Category JavaScript Administration com_media NPM Change JavaScript Administration com_media NPM Change Unit Tests
avatar dgrammatiko dgrammatiko - change - 21 Jan 2023
Labels Added: ?
avatar richard67
richard67 - comment - 22 Jan 2023

@dgrammatiko Now the system tests fail at a later step:

There was 1 error:
---------
1) MediaListCest: Test that it is possible to delete multiple files.
 Test  tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php:deleteMultipleFiles
  [Facebook\WebDriver\Exception\TimeoutException]   
Scenario Steps:
 38. $I->executeJS("window.sessionStorage.removeItem("j...") at tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php:95
 37. // Deleted /tests/www/mysql/images/test-dir
 36. $I->getConfig("cmsPath") at tests/Codeception/_support/Step/Acceptance/Administrator/Media.php:377
 35. $I->waitForElementNotVisible("//div[contains(@clas...") at tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php:537
 34. $I->see("Item deleted.",{"id":"system-message-cont...}) at tests/Codeception/_support/Step/Acceptance/Administrator/Admin.php:47
 33. $I->waitForText("Item deleted.",90,{"id":"system-m...}) at tests/Codeception/_support/Step/Acceptance/Administrator/Admin.php:46
#1  /tests/www/mysql/libraries/vendor/php-webdriver/webdriver/lib/WebDriverWait.php:71
#2  Codeception\Module\WebDriver->waitForElementNotVisible
#3  /tests/www/mysql/tests/Codeception/_support/_generated/AcceptanceTesterActions.php:5157
#4  /tests/www/mysql/tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php:537
#5  MediaListCest->deleteMultipleFiles
#6  /tests/www/mysql/libraries/vendor/bin/codecept:115
6fdb8a4 22 Jan 2023 avatar dgrammatiko tests
avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2023

@richard67 I think shift is the preferred key here, leaving the ctrl for the copy operation. Also what Brian mentioned about the expected range selection makes more sense than this change

avatar richard67
richard67 - comment - 22 Jan 2023

@richard67 I think shift is the preferred key here, leaving the ctrl for the copy operation. Also what Brian mentioned about the expected range selection makes more sense than this change

@dgrammatiko I don't understand. You mean there is something which makes more sense than the change in this PR here? System tests are passing now by the way.

avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2023

@richard67 quoting Brian:

it should be select files individually with ctrl click then select beginning and end of selection with shift click

Basically selecting the further left item in a row and then shift click on the further right item on the row (or a following row) should select all the items in the range. Same behaviour for the reverse (left to right). Should be easy to achieve as the items are in an array so, finding the index of the selected and comparing it to the current should give a negative (the current clicked item is before the already selected), zero (it's the same item) or positive (the current clicked item is after the already selected), so a simple check of all the item in the between is what need...

About the ctrl and the copy: on Macs the copy operation is with the option key but I think on windows it's with the control, so it might be confusing that control is used for selecting but also for copying (or not, I haven't touched windows for years)

avatar richard67
richard67 - comment - 22 Jan 2023

@dgrammatiko Does that mean this PR here is ok and ready for testing? Or shall we wait for something?

avatar Quy
Quy - comment - 30 Jan 2023

Rebase to 4.3?

avatar laoneo
laoneo - comment - 30 Jan 2023

Or even 5.0

avatar dgrammatiko
dgrammatiko - comment - 30 Jan 2023

Will redo this for 5.0

avatar dgrammatiko dgrammatiko - close - 30 Jan 2023
avatar dgrammatiko dgrammatiko - change - 30 Jan 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-01-30 20:45:44
Closed_By dgrammatiko

Add a Comment

Login with GitHub to post a comment