Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep NC32 #160

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ env:
APP_NAME: files_photospheres
NC_REF: master
NC_BIND: 'localhost:8080'
NODE_VER: 16
NODE_VER: 20
DB_USER: root
DB_PASSWORD: rootpassword
DB_PORT: 4444
32 changes: 16 additions & 16 deletions tests/E2E/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/E2E/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"playwright": "^1.40.1",
"@playwright/test": "^1.40.1"
"playwright": "^1.50.1",
"@playwright/test": "^1.50.1"
}
}
2 changes: 1 addition & 1 deletion tests/E2E/tests/common.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ export async function loginAndSwitchToPPVTestFiles(page) {
await page.locator('#password').fill(process.env.E2E_PASSWORD ?? 'admin');
await page.locator('#password').press('Enter');
await page.getByLabel('Files', { exact: true }).click();
await page.getByRole('button', { name: 'ppv-testfiles' }).click();
await page.getByRole('button', { name: /.*\sppv-testfiles.*/ }).click();
};

export const frameId = '#photo-sphere-viewer-frame';
8 changes: 6 additions & 2 deletions tests/E2E/tests/directory-share.spec.ts
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@ 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();
await page.getByRole('row', { name: /.*"pano.jpg".*/ }).click();

await page.locator(frameId).waitFor({ state: 'visible', timeout: 5000 });
const ppvLocator = page.frameLocator(frameId);

@@ -55,7 +56,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();
await page.getByRole('row', { name: /.*"non-pano.jpg".*/ }).click();

// Assert PPV did not open
let visible = true;
@@ -68,4 +69,7 @@ test('PPV should not show on click on directory shared non-pano.jpg', async ({ p
}

expect(visible).toBe(false);

// Assert regular viewer opened
await page.getByRole('img', { name: 'non-pano.jpg' }).waitFor({ state: 'visible', timeout: 1000 });
});
16 changes: 9 additions & 7 deletions tests/E2E/tests/regular-fileview.spec.ts
Original file line number Diff line number Diff line change
@@ -9,14 +9,13 @@ 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 = await page.getByRole('row', { name: /.*"pano.jpg".*/ });
const panoFileId = await panoRow.getAttribute('data-cy-files-list-row-fileid');

expect(ppvTestDirUrl).not.toContain('/' + panoFileId + '?');

// Open 1st time
await panoLink.click();
await panoRow.click();
await page.locator(frameId).waitFor({ state: 'visible' });

expect(page.url()).toContain('/' + panoFileId + '?');
@@ -30,7 +29,7 @@ test('PPV should show', async ({ page }) => {
expect(page.url()).toBe(ppvTestDirUrl);

// Open 2nd time
await panoLink.click();
await panoRow.click();
await page.locator(frameId).waitFor({ state: 'visible' });

// Move the image
@@ -51,8 +50,8 @@ test('PPV should show', async ({ page }) => {
});

test('PPV should not show', async ({ page }) => {
await page.getByRole('link', { name: 'non-pano .jpg', exact: true }).click();
await page.getByRole('row', { name: /.*"non-pano.jpg".*/ }).click();

// Assert PPV did not open
let visible = true;
try {
@@ -64,11 +63,14 @@ test('PPV should not show', async ({ page }) => {
}

expect(visible).toBe(false);

// Assert regular viewer opened
await page.getByRole('img', { name: 'non-pano.jpg' }).waitFor({ state: 'visible', timeout: 1000 });
});

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();
await page.getByRole('row', { name: /.*"360-video.mp4".*/ }).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 });