From bc731f2498faf8b4b4e139c07e40ab1d8e386774 Mon Sep 17 00:00:00 2001 From: Maud Leray Date: Tue, 19 Nov 2024 15:50:34 +0100 Subject: [PATCH] Simplify new test We can remove the check for lite Youtube use --- tests/e2e/blocks/audio-video.spec.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/tests/e2e/blocks/audio-video.spec.js b/tests/e2e/blocks/audio-video.spec.js index 773114ca14..264042bee7 100644 --- a/tests/e2e/blocks/audio-video.spec.js +++ b/tests/e2e/blocks/audio-video.spec.js @@ -26,15 +26,6 @@ const addVideoOrAudioBlock = async ({page}, mediaType, mediaLink) => { test.useAdminLoggedIn(); test('check the Audio and Video blocks', async ({page, admin, editor}) => { - // Make sure the "Lazy Youtube player" setting is enabled. - await page.goto('./wp-admin/admin.php?page=planet4_settings_features'); - const lazyYoutubePlayerSetting = page.locator('#lazy_youtube_player'); - const alreadyEnabled = await lazyYoutubePlayerSetting.isChecked(); - if (!alreadyEnabled) { - await lazyYoutubePlayerSetting.check(); - await page.locator('input[type="submit"]').click(); - } - // Create a post for the test. await createPostWithFeaturedImage({page, admin, editor}, {title: 'Test Audio and Video blocks'}); @@ -51,21 +42,9 @@ test('check the Audio and Video blocks', async ({page, admin, editor}) => { await publishPostAndVisit({page, editor}); // Check on the frontend that the blocks are present. - // Check YouTube embed. - const youtubeEmbed = page.locator('.wp-block-embed-youtube'); - const youtubeVideoId = YOUTUBE_TEST.split('?v=')[1]; - await expect(youtubeEmbed).toBeVisible(); - await expect(youtubeEmbed.locator('lite-youtube')).toHaveAttribute('videoid', youtubeVideoId); - - // Check Vimeo embed. + await expect(page.locator('.wp-block-embed-youtube')).toBeVisible(); await expect(page.locator('.wp-block-embed-vimeo')).toBeVisible(); - - // Check MP4 embed. await expect(page.locator('.wp-block-video > video')).toHaveAttribute('src', MP4_TEST); - - // Check SoundCloud embed. await expect(page.locator('.wp-block-embed-soundcloud')).toBeVisible(); - - // Check MP3 embed. await expect(page.locator('.wp-block-audio > audio')).toHaveAttribute('src', MP3_TEST); });