Skip to content

Commit c2c2350

Browse files
committed
Set version to 6.2
1 parent e62f8c9 commit c2c2350

5 files changed

Lines changed: 99 additions & 38 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
esVersion: ['7.10.1', '8.12.2', '9.1.5', 'EP.io']
3434
core:
3535
- {name: 'WP latest', version: '', wcVersion: ''}
36-
- {name: 'WP minimum', version: '6.4', wcVersion: '9.0.0'}
36+
- {name: 'WP minimum', version: '6.2', wcVersion: '9.0.0'}
3737

3838
steps:
3939
- name: Checkout

tests/e2e/src/block-editor.ts

Lines changed: 90 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,49 @@ export async function supportsBlockTypography(page: Page, element: Locator, isEd
147147
await fontSizeButton.dispatchEvent('click');
148148
await fontSizeButton.press('Escape');
149149

150-
await page
151-
.locator('.block-editor-block-inspector fieldset.components-font-size-picker')
152-
.locator('button[role="combobox"], button[aria-label="Font size"]')
153-
.click();
150+
if (process.env.WP_VERSION === '6.2') {
151+
await page
152+
.locator('.block-editor-block-inspector button[aria-label="Typography options"]')
153+
.click();
154+
const fontSizeButton = page
155+
.locator(
156+
'[role="menu"][aria-label="Typography options"] button, .popover-slot button',
157+
)
158+
.filter({ hasText: 'Font size' });
159+
await fontSizeButton.click();
160+
await fontSizeButton.press('Escape');
161+
await page.getByRole('button', { name: 'Set custom size' }).click();
162+
await page
163+
.locator('.components-font-size-picker__controls input[type="number"]')
164+
.fill('16');
154165

155-
await page
156-
.locator(
157-
'.block-editor-block-inspector li[role="option"], .block-editor-block-inspector div[role="option"]',
158-
)
159-
.filter({ hasText: 'Extra small' })
160-
.click();
166+
await page
167+
.locator('.block-editor-block-inspector button[aria-label="Typography options"]')
168+
.click();
169+
const lineHeightButton = page
170+
.locator('[aria-label="Typography options"] button, .popover-slot button')
171+
.filter({ hasText: 'Line height' });
172+
await lineHeightButton.click();
173+
await lineHeightButton.press('Escape');
174+
await page.locator('.components-input-control__input[placeholder="1.5"]').fill('2');
175+
} else {
176+
await page
177+
.locator('.block-editor-block-inspector fieldset.components-font-size-picker')
178+
.locator('button[role="combobox"], button[aria-label="Font size"]')
179+
.click();
161180

162-
await page.locator('.block-editor-line-height-control input').fill('2');
163-
await page.locator('.block-editor-block-inspector button[aria-label="Settings"]').click();
181+
await page
182+
.locator(
183+
'.block-editor-block-inspector li[role="option"], .block-editor-block-inspector div[role="option"]',
184+
)
185+
.filter({ hasText: 'Extra small' })
186+
.click();
187+
188+
await page.locator('.block-editor-line-height-control input').fill('2');
189+
await page
190+
.locator('.block-editor-block-inspector button[aria-label="Settings"]')
191+
.click();
192+
}
164193
}
165194

166195
await expect(element).toHaveCSS('font-size', '16px');
@@ -189,27 +218,59 @@ export async function supportsBlockDimensions(page: Page, element: Locator, isEd
189218
await paddingButton.dispatchEvent('click');
190219
await paddingButton.press('Escape');
191220

192-
const verticalInputsWrapper = dimensionsPanel
193-
.locator('.component-spacing-sizes-control, .spacing-sizes-control__wrapper')
194-
.first();
221+
if (process.env.WP_VERSION === '6.2') {
222+
await page.locator('.components-button[aria-label="Unlink sides"]').click();
195223

196-
await verticalInputsWrapper
197-
.locator('button[aria-label="Set custom value"], button[aria-label="Set custom size"]')
198-
.first()
199-
.click();
200-
await verticalInputsWrapper.locator('input[type="number"]').fill('10');
224+
const inputs = [
225+
{ label: 'Top padding', value: 10 },
226+
{ label: 'Right padding', value: 15 },
227+
{ label: 'Bottom padding', value: 10 },
228+
{ label: 'Left padding', value: 15 },
229+
];
201230

202-
const horizontalInputsWrapper = dimensionsPanel
203-
.locator('.component-spacing-sizes-control, .spacing-sizes-control__wrapper')
204-
.nth(1);
231+
for await (const { label, value } of inputs) {
232+
const customSizeButton = dimensionsPanel
233+
.locator('button[aria-label="Set custom size"]')
234+
.first();
235+
const input = dimensionsPanel
236+
.locator(`label:has-text("${label}")`)
237+
.locator('..')
238+
.locator('input');
205239

206-
await horizontalInputsWrapper
207-
.locator('button[aria-label="Set custom value"], button[aria-label="Set custom size"]')
208-
.first()
209-
.click();
210-
await horizontalInputsWrapper.locator('input[type="number"]').fill('15');
240+
await customSizeButton.click({ force: true });
241+
await input.fill(value.toString());
242+
}
211243

212-
await page.locator('.block-editor-block-inspector button[aria-label="Settings"]').click();
244+
await dimensionsPanel.click();
245+
} else {
246+
const verticalInputsWrapper = dimensionsPanel
247+
.locator('.component-spacing-sizes-control, .spacing-sizes-control__wrapper')
248+
.first();
249+
250+
await verticalInputsWrapper
251+
.locator(
252+
'button[aria-label="Set custom value"], button[aria-label="Set custom size"]',
253+
)
254+
.first()
255+
.click();
256+
await verticalInputsWrapper.locator('input[type="number"]').fill('10');
257+
258+
const horizontalInputsWrapper = dimensionsPanel
259+
.locator('.component-spacing-sizes-control, .spacing-sizes-control__wrapper')
260+
.nth(1);
261+
262+
await horizontalInputsWrapper
263+
.locator(
264+
'button[aria-label="Set custom value"], button[aria-label="Set custom size"]',
265+
)
266+
.first()
267+
.click();
268+
await horizontalInputsWrapper.locator('input[type="number"]').fill('15');
269+
270+
await page
271+
.locator('.block-editor-block-inspector button[aria-label="Settings"]')
272+
.click();
273+
}
213274
}
214275

