Skip to content

Commit

Permalink
test updeted
Browse files Browse the repository at this point in the history
  • Loading branch information
01Prayag committed Jan 11, 2025
2 parents 5b09622 + a448952 commit a311e8e
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 16 deletions.
22 changes: 15 additions & 7 deletions test/e2e/admin-tests/gatherpress-admin-event-details.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,22 @@ test.describe('e2e test for event post, verify the event time is visible on fron
.getByRole('link', { name: 'View Event' })
.click();

await expect(
page.locator('.wp-block-gatherpress-event-date')
).toBeVisible();

Check failure on line 43 in test/e2e/admin-tests/gatherpress-admin-event-details.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎⏎⏎`
const details = await page.locator('.wp-block-gatherpress-event-date');

expect(await details.screenshot()).toMatchSnapshot(
'event-post-details.png'
);

await page.locator('#wp--skip-link--target').isVisible();
await page
.locator('#wp--skip-link--target')
.screenshot({ path: 'event-details-post.png' });

await expect(page).toHaveScreenshot('event_details.png', {
fullPage: true,
mask: [
page.locator('header'),
page.locator('h1'),
page.locator('footer'),
],
});

Check failure on line 58 in test/e2e/admin-tests/gatherpress-admin-event-details.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎`

});
});
2 changes: 2 additions & 0 deletions test/e2e/admin-tests/gatherpress-admin-venue-map.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ test.describe('e2e test for venue map through admin side', () => {
page.locator('h1'),
page.locator('footer'),
],

Check failure on line 61 in test/e2e/admin-tests/gatherpress-admin-venue-map.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Replace `⏎↹↹});⏎` with `↹↹});`
});

});
});
7 changes: 7 additions & 0 deletions test/e2e/admin-tests/gatherpress-event-featured-image.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { test, expect } = require('@playwright/test');

const { login } = require('../reusable-user-steps/common.js');


Check failure on line 5 in test/e2e/admin-tests/gatherpress-event-featured-image.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎`
test.describe('e2e test for publish event through admin side', () => {
test.beforeEach(async ({ page }) => {
test.setTimeout(120000);
Expand All @@ -13,6 +15,7 @@ test.describe('e2e test for publish event through admin side', () => {
page,
}) => {
const postName = `featuredImage-${Math.random().toString(36).substring(2)}`;

await page.getByRole('link', { name: 'Events', exact: true }).click();
await page
.locator('#wpbody-content')
Expand All @@ -28,8 +31,10 @@ test.describe('e2e test for publish event through admin side', () => {
await page.getByLabel('Add title').fill(postName);

await page.getByRole('heading', { name: 'Date & time' }).isVisible();

await page.getByLabel('Settings', { exact: true }).click();
await page.getByRole('button', { name: 'Event settings' }).click();

await page.getByRole('button', { name: 'Set featured image' }).click();

await page
Expand All @@ -52,6 +57,7 @@ test.describe('e2e test for publish event through admin side', () => {
.getByRole('link', { name: 'View Event' })
.click();
await page.locator('#wp--skip-link--target img').isVisible();

await page.waitForLoadState('networkidle');
const FeaturedImage = await page.screenshot({
fullPage: true,
Expand All @@ -65,6 +71,7 @@ test.describe('e2e test for publish event through admin side', () => {
page.locator('footer'),
],
});

expect(FeaturedImage).toMatchSnapshot('featured_image.png');
});
});
9 changes: 8 additions & 1 deletion test/e2e/admin-tests/gatherpress-event-loggedIn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,23 @@ test.describe('e2e test for publish event through admin side', () => {
.getByRole('link', { name: 'Add New' })
.click();

await page.getByLabel('Add title').fill('online event');

await page
.getByLabel('Block: Event Date')
.locator('div')
.first()
.isVisible();
await page.getByRole('heading', { name: 'Date & time' }).isVisible();

await page.getByLabel('Settings', { exact: true }).click();
await page.getByLabel('Settings', { exact: true }).click();

await page.getByRole('button', { name: 'Event settings' }).click();

await page.getByLabel('Venue Selector').selectOption('58:online-event');
await page.getByRole('button', { name: 'Event settings' }).click();
await page.getByRole('button', { name: 'Event settings' }).click();
await page.getByLabel('Venue Selector').selectOption('33:online-event');
const currentDate = new Date().toISOString().split('T')[0]; // format YYYY-MM-DD
const eventTitle = await page
.getByLabel('Add title')
Expand Down
14 changes: 8 additions & 6 deletions test/e2e/admin-tests/gatherpress-event-nonLoggegIn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ test.describe('e2e test for home page event on develop.gatherpress.org', () => {
test.skip('01-the user should be able to publish an offline event', async ({
page,
}) => {

Check failure on line 16 in test/e2e/admin-tests/gatherpress-event-nonLoggegIn.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎`
await login({ page, username: 'prashantbellad' });
await page.getByRole('link', { name: 'Events', exact: true }).click();
await page
.locator('#wpbody-content')
.getByRole('link', { name: 'Add New' })
.click();

