Skip to content

Commit 6ebdd71

Browse files
Go to dashboard for version nr
1 parent eb3db2a commit 6ebdd71

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

test/integration/plugin.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@ import { expect, test } from '@playwright/test';
33
test.describe('plugin', () => {
44
test('should have title', async ({ page }) => {
55
await page.goto('/wp-admin/plugins.php');
6-
await expect(page.getByText('TinyPNG - JPEG, PNG & WebP image compression')).toBeVisible();
6+
await expect(page.getByText('TinyPNG - JPEG, PNG & WebP image compression', { exact: true })).toBeVisible();
77
});
88

99
test('includes settings link', async ({ page }) => {
1010
await page.goto('/wp-admin/plugins.php');
11-
const link = await page.locator('tr[data-slug="tiny-compress-images"] span.settings a').first();
12-
await expect(link).toHaveAttribute('href', 'options-general.php?page=tinify');
11+
await expect(page.getByRole('link', { name: 'Settings', exact: true })).toBeVisible();
1312
});
14-
1513
test('includes bulk optimization link', async ({ page }) => {
1614
await page.goto('/wp-admin/plugins.php');
17-
const link = await page.locator('tr[data-slug="tiny-compress-images"] span.bulk a').first();
18-
await expect(link).toHaveAttribute('href', 'upload.php?page=tiny-bulk-optimization');
15+
await expect(page.getByLabel('Main content').getByRole('link', { name: 'Bulk Optimization', exact: true })).toBeVisible();
1916
});
2017
});

test/integration/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export async function setOriginalImage(page: Page, settings: OriginalImageSettin
126126
* @returns {boolean} true when version is equal or higher
127127
*/
128128
export async function isWPVersionOrHigher(page: Page, version: number) {
129-
page.goto('/wp-admin/about.php')
129+
page.goto('/wp-admin/index.php')
130130
const versionText = await page.locator('#wp-version').textContent();
131131
if (!versionText) throw Error('Could not find version text');
132132

0 commit comments

Comments
 (0)