215276
await expect(element).toHaveCSS('padding', '10px 15px');

tests/e2e/src/specs/general.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ test.describe('WordPress can perform standard ElasticPress actions', { tag: '@gr
130130
const syncTable = loggedInPage.locator(
131131
'#health-check-accordion-block-ep-last-sync .health-check-table',
132132
);
133-
const selector = process.env.WP_VERSION === '6.4' ? 'td' : 'th';
133+
const selector = process.env.WP_VERSION === '6.2' ? 'td' : 'th';
134134
const cells = [
135135
'Method',
136136
'Full Sync',

tests/e2e/src/specs/related-posts.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ test.describe('Related Posts Feature', { tag: '@group2' }, () => {
9494
const requestPromise = loggedInPage.waitForResponse('**/wp-json/wp/v2/posts/*');
9595

9696
// Update post and visit front end
97-
const buttonLabel = process.env.WP_VERSION === '6.4' ? 'Update' : 'Save';
97+
const buttonLabel = process.env.WP_VERSION === '6.2' ? 'Update' : 'Save';
9898
await loggedInPage.getByRole('button', { name: buttonLabel, exact: true }).click();
9999
await requestPromise;
100100

101101
let viewPostLink;
102-
if (process.env.WP_VERSION === '6.4') {
102+
if (process.env.WP_VERSION === '6.2') {
103103
await loggedInPage.reload();
104104
viewPostLink = loggedInPage.locator('#wp-admin-bar-view a');
105105
} else {

tests/e2e/src/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ export async function getEditorFrame(page: Page): Promise<Page | FrameLocator> {
265265

266266
export async function maybeOpenEditorSettings(page: Page) {
267267
const selector =
268-
process.env.WP_VERSION === '6.4'
268+
process.env.WP_VERSION === '6.2'
269269
? '.interface-interface-skeleton__sidebar .interface-complementary-area'
270270
: '.interface-interface-skeleton__sidebar .interface-complementary-area__fill';
271271
const editorSettings = page.locator(selector);
272272

273273
try {
274-
if (process.env.WP_VERSION !== '6.4') {
274+
if (process.env.WP_VERSION !== '6.2') {
275275
await editorSettings.waitFor({ state: 'visible', timeout: 5 });
276276
}
277277
} catch (error) {
@@ -292,7 +292,7 @@ export async function maybeOpenSettingsTab(page: Page, tabName: string) {
292292

293293
let tab: Locator;
294294
let isTabActive: string | boolean | null;
295-
if (process.env.WP_VERSION === '6.4') {
295+
if (process.env.WP_VERSION === '6.2') {
296296
tab = page.locator('.edit-post-sidebar__panel-tab, .edit-widgets-sidebar__panel-tab', {
297297
hasText: tabName,
298298
});
@@ -323,7 +323,7 @@ export async function setPostPassword(
323323
await maybeOpenEditorSettings(page);
324324
await maybeOpenSettingsTab(page, 'Post');
325325

326-
if (process.env.WP_VERSION === '6.4') {
326+
if (process.env.WP_VERSION === '6.2') {
327327
await page.locator('.edit-post-post-visibility__toggle').click();
328328
await page
329329
.getByRole('radio', { name: password !== '' ? 'Password protected' : 'Public' })
@@ -406,7 +406,7 @@ export async function publishPost(
406406
if (!isInCodeEditorMode) {
407407
await changeMode(page);
408408
}
409-
if (process.env.WP_VERSION === '6.4') {
409+
if (process.env.WP_VERSION === '6.2') {
410410
await page.locator('.wp-block-post-title').fill(newPostData.title);
411411
} else {
412412
await page.locator('.wp-block-post-title textarea').fill(newPostData.title);

0 commit comments

Comments
 (0)