Frontend: Add/refactor acceptance tests
This commit is contained in:
parent
5749b93e0c
commit
4cf06a795f
2 changed files with 17 additions and 9 deletions
|
@ -61,6 +61,12 @@ export default class Page {
|
|||
.click(Selector('.t-select.t-off'));
|
||||
}
|
||||
|
||||
async unselectPhotoFromUID(uid) {
|
||||
await t
|
||||
.hover(Selector('div').withAttribute('data-uid', uid))
|
||||
.click(Selector('.t-select.t-on'));
|
||||
}
|
||||
|
||||
async selectNthPhoto(nPhoto) {
|
||||
await t
|
||||
.hover(Selector('div[class="v-image__image v-image__image--cover"]', {timeout:4000}).nth(nPhoto))
|
||||
|
@ -75,14 +81,12 @@ export default class Page {
|
|||
|
||||
async likePhoto(uid) {
|
||||
await t
|
||||
.hover(Selector('div').withAttribute('data-uid', uid))
|
||||
.click(Selector('.t-like.t-off'));
|
||||
.click(Selector('.t-like.t-off').withAttribute('data-uid', uid));
|
||||
}
|
||||
|
||||
async dislikePhoto(uid) {
|
||||
await t
|
||||
.hover(Selector('div').withAttribute('data-uid', uid))
|
||||
.click(Selector('.t-like.t-on'));
|
||||
.click(Selector('.t-like.t-on').withAttribute('data-uid', uid));
|
||||
}
|
||||
|
||||
async archiveSelectedPhotos() {
|
||||
|
@ -99,9 +103,13 @@ export default class Page {
|
|||
}
|
||||
|
||||
async editSelectedPhotos() {
|
||||
await t
|
||||
.click(Selector('button.p-photo-clipboard-menu'))
|
||||
.click(Selector('button.p-photo-clipboard-edit'));
|
||||
if (await Selector('button.p-photo-clipboard-edit').exists) {
|
||||
await t.click(Selector('button.p-photo-clipboard-edit'));
|
||||
} else if (await Selector('button.p-photo-clipboard-menu').exists) {
|
||||
await t
|
||||
.click(Selector('button.p-photo-clipboard-menu'))
|
||||
.click(Selector('button.p-photo-clipboard-edit'));
|
||||
}
|
||||
}
|
||||
|
||||
async login(password) {
|
||||
|
|
|
@ -100,7 +100,7 @@ test('#8 approve photo', async t => {
|
|||
|
||||
//TODO videos - play video
|
||||
|
||||
/*test('#1 like/dislike photo/video', async t => {
|
||||
test('#1 like/dislike photo/video', async t => {
|
||||
|
||||
logger.clear();
|
||||
const FirstPhoto = await Selector('.t-off').nth(0).getAttribute('data-uid');
|
||||
|
@ -423,7 +423,7 @@ test('#7 archive/restore video, photos, private photos and review photos using c
|
|||
logger.clear();
|
||||
await t
|
||||
.expect(Selector('div').withAttribute('data-uid', FirstReviewPhoto).exists).ok();
|
||||
});*/
|
||||
});
|
||||
|
||||
|
||||
//TODO open photoeditdialogue (multiple ways) + edit photo details
|
||||
|
|
Loading…
Reference in a new issue