Skip to content

Commit

Permalink
Update and rename tests/e2e/specs/01_delete-media.test.js to tests/e2…
Browse files Browse the repository at this point in the history
…e/specs/media-library/delete-media.test.js
  • Loading branch information
pavanpatil1 authored Nov 6, 2024
1 parent 8ea97dc commit 23d582c
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import path from 'path';

test.describe( 'Delete Media', () => {
test.beforeAll( async ( { requestUtils } ) => {
await requestUtils.deleteAllMedia();
const files = [
'tests/e2e/assets/test_data_image1.png',
'tests/e2e/assets/test_data_image2.png',
'tests/e2e/assets/test_data_image3.png'
];

for (const file of files) {
await requestUtils.uploadMedia(
path.resolve(process.cwd(), file)
);
}
await requestUtils.deleteAllMedia();
const files = [
'tests/e2e/assets/test_data_image1.png',
'tests/e2e/assets/test_data_image2.png',
'tests/e2e/assets/test_data_image3.png'
];
for (const file of files) {
await requestUtils.uploadMedia(
path.resolve(process.cwd(), file)
);
}
} );
test.beforeEach( async ( { admin } ) => {
await admin.visitAdminPage("/upload.php?mode=list")
test.beforeEach( async ( { admin } ) => {
await admin.visitAdminPage("/upload.php?mode=list")

Check failure on line 23 in tests/e2e/specs/media-library/delete-media.test.js

View workflow job for this annotation

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › media-library/delete-media.test.js:55:6 › Delete Media › delete Bulk media

1) [chromium] › media-library/delete-media.test.js:55:6 › Delete Media › delete Bulk media ─────── Error: Not logged in 21 | } ); 22 | test.beforeEach( async ( { admin } ) => { > 23 | await admin.visitAdminPage("/upload.php?mode=list") | ^ 24 | } ); 25 | test.afterAll( async ( { requestUtils } ) => { 26 | await requestUtils.deleteAllMedia(); at Admin.visitAdminPage (/home/runner/work/wordpress-develop/wordpress-develop/node_modules/@wordpress/e2e-test-utils-playwright/src/admin/visit-admin-page.ts:36:9) at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/media-library/delete-media.test.js:23:10
} );
test.afterAll( async ( { requestUtils } ) => {
await requestUtils.deleteAllMedia();
Expand All @@ -46,10 +46,10 @@ test.describe( 'Delete Media', () => {
.first()
.click();

await expect(
page.locator( '#message p' ),
'Media got deleted successfully'
).toBeVisible();
await expect(
page.locator( '#message p' ),
'Media got deleted successfully'
).toBeVisible();
} );

test( 'delete Bulk media', async ( { page, admin } ) => {
Expand All @@ -71,9 +71,9 @@ test.describe( 'Delete Media', () => {

await page.getByRole( 'button', { name: 'Apply' } ).first().click();

await expect(
page.locator( '#message p' ),
'Media got deleted successfully'
await expect(
page.locator( '#message p' ),
'Media got deleted successfully'
).toBeVisible();

Check failure on line 77 in tests/e2e/specs/media-library/delete-media.test.js

View workflow job for this annotation

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › media-library/delete-media.test.js:55:6 › Delete Media › delete Bulk media

1) [chromium] › media-library/delete-media.test.js:55:6 › Delete Media › delete Bulk media ─────── Error: Media got deleted successfully Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: locator('#message p') Expected: visible Received: <element(s) not found> Call log: - Media got deleted successfully with timeout 5000ms - waiting for locator('#message p') 75 | page.locator( '#message p' ), 76 | 'Media got deleted successfully' > 77 | ).toBeVisible(); | ^ 78 | } ); 79 | } ); 80 | at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/media-library/delete-media.test.js:77:5
} );
} );
} );

0 comments on commit 23d582c

Please sign in to comment.