This commit is contained in:
Robin Windey 2024-09-09 08:37:06 +00:00
Родитель 1f8b483e78
Коммит 68e317ef51
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 35D381829B5DF829
2 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -44,7 +44,7 @@ async function shareDirectory(page) {
test('PPV should show on click on directory shared pano.jpg', async ({ page }) => {
// Open pano
await page.getByRole('link', { name: 'pano .jpg Actions', exact: true }).click();
page.locator('tr[data-file="pano.jpg"] a.name').click();
await page.locator(frameId).waitFor({ state: 'visible', timeout: 5000 });
const ppvLocator = page.frameLocator(frameId);
@ -55,7 +55,7 @@ test('PPV should show on click on directory shared pano.jpg', async ({ page }) =
test('PPV should not show on click on directory shared non-pano.jpg', async ({ page }) => {
// Open image
await page.getByRole('link', { name: 'non-pano .jpg Actions', exact: true }).click();
page.locator('tr[data-file="non-pano.jpg"] a.name').click();
// Assert PPV did not open
let visible = true;

Просмотреть файл

@ -9,9 +9,9 @@ test.beforeEach(async ({ page }) => {
test('PPV should show', async ({ page }) => {
const ppvTestDirUrl = page.url();
const panoLink = page.getByRole('link', { name: 'pano .jpg', exact: true });
const panoRow = page.locator('tr', { has: panoLink });
const panoRow = page.locator('tr[data-cy-files-list-row-name="pano.jpg"]');
const panoFileId = await panoRow.getAttribute('data-cy-files-list-row-fileid');
const panoLink = await panoRow.locator('button[data-cy-files-list-row-name-link]');
expect(ppvTestDirUrl).not.toContain('/' + panoFileId + '?');
@ -51,7 +51,9 @@ test('PPV should show', async ({ page }) => {
});
test('PPV should not show', async ({ page }) => {
await page.getByRole('link', { name: 'non-pano .jpg', exact: true }).click();
const regularImageFileRow = page.locator('tr[data-cy-files-list-row-name="non-pano.jpg"]');
const regularImageLink = await regularImageFileRow.locator('button[data-cy-files-list-row-name-link]');
await regularImageLink.click();
// Assert PPV did not open
let visible = true;
@ -68,7 +70,8 @@ test('PPV should not show', async ({ page }) => {
test('360 video should show on context menu click', async ({ page }) => {
// Note :: this test needs to run on Chrome because Chromium lacks support for 360 video codecs
await page.getByRole('row', { name: 'Toggle selection for file "360-video.mp4" 360-video .mp4 Show sharing options' }).getByLabel('Actions').click();
const videoFileRow = page.locator('tr[data-cy-files-list-row-name="360-video.mp4"]');
videoFileRow.getByLabel('Actions').click();
await page.getByRole('menuitem', { name: 'View in 360° viewer' }).click();
await expect(page.frameLocator('#photo-sphere-viewer-frame').locator('#pano div').nth(1)).toBeVisible({ timeout: 1000 });
@ -78,4 +81,5 @@ test('360 video should show on context menu click', async ({ page }) => {
// Close
await page.frameLocator('#photo-sphere-viewer-frame').locator('#pano div').nth(1).press('Escape');
await expect(page.frameLocator('#photo-sphere-viewer-frame').locator('#pano div').nth(1)).toBeHidden({ timeout: 1000 });
});
});