2021-01-15 16:02:39 +00:00
import { Selector } from "testcafe" ;
import testcafeconfig from "./testcafeconfig" ;
2019-05-21 15:00:46 +00:00
import Page from "./page-model" ;
2021-01-15 16:02:39 +00:00
import { ClientFunction } from "testcafe" ;
2020-05-28 08:01:11 +00:00
2020-05-31 17:31:48 +00:00
const scroll = ClientFunction ( ( x , y ) => window . scrollTo ( x , y ) ) ;
const getcurrentPosition = ClientFunction ( ( ) => window . pageYOffset ) ;
2021-01-15 16:02:39 +00:00
fixture ` Test photos ` . page ` ${ testcafeconfig . url } ` ;
2019-05-21 15:00:46 +00:00
const page = new Page ( ) ;
2021-01-25 18:12:25 +00:00
test . meta ( "testID" , "photos-001" ) ( "Scroll to top" , async ( t ) => {
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-15 16:02:39 +00:00
await page . setFilter ( "view" , "Cards" ) ;
await t
. expect ( Selector ( "button.is-photo-scroll-top" ) . exists )
. notOk ( )
. expect ( getcurrentPosition ( ) )
. eql ( 0 )
. expect ( Selector ( 'div[class="v-image__image v-image__image--cover"]' ) . nth ( 0 ) . visible )
. ok ( ) ;
await scroll ( 0 , 1400 ) ;
await scroll ( 0 , 1000 ) ;
await t . click ( Selector ( "button.p-scroll-top" ) ) . expect ( getcurrentPosition ( ) ) . eql ( 0 ) ;
2020-05-31 17:31:48 +00:00
} ) ;
2019-06-20 14:17:43 +00:00
2021-01-15 16:02:39 +00:00
test . meta ( "testID" , "photos-002" ) (
"Download single photo/video using clipboard and fullscreen mode" ,
async ( t ) => {
await page . search ( "photo:true" ) ;
const FirstPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
const SecondPhoto = await Selector ( "div.is-photo" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
await t . click ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) ) ;
await t
. expect ( Selector ( "#p-photo-viewer" ) . visible )
. ok ( )
. hover ( Selector ( ".action-download" ) )
. expect ( Selector ( ".action-download" ) . visible )
. ok ( )
. click ( Selector ( ".action-close" ) ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPhoto ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
const FirstVideo = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstVideo ) ;
2021-01-15 16:02:39 +00:00
const clipboardCount = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t
. expect ( clipboardCount . textContent )
. eql ( "2" )
. click ( Selector ( "button.action-menu" ) )
. expect ( Selector ( "button.action-download" ) . visible )
. ok ( ) ;
}
) ;
test . meta ( "testID" , "photos-003" ) (
"Approve photo using approve and by adding location" ,
async ( t ) => {
2020-05-28 08:01:11 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( "div.nav-browse + div" ) ) . click ( Selector ( ".nav-review" ) ) ;
await page . search ( "type:image" ) ;
const FirstPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
const SecondPhoto = await Selector ( "div.is-photo" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
const ThirdPhoto = await Selector ( "div.is-photo" ) . nth ( 2 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2019-06-20 14:17:43 +00:00
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-browse" ) ) ;
2020-05-28 08:01:11 +00:00
await t
2021-01-15 16:02:39 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-review" ) ) ;
2020-05-28 14:36:32 +00:00
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPhoto ) ;
2020-06-01 15:04:47 +00:00
await page . editSelected ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( "button.action-close" ) ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2019-05-21 15:00:46 +00:00
await t
2021-01-15 16:02:39 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . visible , { timeout : 5000 } )
. ok ( ) ;
2020-06-01 15:04:47 +00:00
await page . editSelected ( ) ;
2021-01-19 17:20:10 +00:00
await t . click ( Selector ( "button.action-approve" ) ) ;
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( "button.action-apply" ) ) . click ( Selector ( "button.action-close" ) ) ;
} else {
await t . click ( Selector ( "button.action-done" , { timeout : 5000 } ) ) ;
}
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( SecondPhoto ) ;
2020-06-01 15:04:47 +00:00
await page . editSelected ( ) ;
2020-05-28 15:59:57 +00:00
await t
2021-01-15 16:02:39 +00:00
. typeText ( Selector ( 'input[aria-label="Latitude"]' ) , "9.999" )
2021-01-19 17:20:10 +00:00
. typeText ( Selector ( 'input[aria-label="Longitude"]' ) , "9.999" ) ;
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( "button.action-apply" ) ) . click ( Selector ( "button.action-close" ) ) ;
} else {
await t . click ( Selector ( "button.action-done" , { timeout : 5000 } ) ) ;
}
2021-01-18 19:43:34 +00:00
await page . setFilter ( "view" , "Cards" ) ;
2021-01-15 16:02:39 +00:00
const ButtonThirdPhoto = 'div.is-photo[data-uid="' + ThirdPhoto + '"] button.action-approve' ;
2021-01-19 17:20:10 +00:00
await t . click ( Selector ( ButtonThirdPhoto ) ) ;
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdPhoto ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-15 16:02:39 +00:00
await page . search ( "type:image" ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . visible )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . visible )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdPhoto ) . visible )
. ok ( ) ;
}
2021-01-20 16:13:42 +00:00
) ;
2021-01-15 16:02:39 +00:00
test . meta ( "testID" , "photos-004" ) ( "Like/dislike photo/video" , async ( t ) => {
2021-01-20 11:09:01 +00:00
const FirstPhoto = await Selector ( "div.is-photo.type-image" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
const SecondPhoto = await Selector ( "div.is-photo.type-image" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
2021-01-15 16:02:39 +00:00
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
const FirstVideo = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-favorites" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
2021-01-20 11:09:01 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
2021-01-15 16:02:39 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-15 16:02:39 +00:00
await page . toggleLike ( FirstPhoto ) ;
2021-01-20 11:09:01 +00:00
await page . selectPhotoFromUID ( SecondPhoto ) ;
await page . editSelected ( ) ;
await page . turnSwitchOn ( "favorite" ) ;
await t
. click ( Selector ( ".action-close" ) ) ;
await t
. expect ( Selector ( "div.is-photo" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , {
timeout : 5000 ,
} )
. ok ( )
. expect ( Selector ( "div.is-photo" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , {
2021-01-15 16:02:39 +00:00
timeout : 5000 ,
} )
. ok ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
await page . toggleLike ( FirstVideo ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div.is-photo" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , {
timeout : 5000 ,
} )
. ok ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-favorites" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( )
2021-01-20 11:09:01 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
2021-01-15 16:02:39 +00:00
. ok ( )
2021-01-20 11:09:01 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
2021-01-15 16:02:39 +00:00
. ok ( ) ;
await page . toggleLike ( FirstVideo ) ;
await page . toggleLike ( FirstPhoto ) ;
2021-01-20 11:09:01 +00:00
await page . editSelected ( ) ;
await page . turnSwitchOff ( "private" ) ;
await t
. click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
2021-01-20 11:09:01 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
2021-01-15 16:02:39 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2020-05-28 08:01:11 +00:00
} ) ;
2021-01-15 16:02:39 +00:00
test . meta ( "testID" , "photos-005" ) (
"Private/unprivate photo/video using clipboard and list" ,
async ( t ) => {
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-browse" ) ) ;
await page . search ( "photo:true" ) ;
await page . setFilter ( "view" , "Mosaic" ) ;
const FirstPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
const SecondPhoto = await Selector ( "div.is-photo" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
const ThirdPhoto = await Selector ( "div.is-photo" ) . nth ( 2 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
const FirstVideo = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
const SecondVideo = await Selector ( "div.is-photo" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
2021-01-20 11:09:01 +00:00
const ThirdVideo = await Selector ( "div.is-photo" ) . nth ( 2 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-private" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondVideo ) . exists , { timeout : 5000 } )
2021-01-20 11:09:01 +00:00
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdVideo ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPhoto ) ;
2020-12-28 12:02:29 +00:00
await page . selectFromUIDInFullscreen ( SecondPhoto ) ;
2021-01-15 16:02:39 +00:00
const clipboardCount = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t
. expect ( clipboardCount . textContent )
. eql ( "2" )
. click ( Selector ( "button.action-menu" ) )
. click ( Selector ( "button.action-private" ) )
. expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . setFilter ( "view" , "List" ) ;
2021-01-25 18:12:25 +00:00
await t . click ( Selector ( "button.input-private" ) . withAttribute ( "data-uid" , ThirdPhoto ) ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "td" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "td" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "td" ) . withAttribute ( "data-uid" , ThirdPhoto ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-video" ) ) ;
2021-01-15 16:02:39 +00:00
2021-01-25 18:12:25 +00:00
await t . click ( Selector ( "button.input-private" ) . withAttribute ( "data-uid" , SecondVideo ) ) ;
2021-01-15 16:02:39 +00:00
await page . setFilter ( "view" , "Card" ) ;
2020-05-28 14:36:32 +00:00
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstVideo ) ;
2021-01-15 16:02:39 +00:00
const clipboardCountVideo = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t
. expect ( clipboardCountVideo . textContent )
. eql ( "1" )
. click ( Selector ( "button.action-menu" ) )
. click ( Selector ( "button.action-private" ) )
. expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-20 11:09:01 +00:00
await page . selectPhotoFromUID ( ThirdVideo ) ;
await page . editSelected ( ) ;
await page . turnSwitchOn ( "private" ) ;
await t
. click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondVideo ) . exists , { timeout : 5000 } )
2021-01-20 11:09:01 +00:00
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-private" ) ) ;
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondVideo ) . exists , { timeout : 5000 } )
2021-01-20 11:09:01 +00:00
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdVideo ) . exists , { timeout : 5000 } )
. ok ( ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPhoto ) ;
await page . selectPhotoFromUID ( SecondPhoto ) ;
await page . selectPhotoFromUID ( FirstVideo ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( "button.action-menu" ) ) . click ( Selector ( "button.action-private" ) ) ;
2021-01-20 11:09:01 +00:00
await page . selectPhotoFromUID ( ThirdVideo ) ;
await page . editSelected ( ) ;
await page . turnSwitchOff ( "private" ) ;
await t
. click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
2021-01-15 16:02:39 +00:00
await page . setFilter ( "view" , "List" ) ;
await t
2021-01-25 18:12:25 +00:00
. click ( Selector ( "button.input-private" ) . withAttribute ( "data-uid" , ThirdPhoto ) )
. click ( Selector ( "button.input-private" ) . withAttribute ( "data-uid" , SecondVideo ) ) ;
2021-01-15 16:02:39 +00:00
await page . setFilter ( "view" , "Mosaic" ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondVideo ) . exists , { timeout : 5000 } )
2021-01-20 11:09:01 +00:00
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondVideo ) . exists , { timeout : 5000 } )
2021-01-20 11:09:01 +00:00
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdVideo ) . exists , { timeout : 5000 } )
. ok ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-video" ) ) ;
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondVideo ) . exists , { timeout : 5000 } )
2021-01-20 11:09:01 +00:00
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ThirdVideo ) . exists , { timeout : 5000 } )
. ok ( ) ;
2021-01-15 16:02:39 +00:00
}
) ;
2021-01-20 16:13:42 +00:00
test . meta ( "testID" , "photos-006" ) (
2021-01-15 16:02:39 +00:00
"Archive/restore video, photos, private photos and review photos using clipboard" ,
async ( t ) => {
2020-05-28 08:01:11 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-browse" ) ) ;
await page . search ( "photo:true" ) ;
await page . setFilter ( "view" , "Mosaic" ) ;
const FirstPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
const SecondPhoto = await Selector ( "div.is-photo" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
const FirstVideo = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-private" ) ) ;
const FirstPrivatePhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( "div.nav-browse + div" ) ) . click ( Selector ( ".nav-review" ) ) ;
const FirstReviewPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-archive" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPrivatePhoto ) . exists , {
timeout : 5000 ,
} )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstReviewPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
await page . setFilter ( "view" , "Card" ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstVideo ) ;
2021-01-15 16:02:39 +00:00
const clipboardCountVideo = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t . expect ( clipboardCountVideo . textContent ) . eql ( "1" ) ;
2020-06-01 15:04:47 +00:00
await page . archiveSelected ( ) ;
2021-01-19 17:20:10 +00:00
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2020-05-28 08:01:11 +00:00
await t
2021-01-15 16:02:39 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPhoto ) ;
await page . selectPhotoFromUID ( SecondPhoto ) ;
2021-01-15 16:02:39 +00:00
const clipboardCountPhotos = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t . expect ( clipboardCountPhotos . textContent ) . eql ( "2" ) ;
2020-06-01 15:04:47 +00:00
await page . archiveSelected ( ) ;
2021-01-19 17:20:10 +00:00
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2020-05-28 08:01:11 +00:00
await t
2021-01-15 16:02:39 +00:00
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-private" ) ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPrivatePhoto ) ;
2021-01-15 16:02:39 +00:00
const clipboardCountPrivate = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t . expect ( clipboardCountPrivate . textContent ) . eql ( "1" ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( ".nav-browse + div" ) ) . click ( Selector ( ".nav-review" ) ) ;
} else {
await t . click ( Selector ( ".nav-review" ) ) ;
}
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstReviewPhoto ) ;
2021-01-15 16:02:39 +00:00
const clipboardCountReview = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t . expect ( clipboardCountReview . textContent ) . eql ( "2" ) ;
2020-06-01 15:04:47 +00:00
await page . archiveSelected ( ) ;
2021-01-19 17:20:10 +00:00
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstReviewPhoto ) . exists , { timeout : 5000 } )
2021-01-18 19:43:34 +00:00
. notOk ( ) ;
await page . openNav ( ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( ".nav-browse + div" ) ) . click ( Selector ( ".nav-archive" ) ) ;
} else {
await t . click ( Selector ( ".nav-archive" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPrivatePhoto ) . exists , {
timeout : 5000 ,
} )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstReviewPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
2021-01-13 15:56:45 +00:00
await page . selectPhotoFromUID ( FirstPhoto ) ;
await page . selectPhotoFromUID ( SecondPhoto ) ;
await page . selectPhotoFromUID ( FirstVideo ) ;
await page . selectPhotoFromUID ( FirstPrivatePhoto ) ;
await page . selectPhotoFromUID ( FirstReviewPhoto ) ;
2021-01-15 16:02:39 +00:00
const clipboardCountArchive = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t . expect ( clipboardCountArchive . textContent ) . eql ( "5" ) ;
2020-06-01 15:04:47 +00:00
await page . restoreSelected ( ) ;
2021-01-19 17:20:10 +00:00
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPrivatePhoto ) . exists , {
timeout : 5000 ,
} )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstReviewPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-video" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. ok ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-browse" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , SecondPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( ".nav-private" ) ) ;
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPrivatePhoto ) . exists , {
timeout : 5000 ,
} )
. ok ( ) ;
2021-01-18 19:43:34 +00:00
await page . openNav ( ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( ".nav-browse + div" ) ) . click ( Selector ( ".nav-review" ) ) ;
} else {
await t . click ( Selector ( ".nav-review" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstReviewPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
}
) ;
test . meta ( "testID" , "photos-007" ) ( "Edit photo/video" , async ( t ) => {
await page . openNav ( ) ;
2021-01-18 19:43:34 +00:00
await t . click ( Selector ( ".nav-browse" ) ) ;
2021-01-15 16:02:39 +00:00
await page . setFilter ( "view" , "Cards" ) ;
2021-01-25 13:58:03 +00:00
const FirstPhoto = await Selector ( "div.is-photo.type-image" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-15 16:02:39 +00:00
await t
. click ( Selector ( "button.action-title-edit" ) . withAttribute ( "data-uid" , FirstPhoto ) )
. expect ( Selector ( 'input[aria-label="Latitude"]' ) . visible )
2021-01-25 13:58:03 +00:00
. ok ( ) ;
2021-01-15 16:02:39 +00:00
await t . click ( Selector ( "button.action-next" ) ) ;
await t
. expect ( Selector ( "button.action-previous" ) . getAttribute ( "disabled" ) )
. notEql ( "disabled" )
. click ( Selector ( "button.action-previous" ) )
. click ( Selector ( "button.action-close" ) )
. click ( Selector ( "div.is-photo" ) . withAttribute ( "data-uid" , FirstPhoto ) )
. expect ( Selector ( "#p-photo-viewer" ) . visible )
. ok ( )
. hover ( Selector ( ".action-edit" ) )
. click ( Selector ( ".action-edit" ) )
. expect ( Selector ( 'input[aria-label="Latitude"]' ) . visible )
. ok ( ) ;
const FirstPhotoTitle = await Selector ( ".input-title input" ) . value ;
const FirstPhotoLocalTime = await Selector ( ".input-local-time input" ) . value ;
const FirstPhotoUTCTime = await Selector ( ".input-utc-time input" ) . value ;
const FirstPhotoDay = await Selector ( ".input-day input" ) . value ;
const FirstPhotoMonth = await Selector ( ".input-month input" ) . value ;
const FirstPhotoYear = await Selector ( ".input-year input" ) . value ;
const FirstPhotoTimezone = await Selector ( ".input-timezone input" ) . value ;
const FirstPhotoLatitude = await Selector ( ".input-latitude input" ) . value ;
const FirstPhotoLongitude = await Selector ( ".input-longitude input" ) . value ;
const FirstPhotoAltitude = await Selector ( ".input-altitude input" ) . value ;
const FirstPhotoCountry = await Selector ( ".input-country input" ) . value ;
const FirstPhotoCamera = await Selector ( "div.p-camera-select div.v-select__selection" ) . innerText ;
const FirstPhotoIso = await Selector ( ".input-iso input" ) . value ;
const FirstPhotoExposure = await Selector ( ".input-exposure input" ) . value ;
const FirstPhotoLens = await Selector ( "div.p-lens-select div.v-select__selection" ) . innerText ;
const FirstPhotoFnumber = await Selector ( ".input-fnumber input" ) . value ;
const FirstPhotoFocalLength = await Selector ( ".input-focal-length input" ) . value ;
const FirstPhotoSubject = await Selector ( ".input-subject textarea" ) . value ;
const FirstPhotoArtist = await Selector ( ".input-artist input" ) . value ;
const FirstPhotoCopyright = await Selector ( ".input-copyright input" ) . value ;
const FirstPhotoLicense = await Selector ( ".input-license textarea" ) . value ;
const FirstPhotoDescription = await Selector ( ".input-description textarea" ) . value ;
const FirstPhotoKeywords = await Selector ( ".input-keywords textarea" ) . value ;
const FirstPhotoNotes = await Selector ( ".input-notes textarea" ) . value ;
await t
. typeText ( Selector ( ".input-title input" ) , "Not saved photo title" , { replace : true } )
. click ( Selector ( "button.action-close" ) )
. click ( Selector ( "button.action-date-edit" ) . withAttribute ( "data-uid" , FirstPhoto ) )
. expect ( Selector ( ".input-title input" ) . value )
. eql ( FirstPhotoTitle )
. typeText ( Selector ( ".input-title input" ) , "New Photo Title" , { replace : true } )
. typeText ( Selector ( ".input-timezone input" ) , "Europe/Mosc" , { replace : true } )
. click ( Selector ( "div" ) . withText ( "Europe/Moscow" ) . parent ( 'div[role="listitem"]' ) )
. typeText ( Selector ( ".input-day input" ) , "15" , { replace : true } )
. pressKey ( "enter" )
. typeText ( Selector ( ".input-month input" ) , "07" , { replace : true } )
. pressKey ( "enter" )
. typeText ( Selector ( ".input-year input" ) , "2019" , { replace : true } )
. click ( Selector ( "div" ) . withText ( "2019" ) . parent ( 'div[role="listitem"]' ) )
. click ( Selector ( ".input-local-time input" ) )
. pressKey ( "ctrl+a delete" )
. typeText ( Selector ( ".input-local-time input" ) , "04:30:30" , { replace : true } )
. pressKey ( "enter" )
. typeText ( Selector ( ".input-altitude input" ) , "-1" , { replace : true } )
. typeText ( Selector ( ".input-latitude input" ) , "41.15333" , { replace : true } )
. typeText ( Selector ( ".input-longitude input" ) , "20.168331" , { replace : true } )
//.click(Selector('.input-camera input'))
//.hover(Selector('div').withText('Apple iPhone 6').parent('div[role="listitem"]'))
//.click(Selector('div').withText('Apple iPhone 6').parent('div[role="listitem"]'))
//.click(Selector('.input-lens input'))
//.click(Selector('div').withText('Apple iPhone 5s back camera 4.15mm f/2.2').parent('div[role="listitem"]'))
. typeText ( Selector ( ".input-iso input" ) , "32" , { replace : true } )
. typeText ( Selector ( ".input-exposure input" ) , "1/32" , { replace : true } )
. typeText ( Selector ( ".input-fnumber input" ) , "29" , { replace : true } )
. typeText ( Selector ( ".input-focal-length input" ) , "33" , { replace : true } )
. typeText ( Selector ( ".input-subject textarea" ) , "Super nice edited photo" , { replace : true } )
. typeText ( Selector ( ".input-artist input" ) , "Happy" , { replace : true } )
. typeText ( Selector ( ".input-copyright input" ) , "Happy2020" , { replace : true } )
. typeText ( Selector ( ".input-license textarea" ) , "Super nice cat license" , { replace : true } )
. typeText ( Selector ( ".input-description textarea" ) , "Description of a nice image :)" , {
replace : true ,
} )
. typeText ( Selector ( ".input-keywords textarea" ) , ", cat, love" )
. typeText ( Selector ( ".input-notes textarea" ) , "Some notes" , { replace : true } )
. click ( Selector ( "button.action-approve" ) ) ;
2021-01-19 17:20:10 +00:00
await t . expect ( Selector ( ".input-latitude input" ) . visible , { timeout : 5000 } ) . ok ( ) ;
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( "button.action-apply" ) ) . click ( Selector ( "button.action-close" ) ) ;
} else {
await t . click ( Selector ( "button.action-done" , { timeout : 5000 } ) ) ;
}
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
await t
. expect ( Selector ( "button.action-title-edit" ) . withAttribute ( "data-uid" , FirstPhoto ) . innerText )
. eql ( "New Photo Title" ) ;
await page . selectPhotoFromUID ( FirstPhoto ) ;
await page . editSelected ( ) ;
await t
. expect ( Selector ( ".input-title input" ) . value )
. eql ( "New Photo Title" )
. expect ( Selector ( ".input-timezone input" ) . value )
. eql ( "Europe/Moscow" )
. expect ( Selector ( ".input-local-time input" ) . value )
. eql ( "04:30:30" )
. expect ( Selector ( ".input-utc-time input" ) . value )
. eql ( "01:30:30" )
. expect ( Selector ( ".input-day input" ) . value )
. eql ( "15" )
. expect ( Selector ( ".input-month input" ) . value )
. eql ( "07" )
. expect ( Selector ( ".input-year input" ) . value )
. eql ( "2019" )
. expect ( Selector ( ".input-altitude input" ) . value )
. eql ( "-1" )
. expect ( Selector ( "div" ) . withText ( "Albania" ) . visible )
. ok ( )
//.expect(Selector('div').withText('Apple iPhone 6').visible).ok()
//.expect(Selector('div').withText('Apple iPhone 5s back camera 4.15mm f/2.2').visible).ok()
. expect ( Selector ( ".input-iso input" ) . value )
. eql ( "32" )
. expect ( Selector ( ".input-exposure input" ) . value )
. eql ( "1/32" )
. expect ( Selector ( ".input-fnumber input" ) . value )
. eql ( "29" )
. expect ( Selector ( ".input-focal-length input" ) . value )
. eql ( "33" )
. expect ( Selector ( ".input-subject textarea" ) . value )
. eql ( "Super nice edited photo" )
. expect ( Selector ( ".input-artist input" ) . value )
. eql ( "Happy" )
. expect ( Selector ( ".input-copyright input" ) . value )
. eql ( "Happy2020" )
. expect ( Selector ( ".input-license textarea" ) . value )
. eql ( "Super nice cat license" )
. expect ( Selector ( ".input-description textarea" ) . value )
. eql ( "Description of a nice image :)" )
. expect ( Selector ( ".input-description textarea" ) . value )
. eql ( "Description of a nice image :)" )
. expect ( Selector ( ".input-notes textarea" ) . value )
. contains ( "Some notes" )
. expect ( Selector ( ".input-keywords textarea" ) . value )
. contains ( "cat" ) ;
if ( FirstPhotoTitle . empty || FirstPhotoTitle === "" ) {
await t . click ( Selector ( ".input-title input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-title input" ) , FirstPhotoTitle , { replace : true } ) ;
}
await t
. typeText ( Selector ( ".input-day input" ) , FirstPhotoDay , { replace : true } )
. pressKey ( "enter" )
. typeText ( Selector ( ".input-month input" ) , FirstPhotoMonth , { replace : true } )
. pressKey ( "enter" )
. typeText ( Selector ( ".input-year input" ) , FirstPhotoYear , { replace : true } )
. pressKey ( "enter" ) ;
if ( FirstPhotoLocalTime . empty || FirstPhotoLocalTime === "" ) {
await t . click ( Selector ( ".input-local-time input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t
. click ( Selector ( ".input-local-time input" ) )
. pressKey ( "ctrl+a delete" )
. typeText ( Selector ( ".input-local-time input" ) , FirstPhotoLocalTime , { replace : true } )
. pressKey ( "enter" ) ;
}
if ( FirstPhotoTimezone . empty || FirstPhotoTimezone === "" ) {
await t
. click ( Selector ( ".input-timezone input" ) )
. typeText ( Selector ( ".input-timezone input" ) , "UTC" , { replace : true } )
. pressKey ( "enter" ) ;
} else {
await t
. typeText ( Selector ( ".input-timezone input" ) , FirstPhotoTimezone , { replace : true } )
. pressKey ( "enter" ) ;
}
if ( FirstPhotoLatitude . empty || FirstPhotoLatitude === "" ) {
await t . click ( Selector ( ".input-latitude input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-latitude input" ) , FirstPhotoLatitude , { replace : true } ) ;
}
if ( FirstPhotoLongitude . empty || FirstPhotoLongitude === "" ) {
await t . click ( Selector ( ".input-longitude input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-longitude input" ) , FirstPhotoLongitude , { replace : true } ) ;
}
if ( FirstPhotoAltitude . empty || FirstPhotoAltitude === "" ) {
await t . click ( Selector ( ".input-altitude input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-altitude input" ) , FirstPhotoAltitude , { replace : true } ) ;
}
if ( FirstPhotoCountry . empty || FirstPhotoCountry === "" ) {
await t . click ( Selector ( ".input-longitude input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t
. click ( Selector ( ".input-country input" ) )
. pressKey ( "ctrl+a delete" )
. typeText ( Selector ( ".input-country input" ) , FirstPhotoCountry , { replace : true } )
. pressKey ( "enter" ) ;
}
// if (FirstPhotoCamera.empty || FirstPhotoCamera === "")
//{ await t
//.click(Selector('.input-camera input'))
// .hover(Selector('div').withText('Unknown').parent('div[role="listitem"]'))
// .click(Selector('div').withText('Unknown').parent('div[role="listitem"]'))}
//else
//{await t
// .click(Selector('.input-camera input'))
// .hover(Selector('div').withText(FirstPhotoCamera).parent('div[role="listitem"]'))
// .click(Selector('div').withText(FirstPhotoCamera).parent('div[role="listitem"]'))}
//if (FirstPhotoLens.empty || FirstPhotoLens === "")
//{ await t
// .click(Selector('.input-lens input'))
// .click(Selector('div').withText('Unknown').parent('div[role="listitem"]'))}
//else
//{await t
// .click(Selector('.input-lens input'))
// .click(Selector('div').withText(FirstPhotoLens).parent('div[role="listitem"]'))}
if ( FirstPhotoIso . empty || FirstPhotoIso === "" ) {
await t . click ( Selector ( ".input-iso input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-iso input" ) , FirstPhotoIso , { replace : true } ) ;
}
if ( FirstPhotoExposure . empty || FirstPhotoExposure === "" ) {
await t . click ( Selector ( ".input-exposure input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-exposure input" ) , FirstPhotoExposure , { replace : true } ) ;
}
if ( FirstPhotoFnumber . empty || FirstPhotoFnumber === "" ) {
await t . click ( Selector ( ".input-fnumber input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-fnumber input" ) , FirstPhotoFnumber , { replace : true } ) ;
}
if ( FirstPhotoFocalLength . empty || FirstPhotoFocalLength === "" ) {
await t . click ( Selector ( ".input-focal-length input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-focal-length input" ) , FirstPhotoFocalLength , {
replace : true ,
} ) ;
}
if ( FirstPhotoSubject . empty || FirstPhotoSubject === "" ) {
await t . click ( Selector ( ".input-subject textarea" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-subject textarea" ) , FirstPhotoSubject , { replace : true } ) ;
}
if ( FirstPhotoArtist . empty || FirstPhotoSubject === "" ) {
await t . click ( Selector ( ".input-artist input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-artist input" ) , FirstPhotoArtist , { replace : true } ) ;
}
if ( FirstPhotoCopyright . empty || FirstPhotoCopyright === "" ) {
await t . click ( Selector ( ".input-copyright input" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-copyright input" ) , FirstPhotoCopyright , { replace : true } ) ;
}
if ( FirstPhotoLicense . empty || FirstPhotoLicense === "" ) {
await t . click ( Selector ( ".input-license textarea" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-license textarea" ) , FirstPhotoLicense , { replace : true } ) ;
}
if ( FirstPhotoDescription . empty || FirstPhotoDescription === "" ) {
await t . click ( Selector ( ".input-description textarea" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-description textarea" ) , FirstPhotoDescription , {
replace : true ,
} ) ;
}
if ( FirstPhotoKeywords . empty || FirstPhotoKeywords === "" ) {
await t . click ( Selector ( ".input-keywords textarea" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-keywords textarea" ) , FirstPhotoKeywords , { replace : true } ) ;
}
if ( FirstPhotoNotes . empty || FirstPhotoNotes === "" ) {
await t . click ( Selector ( ".input-notes textarea" ) ) . pressKey ( "ctrl+a delete" ) ;
} else {
await t . typeText ( Selector ( ".input-notes textarea" ) , FirstPhotoNotes , { replace : true } ) ;
}
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . click ( Selector ( "button.action-apply" ) ) . click ( Selector ( "button.action-close" ) ) ;
} else {
await t . click ( Selector ( "button.action-done" , { timeout : 5000 } ) ) ;
}
2021-01-15 16:02:39 +00:00
const clipboardCount = await Selector ( "span.count-clipboard" , { timeout : 5000 } ) ;
await t
. expect ( clipboardCount . textContent )
. eql ( "1" )
. click ( Selector ( ".action-clear" ) )
. expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2020-10-20 16:10:38 +00:00
} ) ;
2020-05-28 08:01:11 +00:00
2021-01-15 16:02:39 +00:00
test . meta ( "testID" , "photos-008" ) ( "Change primary file" , async ( t ) => {
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) . click ( Selector ( ".p-expand-search" ) ) ;
await page . search ( "ski" ) ;
const SequentialPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await t . expect ( Selector ( ".input-open" ) . visible ) . ok ( ) ;
if ( t . browser . platform === "desktop" ) {
console . log ( t . browser . platform ) ;
await t
. click ( Selector ( ".input-open" ) )
. click ( Selector ( ".action-next" , { timeout : 5000 } ) )
. click ( Selector ( ".action-previous" ) )
. click ( Selector ( ".action-close" ) ) ;
}
await page . setFilter ( "view" , "Cards" ) ;
2021-01-15 16:02:39 +00:00
await t
. click ( Selector ( "button.action-title-edit" ) . withAttribute ( "data-uid" , SequentialPhoto ) )
. click ( Selector ( "#tab-files" ) ) ;
const FirstFile = await Selector ( "div.caption" ) . nth ( 0 ) . innerText ;
await t
. expect ( FirstFile )
. contains ( "photos8_1_ski.jpg" )
. click ( Selector ( "li.v-expansion-panel__container" ) . nth ( 1 ) )
. click ( Selector ( ".action-primary" ) )
. click ( Selector ( "button.action-close" ) )
. click ( Selector ( "button.action-title-edit" ) . withAttribute ( "data-uid" , SequentialPhoto ) ) ;
const FirstFileAfterChange = await Selector ( "div.caption" ) . nth ( 0 ) . innerText ;
await t
. expect ( FirstFileAfterChange )
. notContains ( "photos8_1_ski.jpg" )
. expect ( FirstFileAfterChange )
. contains ( "photos8_2_ski.jpg" ) ;
2020-05-31 17:31:48 +00:00
} ) ;
2020-05-28 08:01:11 +00:00
2021-01-15 16:02:39 +00:00
test . meta ( "testID" , "photos-009" ) ( "Navigate from card view to place" , async ( t ) => {
await page . setFilter ( "view" , "Cards" ) ;
await t
. click ( Selector ( "button.action-location" ) . nth ( 0 ) )
. expect ( Selector ( "#map" ) . exists , { timeout : 15000 } )
. ok ( )
. expect ( Selector ( "div.p-map-control" ) . visible )
. ok ( )
. expect ( Selector ( ".input-search input" ) . value )
. notEql ( "" ) ;
2020-05-31 17:31:48 +00:00
} ) ;
2020-05-28 08:01:11 +00:00
2021-01-15 16:02:39 +00:00
test . meta ( "testID" , "photos-010" ) ( "Ungroup files" , async ( t ) => {
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) . click ( Selector ( ".p-expand-search" ) ) ;
await page . search ( "group" ) ;
2021-01-18 19:43:34 +00:00
await page . setFilter ( "view" , "Cards" ) ;
2021-01-15 16:02:39 +00:00
const PhotoCount = await Selector ( "button.action-title-edit" , { timeout : 5000 } ) . count ;
const SequentialPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
2021-01-18 19:43:34 +00:00
await t . expect ( PhotoCount ) . eql ( 1 ) ;
await page . openNav ( ) ;
2021-01-15 16:02:39 +00:00
await t
. click ( Selector ( "div.nav-browse + div" ) )
. click ( Selector ( ".nav-stacks" ) )
. expect ( Selector ( ".input-open" ) . visible )
. ok ( )
. click ( Selector ( "button.action-title-edit" ) . withAttribute ( "data-uid" , SequentialPhoto ) )
. click ( Selector ( "#tab-files" ) )
. click ( Selector ( "li.v-expansion-panel__container" ) . nth ( 1 ) )
. click ( Selector ( ".action-unstack" ) )
. wait ( 12000 )
2021-01-18 19:43:34 +00:00
. click ( Selector ( "button.action-close" ) ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) . click ( Selector ( ".p-expand-search" ) ) ;
2021-01-15 16:02:39 +00:00
await page . search ( "group" ) ;
2021-01-19 17:20:10 +00:00
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
2021-01-15 16:02:39 +00:00
const PhotoCountAfterUngroup = await Selector ( "button.action-title-edit" , { timeout : 5000 } )
. count ;
await t . expect ( PhotoCountAfterUngroup ) . eql ( 2 ) ;
2020-07-07 07:48:21 +00:00
} ) ;
2021-01-13 15:56:45 +00:00
2021-01-25 13:58:03 +00:00
test . skip . meta ( "testID" , "photos-011" ) ( "Delete non primary file" , async ( t ) => {
2021-01-15 16:02:39 +00:00
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-library" ) )
. click ( Selector ( "#tab-library-import" ) )
. click ( Selector ( ".input-import-folder input" ) , { timeout : 5000 } )
. click ( Selector ( "div.v-list__tile__title" ) . withText ( "/pizza" ) )
. click ( Selector ( ".action-import" ) )
2021-01-18 19:43:34 +00:00
. wait ( 10000 ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) . click ( Selector ( ".p-expand-search" ) ) ;
2021-01-15 16:02:39 +00:00
await page . search ( "mogale" ) ;
2021-01-18 19:43:34 +00:00
await page . setFilter ( "view" , "Cards" ) ;
2021-01-15 16:02:39 +00:00
const PhotoCount = await Selector ( "button.action-title-edit" , { timeout : 5000 } ) . count ;
const Photo = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await t
. expect ( PhotoCount )
. eql ( 1 )
. click ( Selector ( "button.action-title-edit" ) . withAttribute ( "data-uid" , Photo ) )
. click ( Selector ( "#tab-files" ) ) ;
const FileCount = await Selector ( "li.v-expansion-panel__container" , { timeout : 5000 } ) . count ;
await t
. expect ( FileCount )
. eql ( 2 )
. click ( Selector ( "li.v-expansion-panel__container" ) . nth ( 1 ) )
. click ( Selector ( ".action-delete" ) )
. click ( Selector ( ".action-confirm" ) )
. wait ( 10000 ) ;
const FileCountAfterDeletion = await Selector ( "li.v-expansion-panel__container" , {
timeout : 5000 ,
} ) . count ;
await t . expect ( FileCountAfterDeletion ) . eql ( 1 ) ;
2021-01-20 16:13:42 +00:00
} ) ;
test . meta ( "testID" , "photos-012" ) ( "Mark photos/videos as panorama/scan" , async ( t ) => {
await page . openNav ( ) ;
await page . search ( "photo:true" ) ;
const FirstPhoto = await Selector ( "div.is-photo.type-image" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . search ( "video:true" ) ;
const FirstVideo = await Selector ( "div.is-photo" ) . nth ( 1 ) . getAttribute ( "data-uid" ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
if ( t . browser . platform === "mobile" ) {
await page . openNav ( ) ;
}
await t
. click ( Selector ( ".nav-panoramas" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse" ) ) ;
await page . selectPhotoFromUID ( FirstPhoto ) ;
await page . editSelected ( ) ;
await page . turnSwitchOn ( "scan" ) ;
await page . turnSwitchOn ( "panorama" ) ;
await t . click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
await page . selectPhotoFromUID ( FirstVideo ) ;
await page . editSelected ( ) ;
await page . turnSwitchOn ( "panorama" ) ;
await t . click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
await t . expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. ok ( ) ;
if ( t . browser . platform === "mobile" ) {
await page . openNav ( ) ;
}
await t
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
if ( t . browser . platform === "mobile" ) {
await page . openNav ( ) ;
}
await t
. click ( Selector ( ".nav-panoramas" ) )
await page . selectPhotoFromUID ( FirstPhoto ) ;
await page . editSelected ( ) ;
await page . turnSwitchOff ( "panorama" ) ;
await page . turnSwitchOff ( "scan" ) ;
await t . click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
await page . selectPhotoFromUID ( FirstVideo ) ;
await page . editSelected ( ) ;
await page . turnSwitchOff ( "panorama" ) ;
await t . click ( Selector ( ".action-close" ) ) ;
await page . clearSelection ( ) ;
if ( t . browser . platform === "mobile" ) {
await t . eval ( ( ) => location . reload ( ) ) ;
} else {
await t . click ( Selector ( "button.action-reload" ) ) ;
}
await t . expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
if ( t . browser . platform === "mobile" ) {
await page . openNav ( ) ;
await t . click ( Selector ( ".nav-browse + div" ) ) ;
}
await t
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FirstVideo ) . exists , { timeout : 5000 } )
. notOk ( ) ;
2021-01-25 18:12:25 +00:00
} ) ;
2021-01-25 13:58:03 +00:00
test . meta ( "testID" , "photos-013" ) ( "Check that archived files are not shown in monochrome/panoramas/stacks/scans/review/albums/favorites/private/videos/calendar/moments/states/labels/folders/originals" ,
//TODO only select the not yet selected
async ( t ) => {
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-archive" ) ) ;
const InitialPhotoCountInArchive = await Selector ( "div.is-photo" ) . count ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-monochrome" ) ) ;
const MonochromePhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( MonochromePhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-panoramas" ) ) ;
const PanoramaPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( PanoramaPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-stacks" ) ) ;
const StackedPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( StackedPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-scans" ) ) ;
const ScannedPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( ScannedPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-review" ) ) ;
const ReviewPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( ReviewPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) ) ;
const FavoritesPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( FavoritesPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) ) ;
const PrivatePhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( PrivatePhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-video" ) ) ;
const Video = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( Video ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-calendar" ) ) ;
await page . search ( "January 2017" )
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const CalendarPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( CalendarPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-moments" ) )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const MomentPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( MomentPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-places + div" ) )
. click ( Selector ( ".nav-states" ) ) ;
await page . search ( "Western Cape" )
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const StatesPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( StatesPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-labels" ) ) ;
await page . search ( "Seashore" )
await t
. click ( Selector ( "a.is-label" ) . nth ( 0 ) ) ;
const LabelPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( LabelPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-folders" ) ) ;
await page . search ( "archive" )
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const FolderPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( FolderPhoto ) ;
await page . archiveSelected ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-archive" ) ) ;
const PhotoCountInArchiveAfterArchive = await Selector ( "div.is-photo" ) . count ;
await t . expect ( PhotoCountInArchiveAfterArchive ) . eql ( InitialPhotoCountInArchive + 13 ) ;
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-monochrome" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MonochromePhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-panoramas" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , PanoramaPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-stacks" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StackedPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ScannedPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-review" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ReviewPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FavoritesPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , PrivatePhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-video" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , Video ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await t
. navigateTo ( "/calendar/aqmxlr71p6zo22dk/january-2017" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , CalendarPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-moments" ) )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MomentPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await t
. navigateTo ( "/states/aqmxlr71tebcohrw/western-cape-south-africa" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StatesPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. navigateTo ( "/all?q=label%3Aseashore" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , LabelPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. navigateTo ( "/folders/aqnah1321mgkt1w2/archive" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FolderPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-archive" ) ) ;
await page . setFilter ( "view" , "Cards" ) ;
await page . selectPhotoFromUID ( MonochromePhoto ) ;
await page . selectPhotoFromUID ( PanoramaPhoto ) ;
await page . selectPhotoFromUID ( StackedPhoto ) ;
await page . selectPhotoFromUID ( ScannedPhoto ) ;
await page . selectPhotoFromUID ( ReviewPhoto ) ;
await page . selectPhotoFromUID ( FavoritesPhoto ) ;
await page . selectPhotoFromUID ( PrivatePhoto ) ;
await page . selectPhotoFromUID ( Video ) ;
await page . selectPhotoFromUID ( CalendarPhoto ) ;
await page . selectPhotoFromUID ( MomentPhoto ) ;
await page . selectPhotoFromUID ( StatesPhoto ) ;
await page . selectPhotoFromUID ( LabelPhoto ) ;
await page . selectPhotoFromUID ( FolderPhoto ) ;
await page . restoreSelected ( )
const PhotoCountInArchiveAfterRestore = await Selector ( "div.is-photo" ) . count ;
await t . expect ( PhotoCountInArchiveAfterRestore ) . eql ( InitialPhotoCountInArchive ) ;
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-monochrome" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MonochromePhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-panoramas" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , PanoramaPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-stacks" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StackedPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ScannedPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-review" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ReviewPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FavoritesPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , PrivatePhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-video" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , Video ) . exists , { timeout : 5000 } )
. ok ( ) ;
await t
. navigateTo ( "/calendar/aqmxlr71p6zo22dk/january-2017" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , CalendarPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-moments" ) )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MomentPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await t
. navigateTo ( "/states/aqmxlr71tebcohrw/western-cape-south-africa" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StatesPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. navigateTo ( "/all?q=label%3Aseashore" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , LabelPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. navigateTo ( "/folders/aqnah1321mgkt1w2/archive" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FolderPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
}
) ;
test . meta ( "testID" , "photos-014" ) ( "Check that private files are not shown in monochrome/panoramas/stacks/scans/review/albums/favorites/archive/videos/calendar/moments/states/labels/folders/originals" ,
//TODO only select the not yet selected
//TODO should not appear in shared albums
async ( t ) => {
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) ) ;
const InitialPhotoCountInPrivate = await Selector ( "div.is-photo" ) . count ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-monochrome" ) ) ;
const MonochromePhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( MonochromePhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-panoramas" ) ) ;
const PanoramaPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( PanoramaPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-stacks" ) ) ;
const StackedPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( StackedPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-scans" ) ) ;
const ScannedPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( ScannedPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-review" ) ) ;
const ReviewPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( ReviewPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-albums" ) ) ;
await page . search ( "Holiday" ) ;
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const AlbumPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( AlbumPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) ) ;
const FavoritesPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( FavoritesPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-video" ) ) ;
const Video = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( Video ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-calendar" ) ) ;
await page . search ( "January 2017" )
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const CalendarPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( CalendarPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-moments" ) )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const MomentPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( MomentPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-places + div" ) )
. click ( Selector ( ".nav-states" ) ) ;
await page . search ( "Western Cape" )
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const StatesPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( StatesPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-labels" ) ) ;
await page . search ( "Seashore" )
await t
. click ( Selector ( "a.is-label" ) . nth ( 0 ) ) ;
const LabelPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( LabelPhoto ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-folders" ) ) ;
await page . search ( "archive" )
await t
. click ( Selector ( "a.is-album" ) . nth ( 0 ) ) ;
const FolderPhoto = await Selector ( "div.is-photo" ) . nth ( 0 ) . getAttribute ( "data-uid" ) ;
await page . selectPhotoFromUID ( FolderPhoto ) ;
await page . privateSelected ( )
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) ) ;
const PhotoCountInPrivateAfterPrivate = await Selector ( "div.is-photo" ) . count ;
await t . expect ( PhotoCountInPrivateAfterPrivate ) . eql ( InitialPhotoCountInPrivate + 13 ) ;
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-monochrome" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MonochromePhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-panoramas" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , PanoramaPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-stacks" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StackedPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ScannedPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-review" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ReviewPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. navigateTo ( "/albums?q=Holiday" )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , AlbumPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FavoritesPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-video" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , Video ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await t
. navigateTo ( "/calendar/aqmxlr71p6zo22dk/january-2017" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , CalendarPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-moments" ) )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MomentPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await t
. navigateTo ( "/states/aqmxlr71tebcohrw/western-cape-south-africa" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StatesPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. navigateTo ( "/all?q=label%3Aseashore" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , LabelPhoto ) . exists , { timeout : 5000 } )
. notOk ( )
. navigateTo ( "/folders/aqnah1321mgkt1w2/archive" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FolderPhoto ) . exists , { timeout : 5000 } )
. notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) ) ;
await page . setFilter ( "view" , "Cards" ) ;
await page . selectPhotoFromUID ( MonochromePhoto ) ;
await page . selectPhotoFromUID ( PanoramaPhoto ) ;
await page . selectPhotoFromUID ( StackedPhoto ) ;
await page . selectPhotoFromUID ( ScannedPhoto ) ;
await page . selectPhotoFromUID ( ReviewPhoto ) ;
await page . selectPhotoFromUID ( AlbumPhoto ) ;
await page . selectPhotoFromUID ( FavoritesPhoto ) ;
await page . selectPhotoFromUID ( Video ) ;
await page . selectPhotoFromUID ( CalendarPhoto ) ;
await page . selectPhotoFromUID ( MomentPhoto ) ;
await page . selectPhotoFromUID ( StatesPhoto ) ;
await page . selectPhotoFromUID ( LabelPhoto ) ;
await page . selectPhotoFromUID ( FolderPhoto ) ;
await page . privateSelected ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-private" ) ) ;
const PhotoCountInPrivateAfterUnprivate = await Selector ( "div.is-photo" ) . count ;
await t . expect ( PhotoCountInPrivateAfterUnprivate ) . eql ( InitialPhotoCountInPrivate ) ;
await t . expect ( Selector ( "button.action-menu" ) . exists , { timeout : 5000 } ) . notOk ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-browse + div" ) )
. click ( Selector ( ".nav-monochrome" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MonochromePhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-panoramas" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , PanoramaPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-stacks" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StackedPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-scans" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ScannedPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-review" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , ReviewPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. navigateTo ( "/albums?q=Holiday" )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , AlbumPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-favorites" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FavoritesPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-video" ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , Video ) . exists , { timeout : 5000 } )
. ok ( ) ;
await t
. navigateTo ( "/calendar/aqmxlr71p6zo22dk/january-2017" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , CalendarPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await page . openNav ( ) ;
await t
. click ( Selector ( ".nav-moments" ) )
. click ( Selector ( "a.is-album" ) . nth ( 0 ) )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , MomentPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
await t
. navigateTo ( "/states/aqmxlr71tebcohrw/western-cape-south-africa" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , StatesPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. navigateTo ( "/all?q=label%3Aseashore" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , LabelPhoto ) . exists , { timeout : 5000 } )
. ok ( )
. navigateTo ( "/folders/aqnah1321mgkt1w2/archive" )
. expect ( Selector ( "div" ) . withAttribute ( "data-uid" , FolderPhoto ) . exists , { timeout : 5000 } )
. ok ( ) ;
}
) ;