diff --git a/test/e2e/tests/editor/blocks.spec.ts b/test/e2e/tests/editor/blocks.spec.ts index 96c83e5ce..3eba38d1c 100644 --- a/test/e2e/tests/editor/blocks.spec.ts +++ b/test/e2e/tests/editor/blocks.spec.ts @@ -4,7 +4,6 @@ const { test, expect } = require('@wordpress/e2e-test-utils-playwright'); test.describe('Blocks & Patterns in the Editor', () => { - test.beforeEach(async ({ admin }) => { await admin.createNewPost(); }); diff --git a/test/e2e/tests/editor/events.spec.ts b/test/e2e/tests/editor/events.spec.ts index 1e8623f46..bc5d9c7f1 100644 --- a/test/e2e/tests/editor/events.spec.ts +++ b/test/e2e/tests/editor/events.spec.ts @@ -4,13 +4,14 @@ const { test } = require('@wordpress/e2e-test-utils-playwright'); test.describe('Events in the Editor', () => { - let eventTitle: string; const currentDate = new Date().toISOString().split('T')[0]; // format YYYY-MM-DD test.beforeEach(async ({ admin, page }) => { - - await admin.createNewPost({ postType: 'gatherpress_venue', title: 'Offline Event Location' }); + await admin.createNewPost({ + postType: 'gatherpress_venue', + title: 'Offline Event Location', + }); await admin.createNewPost({ postType: 'gatherpress_event' }); await page @@ -21,19 +22,16 @@ test.describe('Events in the Editor', () => { await page.getByRole('heading', { name: 'Date & time' }).isVisible(); // Open the Document -> Event settings panel. - const panelToggle = page.getByRole( 'button', { + const panelToggle = page.getByRole('button', { name: 'Event settings', - } ); + }); - if ( - ( await panelToggle.getAttribute( 'aria-expanded' ) ) === 'false' - ) { + if ((await panelToggle.getAttribute('aria-expanded')) === 'false') { await panelToggle.click(); } }); test.afterEach(async ({ page, requestUtils }) => { - // Click again to close the element, to let upcoming tests not get flaky. await page.getByRole('button', { name: 'Event settings' }).click(); @@ -70,17 +68,18 @@ test.describe('Events in the Editor', () => { .fill('www.google.com'); }); - test('An admin should be able to publish an offline event', async ({ page, }) => { - await page.getByLabel('Venue Selector').selectOption('Offline Event Location'); + await page + .getByLabel('Venue Selector') + .selectOption('Offline Event Location'); eventTitle = await page .getByLabel('Add title') .fill(`offline T-Event:${currentDate}`); }); -/* + /* test('A user should be able to publish an online event', async ({ page, }) => { diff --git a/test/e2e/tests/editor/venues.spec.ts b/test/e2e/tests/editor/venues.spec.ts index 756151f9e..c3f0e5db0 100644 --- a/test/e2e/tests/editor/venues.spec.ts +++ b/test/e2e/tests/editor/venues.spec.ts @@ -4,7 +4,6 @@ const { test } = require('@wordpress/e2e-test-utils-playwright'); test.describe('Venues in the Editor', () => { - test.beforeEach(async ({ admin }) => { await admin.createNewPost({ postType: 'gatherpress_venue' }); }); @@ -14,7 +13,6 @@ test.describe('Venues in the Editor', () => { }); test('The admin should be able to create a new Venue.', async ({ - admin, page, }) => { await page.getByLabel('Add title').isVisible(); diff --git a/test/e2e/tests/frontend/rsvp.spec.ts b/test/e2e/tests/frontend/rsvp.spec.ts index 0f140b454..edbad9975 100644 --- a/test/e2e/tests/frontend/rsvp.spec.ts +++ b/test/e2e/tests/frontend/rsvp.spec.ts @@ -4,8 +4,7 @@ const { test } = require('@wordpress/e2e-test-utils-playwright'); test.describe('RSVP to an event', () => { - -/* + /* test('02-verify the non-logged in user view RSVP button on home page and perform RSVP action', async ({ page, }) => { @@ -40,8 +39,6 @@ test.describe('RSVP to an event', () => { .first() .screenshot({ path: 'attending.png' }); }); */ - - /* test('02-verify the logged in user view RSVP button on home page and perform RSVP action', async ({ page, @@ -72,7 +69,4 @@ test.describe('RSVP to an event', () => { .first() .screenshot({ path: 'attending.png' }); }); */ - }); - - diff --git a/test/e2e/tests/site-editor/templates.spec.ts b/test/e2e/tests/site-editor/templates.spec.ts index 2a1cbe2ac..87f8cd284 100644 --- a/test/e2e/tests/site-editor/templates.spec.ts +++ b/test/e2e/tests/site-editor/templates.spec.ts @@ -4,16 +4,12 @@ const { test } = require('@wordpress/e2e-test-utils-playwright'); test.describe('Templates', () => { - - test('The events template can be edited', async ({ - admin, - }) => { + test('The events template can be edited', async ({ admin }) => { await admin.visitSiteEditor({ postId: 'twentytwentyfour//single-gatherpress_event', postType: 'wp_template', canvas: 'edit', showWelcomeGuide: false, }); - }); }); diff --git a/test/e2e/tests/wp-admin/settings.spec.ts b/test/e2e/tests/wp-admin/settings.spec.ts index a1a45b940..ffb6ef08e 100644 --- a/test/e2e/tests/wp-admin/settings.spec.ts +++ b/test/e2e/tests/wp-admin/settings.spec.ts @@ -4,7 +4,6 @@ const { test, expect } = require('@wordpress/e2e-test-utils-playwright'); test.describe('Settings', () => { - test('A link to the plugin settings page is present under the Events menu', async ({ page, admin, @@ -14,14 +13,10 @@ test.describe('Settings', () => { const menu = page.locator('li', { has: page.getByRole('link', { name: 'Events' }), }); - const settingsMenu = menu.getByRole( - 'link', - { - name: 'Settings', - } - ); - const settingsMenuUrl = - await settingsMenu.getAttribute('href'); + const settingsMenu = menu.getByRole('link', { + name: 'Settings', + }); + const settingsMenuUrl = await settingsMenu.getAttribute('href'); await expect(settingsMenu).toBeVisible(); await expect(settingsMenuUrl).toContain(