diff --git a/tests/e2e/specs/archive.spec.js b/tests/e2e/specs/archive.spec.js index 7ed9b724..ec980ef7 100644 --- a/tests/e2e/specs/archive.spec.js +++ b/tests/e2e/specs/archive.spec.js @@ -314,6 +314,7 @@ test.describe('archive pages', () => { hasText: 'Categories Count', }) .locator('input.components-input-control__input') + .first() .fill('3'); await page.getByLabel('Display Excerpt').check(); @@ -351,7 +352,7 @@ test.describe('archive pages', () => { .locator('#menu-posts-portfolio') .getByRole('link', { name: 'Settings' }) .click(); - await page.getByRole('textbox', { name: '-- Select Page --' }).click(); + await page.locator('.select2-container').click(); await page.getByRole('option', { name: 'Portfolio' }).click(); await page.getByLabel('Archive Page Items Per Page').fill('2'); await page.getByRole('button', { name: 'Save Changes' }).click(); diff --git a/tests/e2e/utils/get-wordpress-images.js b/tests/e2e/utils/get-wordpress-images.js index 1a66c4ef..3000323f 100644 --- a/tests/e2e/utils/get-wordpress-images.js +++ b/tests/e2e/utils/get-wordpress-images.js @@ -15,6 +15,7 @@ import imagePaths from '../../fixtures/images.json'; * @param {Admin} admin End to end test utilities for WordPress admin’s user interface. * @param {Editor} editor End to end test utilities for the WordPress Block Editor. * @param {boolean} alternativeSetting Set alternative meta settings for test images. + * @param {boolean} usingInPro Set if using in pro plugin. * @return {{images: {format: string, video_url: string, url: string}[]}} */ export async function getWordpressImages({ @@ -23,6 +24,7 @@ export async function getWordpressImages({ admin, editor, alternativeSetting = false, + usingInPro = false, }) { let images = []; let postLink = ''; @@ -56,9 +58,14 @@ export async function getWordpressImages({ await page.goto(currentPage); } + const imagePath = + process.env.CORE || usingInPro + ? 'core-plugin/tests/fixtures/' + : 'tests/fixtures/'; + images = await Promise.all( imagePaths.map(async (object) => { - const filepath = path.join('tests/fixtures/', object.filename); + const filepath = path.join(imagePath, object.filename); // Upload image to WordPress gallery. const media = await requestUtils.uploadMedia(filepath);