const currentDate = new Date().toISOString().split('T')[0]; // format YYYY-MM-DD
const eventTitle = await page
.getByLabel('Add title')
.fill(`offline T-Event:${currentDate}`);

await page
.getByLabel('Block: Event Date')
.locator('div')
Expand All @@ -33,9 +32,12 @@ test.skip('01-the user should be able to publish an offline event', async ({
await page.getByRole('heading', { name: 'Date & time' }).isVisible();

await page.getByRole('button', { name: 'Event settings' }).click();
await page.getByLabel('Venue Selector').selectOption('offline event');

await page.getByRole('button', { name: 'Event settings' }).click();
await page.getByRole('button', { name: 'Event settings' }).click();

await page
.getByLabel('Venue Selector')
.selectOption('73:test-offline-event');

await page.getByRole('button', { name: 'Publish', exact: true }).click();
await page
Expand All @@ -45,11 +47,11 @@ test.skip('01-the user should be able to publish an offline event', async ({

await page
.getByText(`${eventTitle} is now live.`)
.isVisible({ timeout: 60000 }); //verified the event is live.
.isVisible({ timeout: 60000 }); // verified the event is live.
await page
.locator('.post-publish-panel__postpublish-buttons')
.filter({ hasText: 'View Event' })
.isVisible(); //verify the view event button.
.isVisible({ timeout: 30000 }); // verified the view event button.
});

test('02-verify the non-logged in user view RSVP button on home page and perform RSVP action', async ({
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/admin-tests/gatherpress-event-venue-map.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ test.describe('e2e test for event, the user should view the event map on event p
.getByRole('link', { name: 'Add New Event' })
.click();


Check failure on line 32 in test/e2e/admin-tests/gatherpress-event-venue-map.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎`
await page.getByLabel('Add title').fill(postName);

await page
.getByLabel('Block: Event Date')
.locator('div')
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/admin-tests/gatherpress-event.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test.describe('e2e test for publish event through admin side', () => {
test('the user should be able to publish an online event', async ({
page,
}) => {
await login({ page, username: 'prashantbellad' });
await page.getByRole('link', { name: 'Events', exact: true }).click();
await page
.locator('#wpbody-content')
Expand Down Expand Up @@ -66,6 +67,7 @@ test.describe('e2e test for publish event through admin side', () => {
test.skip('the user should be able publish an offline event', async ({
page,
}) => {
await login({ page, username: 'prashantbellad' });
await page.getByRole('link', { name: 'Events', exact: true }).click();
await page
.locator('#wpbody-content')
Expand All @@ -87,9 +89,8 @@ test.describe('e2e test for publish event through admin side', () => {
await page.getByRole('button', { name: 'Event settings' }).click();
await page
.getByLabel('Venue Selector')
.selectOption('offline event', { timeout: 60000 });
.selectOption('73:test-offline-event');

await page.getByRole('button', { name: 'Event settings' }).click();
await page
.getByRole('button', { name: 'Publish', exact: true })
.click();
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/admin-tests/gatherpress-venue-map-toggle-ON.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test.describe('e2e test for venue map through admin side', () => {
await page.getByRole('link', { name: 'Venues' }).click();
await page.getByRole('link', { name: 'Add New Venue' }).click();


Check failure on line 21 in test/e2e/admin-tests/gatherpress-venue-map-toggle-ON.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎`
await page.getByLabel('Add title').fill(postName);

await page
Expand All @@ -29,6 +30,7 @@ test.describe('e2e test for venue map through admin side', () => {

await page.getByLabel('Settings', { exact: true }).click();

Check failure on line 31 in test/e2e/admin-tests/gatherpress-venue-map-toggle-ON.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎`


await page.getByRole('button', { name: 'Venue settings' }).click();

await page.getByLabel('Full Address').fill('hinjewadi, pune, India');
Expand Down Expand Up @@ -67,6 +69,8 @@ test.describe('e2e test for venue map through admin side', () => {
page.locator('.wp-block-template-part'),
page.locator('.wp-block-gatherpress-event-date'),
],

Check failure on line 71 in test/e2e/admin-tests/gatherpress-venue-map-toggle-ON.spec.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Delete `⏎⏎↹↹↹`


});
});
});

0 comments on commit a311e8e

Please sign in to comment.