Frontend: Adapt acceptance tests to changes

This commit is contained in:
Theresa Gresch 2020-07-15 09:51:16 +02:00
parent 8b9dffc449
commit acee2c57fd
6 changed files with 23 additions and 20 deletions

View file

@ -44,7 +44,7 @@ test('#2 Update album', async t => {
.pressKey('enter');
const AlbumUid = await Selector('div.p-album').nth(0).getAttribute('data-uid');
await t
.expect(Selector('div.v-card__actions').nth(0).innerText).contains('Holiday')
.expect(Selector('h3.action-title-edit').nth(0).innerText).contains('Holiday')
.click(Selector('.action-title-edit').nth(0))
.typeText(Selector('.input-title input'), 'Animals', { replace: true })
.expect(Selector('.input-description textarea').value).eql('')
@ -74,7 +74,7 @@ test('#2 Update album', async t => {
//const request3 = await logger.requests[0].response.body;
logger.clear();
await t
.expect(Selector('div.v-card__actions').nth(0).innerText).contains('Christmas')
.expect(Selector('h3.action-title-edit').nth(0).innerText).contains('Christmas')
.click(Selector('.nav-albums'))
.click('.action-reload')
.click(Selector('.input-category i'))

View file

@ -49,7 +49,7 @@ test('#1 Remove/Activate Add/Delete Label from photo', async t => {
.click(Selector('.nav-labels'));
await page.search('beacon');
await t
.expect(Selector('h3').withText('No labels matched your search').visible).ok();
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok();
await page.search('test');
const LabelTest = await Selector('div.p-label').nth(0).getAttribute('data-uid');
await t
@ -68,7 +68,7 @@ test('#1 Remove/Activate Add/Delete Label from photo', async t => {
.click(Selector('.nav-labels'));
await page.search('test');
await t
.expect(Selector('h3').withText('No labels matched your search').visible).ok();
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok();
await page.search('beacon');
await t
.expect(Selector('div').withAttribute('data-uid', LabelBeacon).visible).ok();
@ -117,7 +117,7 @@ test('#2 Rename Label', async t => {
.click(Selector('.nav-labels'));
await page.search('horse');
await t
.expect(Selector('h3').withText('No labels matched your search').visible).ok();
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok();
});
test('#3 Add label to album', async t => {
@ -178,7 +178,7 @@ test('#4 Delete label', async t => {
await page.deleteSelected();
await page.search('dome');
await t
.expect(Selector('h3').withText('No labels matched your search').visible).ok()
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok()
.click('.nav-photos')
.click(Selector('.action-title-edit').withAttribute('data-uid', FirstPhotoDome))
.click(Selector('#tab-labels'))

View file

@ -13,7 +13,7 @@ test('#1 Import files from folder using copy', async t => {
.click(Selector('.nav-labels'));
await page.search('bakery');
await t
.expect(Selector('h3').withText('No labels matched your search').visible).ok();
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok();
await t
.click(Selector('.nav-library'))
//TODO Connecting... error must be moved somewhere else

View file

@ -12,9 +12,9 @@ test('#1 Index files from folder', async t => {
.click(Selector('.nav-labels'));
await page.search('cheetah');
await t
.expect(Selector('h3').withText('No labels matched your search').visible).ok()
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok()
.click(Selector('.nav-moments'))
.expect(Selector('h3').withText('No moments matched your search').visible).ok();
.expect(Selector('h3').withText('Couldn\'t find anything').visible).ok();
await t
.click(Selector('.nav-library'))
.click(Selector('#tab-index'))

View file

@ -14,21 +14,24 @@ test('#1 Add originals files to album', async t => {
.typeText(Selector('.p-albums-search input'), 'KanadaVacation')
.pressKey('enter');
await t
.expect(Selector('h3').innerText).eql('No albums matched your search');
.expect(Selector('h3').innerText).eql('Couldn\'t find anything');
await t
.click(Selector('div.nav-library + div'))
.click(Selector('.nav-originals'))
.click(Selector('button').withText('Vacation'));
const FirstItemInVacation = await Selector('div.v-card__title').nth(0).innerText;
const KanadaUid = await Selector('div.v-card__title').nth(0).getAttribute('data-uid');
const SecondItemInVacation = await Selector('div.v-card__title').nth(1).innerText;
if (await Selector('button.action-update-reload').exists) {
await t.click(Selector('button.action-update-reload'))
}
const FirstItemInVacation = await Selector('div.p-photo-desc').nth(0).innerText;
const KanadaUid = await Selector('div.p-photo-desc').nth(0).getAttribute('data-uid');
const SecondItemInVacation = await Selector('div.p-photo-desc').nth(1).innerText;
await t
.expect(FirstItemInVacation).contains('Kanada')
.expect(SecondItemInVacation).contains('Korsika')
.click(Selector('button').withText('Kanada'));
const FirstItemInKanada = await Selector('div.v-card__title').nth(0).innerText;
const SecondItemInKanada = await Selector('div.v-card__title').nth(1).innerText;
const FirstItemInKanada = await Selector('div.p-photo-desc').nth(0).innerText;
const SecondItemInKanada = await Selector('div.p-photo-desc').nth(1).innerText;
await t
.expect(FirstItemInKanada).contains('BotanicalGarden')
.expect(SecondItemInKanada).contains('IMG')

View file

@ -534,8 +534,8 @@ test('#7 Edit photo/video', async t => {
.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'), 'July', { replace: true })
.click(Selector('div').withText('July').parent('div[role="listitem"]'), {timeout: 5000})
.typeText(Selector('.input-month input'), '07', { replace: true })
.pressKey('enter')
.typeText(Selector('.input-year input'), 'Unknown', { replace: true })
.pressKey('enter')
.click(Selector('.input-local-time input'))
@ -583,7 +583,7 @@ test('#7 Edit photo/video', async t => {
.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('July')
.expect(Selector('.input-month input').value).eql('07')
.expect(Selector('.input-year input').value).eql('Unknown')
.expect(Selector('.input-latitude input').value).eql('41.15333')
.expect(Selector('.input-longitude input').value).eql('20.168331')
@ -613,7 +613,7 @@ test('#7 Edit photo/video', async t => {
await t.typeText(Selector('.input-day input'), FirstPhotoDay, { replace: true })
.pressKey('enter')
.typeText(Selector('.input-month input'), FirstPhotoMonth, { replace: true })
.click(Selector('div').withText(FirstPhotoMonth).parent('div[role="listitem"]'))
.pressKey('enter')
.typeText(Selector('.input-year input'), FirstPhotoYear, { replace: true })
.pressKey('enter');
if (FirstPhotoLocalTime.empty || FirstPhotoLocalTime === "")
@ -819,7 +819,7 @@ test('#10 Ungroup files', async t => {
.click(Selector('#tab-files'))
.click(Selector('li.v-expansion-panel__container').nth(1))
.click(Selector('.action-unstack'))
.wait(11000)
.wait(12000)
.click(Selector('button.action-close'))
.click(Selector('.nav-photos'))
.click(Selector('.p-expand-search'));