Skip to content

Commit

Permalink
savbe
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoLC committed Apr 17, 2024
1 parent 1ac5aa4 commit 5d03577
Showing 1 changed file with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ test.describe('Template Editor', () => {
page,
browserName,
}) => {
// eslint-disable-next-line playwright/no-skipped-test
// test.skip(
// browserName !== 'chromium',
// 'This test failed with safary because of the dragNdrop',
// );

const randomTemplate = await createTemplate(
page,
'template-editor',
Expand All @@ -40,7 +46,7 @@ test.describe('Template Editor', () => {

await expect(page.locator('h2').getByText(randomTemplate[0])).toBeVisible();

const iframe = page.frameLocator('iFrame.gjs-frame');
const iframe = page.frameLocator('.gjs-frame');

await page.getByTitle('Open Blocks').click();
await page
Expand All @@ -64,6 +70,12 @@ test.describe('Template Editor', () => {
page,
browserName,
}) => {
// eslint-disable-next-line playwright/no-skipped-test
// test.skip(
// browserName !== 'chromium',
// 'This test failed with safary because of the dragNdrop',
// );

const randomTemplate = await createTemplate(
page,
'template-html',
Expand All @@ -73,15 +85,15 @@ test.describe('Template Editor', () => {

await expect(page.locator('h2').getByText(randomTemplate[0])).toBeVisible();

const iframe = page.frameLocator('iFrame.gjs-frame');
const iframe = page.frameLocator('.gjs-frame');

await page.getByTitle('Open Blocks').click();
await page
.locator('.gjs-editor .gjs-block[title="Text"]')
.dragTo(iframe.locator('body.gjs-dashed'));
.dragTo(iframe.locator('body.gjs-dashed div').first());

await iframe.getByText('Insert your text here').fill('Hello World');
await iframe.locator('body.gjs-dashed').click();
await iframe.locator('body.gjs-dashed div').first().click();

await page.getByText('Save template').click();
await expect(page.getByText('Template save successfully')).toBeVisible();
Expand All @@ -91,6 +103,12 @@ test.describe('Template Editor', () => {
page,
browserName,
}) => {
// // eslint-disable-next-line playwright/no-skipped-test
// test.skip(
// browserName !== 'chromium',
// 'This test failed with safary because of the dragNdrop',
// );

const randomTemplate = await createTemplate(
page,
'template-html',
Expand All @@ -104,15 +122,15 @@ test.describe('Template Editor', () => {
page.getByText('The {{body}} tag is neccessary to works with the pads.'),
).toBeVisible();

const iframe = page.frameLocator('iFrame.gjs-frame');
const iframe = page.frameLocator('.gjs-frame');

await page.getByTitle('Open Blocks').click();
await page
.locator('.gjs-editor .gjs-block[title="Text"]')
.dragTo(iframe.locator('body.gjs-dashed'));
.dragTo(iframe.locator('body.gjs-dashed div').first());

await iframe.getByText('Insert your text here').fill('{{body}}');
await iframe.locator('body.gjs-dashed').click();
await iframe.locator('body.gjs-dashed div').first().click();

await expect(
page.getByText('The {{body}} tag is neccessary to works with the pads.'),
Expand Down

0 comments on commit 5d03577

Please sign in to comment.