2019-05-21 17:00:46 +02:00
|
|
|
import { Selector } from 'testcafe';
|
|
|
|
import testcafeconfig from './testcafeconfig';
|
|
|
|
import Page from "./page-model";
|
2020-05-28 10:01:11 +02:00
|
|
|
import { RequestLogger } from 'testcafe';
|
2020-05-31 19:31:48 +02:00
|
|
|
import { ClientFunction } from 'testcafe';
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-06-05 18:03:22 +02:00
|
|
|
const logger = RequestLogger( /http:\/\/localhost\/api\/v1\/photos*/ , {
|
2020-05-28 10:01:11 +02:00
|
|
|
logResponseHeaders: true,
|
|
|
|
logResponseBody: true
|
|
|
|
});
|
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
const scroll = ClientFunction((x, y) => window.scrollTo(x, y));
|
|
|
|
const getcurrentPosition = ClientFunction(() => window.pageYOffset);
|
|
|
|
|
2020-05-28 10:01:11 +02:00
|
|
|
fixture `Test photos`
|
|
|
|
.page`${testcafeconfig.url}`
|
|
|
|
.requestHooks(logger);
|
2019-05-21 17:00:46 +02:00
|
|
|
|
|
|
|
const page = new Page();
|
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
//TODO raw file icon? live photo icon? - search for type look for icon --> do it in search test
|
2020-06-04 18:25:29 +02:00
|
|
|
//TODO Share photo
|
2020-05-31 19:31:48 +02:00
|
|
|
//TODO Check count in navi gets updated --> gt/lt or matches count of images
|
|
|
|
//TODO videos - play video
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-10-20 18:10:38 +02:00
|
|
|
test('#1 Scroll to top', async t => {
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
await page.setFilter('view', 'Cards');
|
|
|
|
await t
|
|
|
|
.expect(Selector('button.p-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
|
2020-06-25 16:16:00 +02:00
|
|
|
.click(Selector('button.p-scroll-top'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(getcurrentPosition()).eql(0);
|
|
|
|
});
|
2019-06-20 16:17:43 +02:00
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
//TODO test download itself + clipboard count after download
|
|
|
|
test('#2 Download single photo/video and download zip using clipboard and fullscreen mode', async t => {
|
|
|
|
const FirstPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
const SecondPhoto = await Selector('div.p-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'));
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
2020-05-31 19:31:48 +02:00
|
|
|
const FirstVideo = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstVideo);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCount = await Selector('span.count-clipboard');
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(clipboardCount.textContent).eql("2")
|
2020-06-23 13:06:55 +02:00
|
|
|
.click(Selector('button.action-menu'))
|
|
|
|
.expect(Selector('button.action-download').visible).ok();
|
2020-05-31 19:31:48 +02:00
|
|
|
});
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-05-28 16:36:32 +02:00
|
|
|
//TODO add part for video as well
|
2020-06-23 13:06:55 +02:00
|
|
|
//TODO approve/archive from card view
|
2020-05-31 19:31:48 +02:00
|
|
|
test('#3 Approve photo using approve and by adding location', async t => {
|
2020-05-28 10:01:11 +02:00
|
|
|
await page.openNav();
|
2019-06-20 16:17:43 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('div.nav-photos + div'))
|
|
|
|
.click(Selector('.nav-review'));
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await page.search('type:image');
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request1 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
const FirstPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
2020-05-28 17:59:57 +02:00
|
|
|
const SecondPhoto = await Selector('div.p-photo').nth(1).getAttribute('data-uid');
|
2019-06-20 16:17:43 +02:00
|
|
|
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
|
|
|
//const request2 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).notOk()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondPhoto).exists, {timeout: 5000}).notOk();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-07-03 14:48:43 +02:00
|
|
|
await t.click(Selector('.nav-review'));
|
|
|
|
//const request3 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
|
|
|
await page.editSelected();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2019-05-21 17:00:46 +02:00
|
|
|
await t
|
2020-07-16 14:42:09 +02:00
|
|
|
.click(Selector('button.action-close'));
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
|
|
|
.click(Selector('button.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request4 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).visible, {timeout: 5000}).ok();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.editSelected();
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request5 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('button.action-approve'))
|
2020-07-16 14:42:09 +02:00
|
|
|
.click(Selector('button.action-done'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request6 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
2020-05-28 17:59:57 +02:00
|
|
|
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.unselectFromUID(FirstPhoto);
|
|
|
|
await page.selectFromUID(SecondPhoto);
|
|
|
|
await page.editSelected();
|
2020-05-28 17:59:57 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
|
|
|
.typeText(Selector('input[aria-label="Latitude"]'), '9.999')
|
|
|
|
.typeText(Selector('input[aria-label="Longitude"]'), '9.999')
|
2020-07-16 14:42:09 +02:00
|
|
|
.click(Selector('button.action-done'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request7 = await logger.requests[0].response.body;
|
2020-05-28 17:59:57 +02:00
|
|
|
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('button.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request8 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).notOk()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondPhoto).exists, {timeout: 5000}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
|
|
|
//const request9 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
|
|
|
await page.search('type:image');
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request10 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-05-28 17:59:57 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).visible).ok()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondPhoto).visible).ok();
|
|
|
|
});
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
test('#4 Like/dislike photo/video', async t => {
|
2020-05-28 16:36:32 +02:00
|
|
|
|
|
|
|
logger.clear();
|
2020-07-03 14:48:43 +02:00
|
|
|
const FirstPhoto = await Selector('i.t-off').nth(0).getAttribute('data-uid');
|
2020-05-28 17:59:57 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
await t.click(Selector('.nav-video'));
|
|
|
|
//const request1 = await logger.requests[0].response.body;
|
2020-05-28 17:59:57 +02:00
|
|
|
const FirstVideo = await Selector('.t-off').nth(0).getAttribute('data-uid');
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
await t.click(Selector('.nav-favorites'));
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).notOk()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
2020-05-28 17:59:57 +02:00
|
|
|
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-05-28 17:59:57 +02:00
|
|
|
await page.likePhoto(FirstPhoto);
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request2 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('.action-reload'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('i.t-on').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).ok();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
await t.click(Selector('.nav-video'));
|
2020-05-28 17:59:57 +02:00
|
|
|
await page.likePhoto(FirstVideo);
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request3 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('.action-reload'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('i.t-on').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).ok();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-favorites'));
|
|
|
|
//const request4 = await logger.requests[0].response.body;
|
2020-05-28 17:59:57 +02:00
|
|
|
logger.clear();
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).ok()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).ok()
|
2020-05-28 16:36:32 +02:00
|
|
|
.expect(Selector('div.v-image__image').visible).ok();
|
2020-05-28 17:59:57 +02:00
|
|
|
await page.dislikePhoto(FirstVideo);
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request5 = await logger.requests[0].response.body;
|
2020-05-28 17:59:57 +02:00
|
|
|
logger.clear();
|
2020-05-28 16:36:32 +02:00
|
|
|
await page.dislikePhoto(FirstPhoto);
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request6 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).notOk()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).notOk();
|
2020-05-28 10:01:11 +02:00
|
|
|
});
|
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
//TODO Check private photos do not appear in labels, places, albums, moments...
|
|
|
|
test('#5 Private/unprivate photo/video using clipboard and list', async t => {
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'))
|
2020-05-28 10:01:11 +02:00
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
logger.clear();
|
2020-05-31 19:31:48 +02:00
|
|
|
await page.setFilter('view', 'Mosaic');
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request1 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
const FirstPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
const SecondPhoto = await Selector('div.p-photo').nth(1).getAttribute('data-uid');
|
|
|
|
const ThirdPhoto = await Selector('div.p-photo').nth(2).getAttribute('data-uid');
|
2020-05-28 10:01:11 +02:00
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
|
|
|
//const request2 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
const FirstVideo = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
const SecondVideo = await Selector('div.p-photo').nth(1).getAttribute('data-uid');
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
await t.click(Selector('.nav-private'));
|
|
|
|
//const request3 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
|
|
|
await page.selectFromUID(SecondPhoto);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCount = await Selector('span.count-clipboard');
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(clipboardCount.textContent).eql("2")
|
2020-06-23 13:06:55 +02:00
|
|
|
.click(Selector('button.action-menu'))
|
|
|
|
.click(Selector('button.action-private'))
|
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-05-31 19:31:48 +02:00
|
|
|
await page.setFilter('view', 'List');
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request4 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('button.p-photo-private').withAttribute('data-uid', ThirdPhoto));
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request5 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
2020-05-28 10:01:11 +02:00
|
|
|
|
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('button.p-photo-private').withAttribute('data-uid', SecondVideo));
|
2020-05-31 19:31:48 +02:00
|
|
|
await page.setFilter('view', 'Mosaic');
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request6 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-05-28 16:36:32 +02:00
|
|
|
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstVideo);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCountVideo = await Selector('span.count-clipboard');
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(clipboardCountVideo.textContent).eql("1")
|
2020-06-23 13:06:55 +02:00
|
|
|
.click(Selector('button.action-menu'))
|
|
|
|
.click(Selector('button.action-private'))
|
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
|
|
|
.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request7 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).notOk()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondVideo).exists, {timeout: 5000}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-private'));
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request8 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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}).ok();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
|
|
|
await page.selectFromUID(SecondPhoto);
|
|
|
|
await page.selectFromUID(FirstVideo);
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-06-23 13:06:55 +02:00
|
|
|
.click(Selector('button.action-menu'))
|
|
|
|
.click(Selector('button.action-private'));
|
2020-05-31 19:31:48 +02:00
|
|
|
await page.setFilter('view', 'List');
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
|
|
|
.click(Selector('button.p-photo-private').withAttribute('data-uid', ThirdPhoto))
|
|
|
|
.click(Selector('button.p-photo-private').withAttribute('data-uid', SecondVideo));
|
2020-05-31 19:31:48 +02:00
|
|
|
await page.setFilter('view', 'Mosaic');
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request9 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request10 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
2020-05-28 16:36:32 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request11 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).ok()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondVideo).exists, {timeout: 5000}).ok();
|
2020-05-28 10:01:11 +02:00
|
|
|
});
|
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
test('#6 Archive/restore video, photos, private photos and review photos using clipboard', async t => {
|
2020-05-28 10:01:11 +02:00
|
|
|
await page.openNav();
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'))
|
2020-05-28 16:36:32 +02:00
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
logger.clear();
|
2020-05-31 19:31:48 +02:00
|
|
|
await page.setFilter('view', 'Mosaic');
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request1 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
const FirstPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
const SecondPhoto = await Selector('div.p-photo').nth(1).getAttribute('data-uid');
|
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
|
|
|
//const request2 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
const FirstVideo = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
logger.clear();
|
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-private'));
|
|
|
|
//const request3 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
const FirstPrivatePhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
logger.clear();
|
|
|
|
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('div.nav-photos + div'))
|
|
|
|
.click(Selector('.nav-review'));
|
|
|
|
//const request4 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
const FirstReviewPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
logger.clear();
|
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-archive'));
|
|
|
|
//const request5 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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();
|
2020-05-28 10:01:11 +02:00
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
|
|
|
//const request6 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstVideo);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCountVideo = await Selector('span.count-clipboard');
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(clipboardCountVideo.textContent).eql("1");
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.archiveSelected();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-06-23 13:06:55 +02:00
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk()
|
2020-05-28 10:01:11 +02:00
|
|
|
.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request7 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request8 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
|
|
|
await page.selectFromUID(SecondPhoto);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCountPhotos = await Selector('span.count-clipboard');
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(clipboardCountPhotos.textContent).eql("2");
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.archiveSelected();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-06-23 13:06:55 +02:00
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk()
|
2020-05-28 10:01:11 +02:00
|
|
|
.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request9 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).notOk()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondPhoto).exists, {timeout: 5000}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-private'));
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request10 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPrivatePhoto);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCountPrivate = await Selector('span.count-clipboard');
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(clipboardCountPrivate.textContent).eql("1");
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-review'));
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request11 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstReviewPhoto);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCountReview = await Selector('span.count-clipboard');
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(clipboardCountReview.textContent).eql("2");
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.archiveSelected();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-06-23 13:06:55 +02:00
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk()
|
2020-05-28 10:01:11 +02:00
|
|
|
.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request12 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstReviewPhoto).exists, {timeout: 5000}).notOk()
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-archive'));
|
|
|
|
//const request13 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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();
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
|
|
|
await page.selectFromUID(SecondPhoto);
|
|
|
|
await page.selectFromUID(FirstVideo);
|
|
|
|
await page.selectFromUID(FirstPrivatePhoto);
|
|
|
|
await page.selectFromUID(FirstReviewPhoto);
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCountArchive = await Selector('span.count-clipboard');
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(clipboardCountArchive.textContent).eql("5");
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.restoreSelected();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
2020-06-23 13:06:55 +02:00
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk()
|
2020-05-31 19:31:48 +02:00
|
|
|
.click(Selector('.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request14 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.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();
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
2020-05-28 16:36:32 +02:00
|
|
|
|
2020-05-28 10:01:11 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-video'));
|
|
|
|
//const request15 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstVideo).exists, {timeout: 5000}).ok();
|
2020-05-28 16:36:32 +02:00
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'));
|
|
|
|
//const request16 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPhoto).exists, {timeout: 5000}).ok()
|
|
|
|
.expect(Selector('div').withAttribute('data-uid', SecondPhoto).exists, {timeout: 5000}).ok();
|
2020-05-28 16:36:32 +02:00
|
|
|
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-private'));
|
|
|
|
//const request17 = await logger.requests[0].response.body;
|
2020-05-28 10:01:11 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstPrivatePhoto).exists, {timeout: 5000}).ok();
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-05-28 16:36:32 +02:00
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-review'));
|
|
|
|
//const request18 = await logger.requests[0].response.body;
|
2020-05-28 16:36:32 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-05-31 19:31:48 +02:00
|
|
|
.expect(Selector('div').withAttribute('data-uid', FirstReviewPhoto).exists, {timeout: 5000}).ok();
|
2020-10-20 18:10:38 +02:00
|
|
|
});
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
//TODO edited values stay after reindex!!
|
2020-07-06 10:57:20 +02:00
|
|
|
//TODO test camera, lens
|
2020-06-04 18:25:29 +02:00
|
|
|
//TODO access video from list + edit
|
2020-08-13 14:09:25 +02:00
|
|
|
//TODO Update country from coordinates
|
2020-05-31 19:31:48 +02:00
|
|
|
test('#7 Edit photo/video', async t => {
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
await page.setFilter('view', 'Cards');
|
|
|
|
const FirstPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
await t
|
|
|
|
.click(Selector('button.action-title-edit').withAttribute('data-uid', FirstPhoto))
|
|
|
|
.expect(Selector('input[aria-label="Latitude"]').visible).ok()
|
|
|
|
.expect(Selector('button.action-previous').getAttribute('disabled')).eql('disabled');
|
2020-08-13 14:09:25 +02:00
|
|
|
logger.clear();
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.click(Selector('button.action-next'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request1 = await logger.requests[0].response.body;
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(Selector('button.action-previous').getAttribute('disabled')).notEql('disabled')
|
|
|
|
.click(Selector('button.action-previous'))
|
2020-07-16 14:42:09 +02:00
|
|
|
.click(Selector('button.action-close'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.click(Selector('div.p-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);
|
2020-07-06 10:57:20 +02:00
|
|
|
const FirstPhotoDay = await (Selector('.input-day input').value);
|
|
|
|
const FirstPhotoMonth = await (Selector('.input-month input').value);
|
|
|
|
const FirstPhotoYear = await (Selector('.input-year input').value);
|
2020-05-31 19:31:48 +02:00
|
|
|
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);
|
2020-07-06 10:57:20 +02:00
|
|
|
const FirstPhotoCountry = await (Selector('.input-country input').value);
|
2020-05-31 19:31:48 +02:00
|
|
|
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);
|
|
|
|
|
|
|
|
logger.clear();
|
|
|
|
await t
|
2020-08-13 14:09:25 +02:00
|
|
|
.typeText(Selector('.input-title input'), 'Not saved photo title', {replace: true})
|
2020-05-31 19:31:48 +02:00
|
|
|
.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 })
|
2020-07-06 10:57:20 +02:00
|
|
|
.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')
|
2020-07-15 09:51:16 +02:00
|
|
|
.typeText(Selector('.input-month input'), '07', { replace: true })
|
|
|
|
.pressKey('enter')
|
2020-07-06 10:57:20 +02:00
|
|
|
.typeText(Selector('.input-year input'), 'Unknown', { replace: true })
|
|
|
|
.pressKey('enter')
|
2020-07-07 09:48:21 +02:00
|
|
|
.click(Selector('.input-local-time input'))
|
2020-07-06 10:57:20 +02:00
|
|
|
.pressKey('ctrl+a delete')
|
2020-07-07 09:48:21 +02:00
|
|
|
.typeText(Selector('.input-local-time input'), '04:30:30', { replace: true })
|
2020-07-06 10:57:20 +02:00
|
|
|
.pressKey('enter')
|
2020-08-13 14:09:25 +02:00
|
|
|
.typeText(Selector('.input-altitude input'), '-1', { replace: true })
|
2020-05-31 19:31:48 +02:00
|
|
|
.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'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request2 = await logger.requests[0].response.body;
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(Selector('.input-latitude input').visible, {timeout: 5000}).ok()
|
2020-07-16 14:42:09 +02:00
|
|
|
.click(Selector('button.action-done'));
|
2020-05-31 19:31:48 +02:00
|
|
|
logger.clear();
|
|
|
|
await t
|
|
|
|
.click(Selector('button.action-reload'));
|
2020-07-03 14:48:43 +02:00
|
|
|
//const request3 = await logger.requests[0].response.body;
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(Selector('button.action-title-edit').withAttribute('data-uid', FirstPhoto).innerText).eql('New Photo Title')
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-06-01 17:04:47 +02:00
|
|
|
await page.selectFromUID(FirstPhoto);
|
|
|
|
await page.editSelected();
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(Selector('.input-title input').value).eql('New Photo Title')
|
2020-07-06 10:57:20 +02:00
|
|
|
.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')
|
2020-07-15 09:51:16 +02:00
|
|
|
.expect(Selector('.input-month input').value).eql('07')
|
2020-07-06 10:57:20 +02:00
|
|
|
.expect(Selector('.input-year input').value).eql('Unknown')
|
2020-05-31 19:31:48 +02:00
|
|
|
.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')
|
2020-08-13 14:09:25 +02:00
|
|
|
/*.typeText(Selector('.input-latitude input'), '49.34035', { replace: true })
|
|
|
|
.typeText(Selector('.input-longitude input'), '-123.43104', { replace: true })
|
|
|
|
.click(Selector('button.action-approve'))
|
|
|
|
.click(Selector('button.action-done'));
|
|
|
|
await t
|
|
|
|
.click(Selector('button.action-reload'));
|
|
|
|
await t
|
|
|
|
.expect(Selector('button.action-title-edit').withAttribute('data-uid', FirstPhoto).innerText).eql('New Photo Title')
|
|
|
|
.click(Selector('button.action-date-edit').withAttribute('data-uid', FirstPhoto));
|
|
|
|
await t
|
|
|
|
.expect(Selector('div').withText('Canada').visible).ok()
|
|
|
|
.expect(Selector('div').withText('Albania').visible).notOk();*/
|
2020-05-31 19:31:48 +02:00
|
|
|
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 })}
|
2020-07-06 10:57:20 +02:00
|
|
|
await t.typeText(Selector('.input-day input'), FirstPhotoDay, { replace: true })
|
|
|
|
.pressKey('enter')
|
|
|
|
.typeText(Selector('.input-month input'), FirstPhotoMonth, { replace: true })
|
2020-07-15 09:51:16 +02:00
|
|
|
.pressKey('enter')
|
2020-07-06 10:57:20 +02:00
|
|
|
.typeText(Selector('.input-year input'), FirstPhotoYear, { replace: true })
|
|
|
|
.pressKey('enter');
|
2020-07-07 09:48:21 +02:00
|
|
|
if (FirstPhotoLocalTime.empty || FirstPhotoLocalTime === "")
|
2020-07-06 10:57:20 +02:00
|
|
|
{ await t
|
2020-07-07 09:48:21 +02:00
|
|
|
.click(Selector('.input-local-time input'))
|
2020-07-06 10:57:20 +02:00
|
|
|
.pressKey('ctrl+a delete')}
|
|
|
|
else
|
|
|
|
{await t
|
2020-07-07 09:48:21 +02:00
|
|
|
.click(Selector('.input-local-time input'))
|
2020-07-06 10:57:20 +02:00
|
|
|
.pressKey('ctrl+a delete')
|
2020-07-07 09:48:21 +02:00
|
|
|
.typeText(Selector('.input-local-time input'), FirstPhotoLocalTime, { replace: true })
|
2020-07-06 10:57:20 +02:00
|
|
|
.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')}
|
2020-05-31 19:31:48 +02:00
|
|
|
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 })}
|
2020-07-06 10:57:20 +02:00
|
|
|
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')}
|
2020-05-31 19:31:48 +02:00
|
|
|
// 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 })}
|
|
|
|
await t
|
2020-07-16 14:42:09 +02:00
|
|
|
.click(Selector('button.action-done'));
|
2020-06-23 13:06:55 +02:00
|
|
|
const clipboardCount = await Selector('span.count-clipboard');
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(clipboardCount.textContent).eql("1")
|
2020-06-23 13:06:55 +02:00
|
|
|
.click(Selector('.action-clear'))
|
|
|
|
.expect(Selector('button.action-menu').exists, {timeout: 5000}).notOk();
|
2020-05-31 19:31:48 +02:00
|
|
|
});
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
test('#8 Change primary file', async t => {
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
2020-07-03 14:48:43 +02:00
|
|
|
.click(Selector('.nav-photos'))
|
2020-05-31 19:31:48 +02:00
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
await page.search('ski');
|
|
|
|
const SequentialPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
2020-07-07 09:48:21 +02:00
|
|
|
|
2020-05-31 19:31:48 +02:00
|
|
|
await t
|
|
|
|
.expect(Selector('i.action-burst').visible).ok()
|
|
|
|
.click(Selector('i.action-burst'))
|
|
|
|
.click(Selector('.action-next'))
|
|
|
|
.click(Selector('.action-previous'))
|
|
|
|
.click(Selector('.action-close'));
|
|
|
|
await t
|
|
|
|
.click(Selector('button.action-title-edit').withAttribute('data-uid', SequentialPhoto))
|
2020-07-07 09:48:21 +02:00
|
|
|
.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 19:31:48 +02:00
|
|
|
});
|
2020-05-28 10:01:11 +02:00
|
|
|
|
2020-10-20 18:10:38 +02:00
|
|
|
test('#9 Navigate from card view to place', async t => {
|
2020-05-31 19:31:48 +02:00
|
|
|
await t.click(Selector('.p-expand-search'));
|
|
|
|
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()
|
2020-06-23 13:06:55 +02:00
|
|
|
.expect(Selector('.input-search input').value).notEql('');
|
2020-07-07 09:48:21 +02:00
|
|
|
});
|
|
|
|
//TODO remove wait
|
|
|
|
test('#10 Ungroup files', async t => {
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
|
|
|
.click(Selector('.nav-photos'))
|
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
await page.search('group');
|
|
|
|
const PhotoCount = await Selector('button.action-title-edit').count;
|
|
|
|
|
|
|
|
const SequentialPhoto = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
|
|
|
|
await t
|
|
|
|
.expect(PhotoCount).eql(1)
|
|
|
|
.click(Selector('div.nav-photos + div'))
|
|
|
|
.click(Selector('.nav-stacks'))
|
|
|
|
.expect(Selector('i.action-burst').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))
|
2020-07-13 15:59:54 +02:00
|
|
|
.click(Selector('.action-unstack'))
|
2020-07-15 09:51:16 +02:00
|
|
|
.wait(12000)
|
2020-07-07 09:48:21 +02:00
|
|
|
.click(Selector('button.action-close'))
|
|
|
|
.click(Selector('.nav-photos'))
|
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
await page.search('group');
|
|
|
|
await t
|
|
|
|
.click(Selector('.action-reload'));
|
|
|
|
const PhotoCountAfterUngroup = await Selector('button.action-title-edit').count;
|
|
|
|
await t
|
|
|
|
.expect(PhotoCountAfterUngroup).eql(2);
|
2020-10-20 18:10:38 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
test('#11 Delete non primary file', async t => {
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
|
|
|
.click(Selector('.nav-library'))
|
|
|
|
//TODO Connecting... error must be moved somewhere else
|
|
|
|
.click(Selector('#tab-import'))
|
|
|
|
.click(Selector('.input-import-folder input'), {timeout: 5000})
|
|
|
|
.click(Selector('div.v-list__tile__title').withText('/pizza'))
|
|
|
|
.click(Selector('.action-import'))
|
|
|
|
//TODO replace wait
|
|
|
|
.wait(30000)
|
|
|
|
.click(Selector('.nav-photos'))
|
|
|
|
.click(Selector('.p-expand-search'));
|
|
|
|
await page.search('mogale');
|
|
|
|
const PhotoCount = await Selector('button.action-title-edit').count;
|
|
|
|
|
|
|
|
const Photo = await Selector('div.p-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').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(12000)
|
|
|
|
const FileCountAfterDeletion = await Selector('li.v-expansion-panel__container').count;
|
|
|
|
await t
|
|
|
|
.expect(FileCountAfterDeletion).eql(1);
|
|
|
|
});
|