2019-05-21 17:00:46 +02:00
|
|
|
import { Selector } from 'testcafe';
|
2020-06-03 08:42:56 +02:00
|
|
|
import testcafeconfig from './testcafeconfig.json';
|
|
|
|
import Page from "./page-model";
|
2019-05-21 17:00:46 +02:00
|
|
|
|
|
|
|
fixture`Test views`
|
|
|
|
.page`${testcafeconfig.url}`;
|
|
|
|
|
|
|
|
const page = new Page();
|
|
|
|
|
|
|
|
test('Open photo in fullscreen', async t => {
|
|
|
|
await t
|
|
|
|
.click(Selector('div.v-image__image').nth(0))
|
|
|
|
.expect(Selector('#p-photo-viewer').visible).ok()
|
|
|
|
.expect(Selector('img.pswp__img').visible).ok();
|
2019-12-28 21:31:14 +01:00
|
|
|
});
|
|
|
|
|
2019-06-22 15:41:44 +02:00
|
|
|
test('Open mosaic view via select', async t => {
|
2019-05-21 17:00:46 +02:00
|
|
|
await t
|
2019-06-25 14:55:46 +02:00
|
|
|
.click('button.p-expand-search');
|
2019-05-21 17:00:46 +02:00
|
|
|
await page.setFilter('view', 'Mosaic');
|
|
|
|
await t
|
|
|
|
.expect(Selector('div.v-image__image').visible).ok()
|
|
|
|
.expect(Selector('div.p-photo-mosaic').visible).ok()
|
2019-12-28 21:31:14 +01:00
|
|
|
.expect(Selector('div.p-photo div.caption').exists).notOk()
|
2019-05-21 17:00:46 +02:00
|
|
|
.expect(Selector('#p-photo-viewer').visible).notOk();
|
2019-12-28 21:31:14 +01:00
|
|
|
});
|
|
|
|
|
2019-06-22 15:41:44 +02:00
|
|
|
test('Open list view via select', async t => {
|
2019-05-21 17:00:46 +02:00
|
|
|
await t
|
2019-06-25 14:55:46 +02:00
|
|
|
.click('button.p-expand-search');
|
2019-05-21 17:00:46 +02:00
|
|
|
await page.setFilter('view', 'List');
|
|
|
|
await t
|
|
|
|
.expect(Selector('table.v-datatable').visible).ok()
|
|
|
|
.expect(Selector('div.p-photo-list').visible).ok();
|
2019-12-28 21:31:14 +01:00
|
|
|
});
|
|
|
|
|
2020-06-03 08:42:56 +02:00
|
|
|
test('Open card view via select', async t => {
|
2019-12-28 21:31:14 +01:00
|
|
|
await t
|
|
|
|
.click('button.p-expand-search');
|
2020-06-03 08:42:56 +02:00
|
|
|
await page.setFilter('view', 'Cards');
|
2019-12-28 21:31:14 +01:00
|
|
|
await t
|
|
|
|
.expect(Selector('div.v-image__image').visible).ok()
|
|
|
|
.expect(Selector('div.p-photo div.caption').visible).ok()
|
|
|
|
.expect(Selector('#p-photo-viewer').visible).notOk();
|
|
|
|
});
|