Skip to content

Commit

Permalink
Youtube shared videos playwright tests (#646)
Browse files Browse the repository at this point in the history
* news and announcement test

* fix comment

* fix no youtube video message also for observation date videos

* utility function to generate random int

* page object for youtube drawer

* implement test for the youtube drawer scenarios

* some useful renaming

* fix typescript style

* code style fixes

* fix typo bug
  • Loading branch information
mudhoney authored Nov 18, 2024
1 parent 445a4c8 commit 61a7e80
Show file tree
Hide file tree
Showing 6 changed files with 610 additions and 6 deletions.
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ function attr($attr, $file) {
<div id="user-video-gallery-main-current">
<span id="user-video-gallery-spinner-current"></span>
</div>
<p class="js-no-movies" style="display: none;">No shared movies found.</p>
<p class="js-no-movies" style="display: none;">No movies found around the observation date.</p>
</div>
</div>
</div>
Expand All @@ -741,6 +741,7 @@ function attr($attr, $file) {
<div id="user-video-gallery-main">
<span id="user-video-gallery-spinner"></span>
</div>
<p class="js-no-movies" style="display: none;">No shared movies found.</p>
</div>
</div>
</div>
Expand Down
23 changes: 18 additions & 5 deletions resources/js/UI/UserVideoGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ var UserVideoGallery = Class.extend(
init : function (url) {
this._container = $("#user-video-gallery-main");
this._containerCurrent = $("#user-video-gallery-main-current");
this._noSharedMoviesFound = $("#user-video-gallery-current .js-no-movies");
this._noSharedMoviesFound = $("#user-video-gallery .js-no-movies");
this._noSharedMoviesFoundForObservationDate = $("#user-video-gallery-current .js-no-movies");
this._loader = $("#user-video-gallery-spinner");
this._loaderCurrent = $("#user-video-gallery-spinner-current");

Expand Down Expand Up @@ -262,9 +263,15 @@ var UserVideoGallery = Class.extend(
count++;
});

if($('.user-video-thumbnail-container-recent').length == 0){
if($('.user-video-thumbnail-container-current').length == 0){
this._noSharedMoviesFoundForObservationDate.show();
} else {
this._noSharedMoviesFoundForObservationDate.hide();
}

if($('.user-video-thumbnail-container-recent').length == 0){
this._noSharedMoviesFound.show();
} else {
} else {
this._noSharedMoviesFound.hide();
}

Expand Down Expand Up @@ -370,14 +377,20 @@ var UserVideoGallery = Class.extend(
}

if($('.user-video-thumbnail-container-current').length == 0){
this._noSharedMoviesFound.show();
this._noSharedMoviesFoundForObservationDate.show();
} else {
this._noSharedMoviesFound.hide();
this._noSharedMoviesFoundForObservationDate.hide();
if(count == this._numVideosCurrent){
this._containerCurrent.append('<span class="user-video-current-show-more">SHOW MORE</span>');
}
}

if($('.user-video-thumbnail-container-recent').length == 0){
this._noSharedMoviesFound.show();
} else {
this._noSharedMoviesFound.hide();
}

$('#user-video-gallery-main-current > div').off();
$('#user-video-gallery-main-current > div').hover(function(){
var id = $(this).data('id');
Expand Down
Loading

0 comments on commit 61a7e80

Please sign in to comment.