mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Added extra assertions to Offers tests (#15956)
refs. https://github.com/TryGhost/Team/issues/2371 - two extra assertion was needed for discount and free-trials to check if the offers are listed in ‘Active’ offers and the URLs load portal
This commit is contained in:
parent
ffd07ea744
commit
527d718b76
@ -20,11 +20,14 @@ test.describe('Portal', () => {
|
|||||||
amount: 14
|
amount: 14
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await expect(page.getByRole('link', {name: offerName}), 'Should have free-trial offer').toBeVisible();
|
||||||
|
|
||||||
await page.locator('.gh-offers-list .gh-list-row').filter({hasText: offerName}).click();
|
await page.locator('.gh-offers-list .gh-list-row').filter({hasText: offerName}).click();
|
||||||
const portalUrl = await page.locator('input#url').inputValue();
|
const portalUrl = await page.locator('input#url').inputValue();
|
||||||
|
|
||||||
await page.goto(portalUrl);
|
await page.goto(portalUrl);
|
||||||
const portalFrame = page.frameLocator('#ghost-portal-root div iframe');
|
const portalFrame = page.frameLocator('#ghost-portal-root div iframe');
|
||||||
|
await expect(portalFrame.locator('.gh-portal-offer-title'), 'URL should open Portal with free-trial offer').toBeVisible();
|
||||||
await portalFrame.locator('#input-name').fill('Testy McTesterson');
|
await portalFrame.locator('#input-name').fill('Testy McTesterson');
|
||||||
await portalFrame.locator('#input-email').fill('testy@example.com');
|
await portalFrame.locator('#input-email').fill('testy@example.com');
|
||||||
await portalFrame.getByRole('button', {name: 'Start 14-day free trial'}).click();
|
await portalFrame.getByRole('button', {name: 'Start 14-day free trial'}).click();
|
||||||
@ -61,11 +64,14 @@ test.describe('Portal', () => {
|
|||||||
amount: 10
|
amount: 10
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await expect(page.getByRole('link', {name: offerName}), 'Should have discount offer').toBeVisible();
|
||||||
|
|
||||||
await page.locator('.gh-offers-list .gh-list-row').filter({hasText: offerName}).click();
|
await page.locator('.gh-offers-list .gh-list-row').filter({hasText: offerName}).click();
|
||||||
const portalUrl = await page.locator('input#url').inputValue();
|
const portalUrl = await page.locator('input#url').inputValue();
|
||||||
|
|
||||||
await page.goto(portalUrl);
|
await page.goto(portalUrl);
|
||||||
const portalFrame = page.frameLocator('#ghost-portal-root div iframe');
|
const portalFrame = page.frameLocator('#ghost-portal-root div iframe');
|
||||||
|
await expect(portalFrame.locator('.gh-portal-offer-title'), 'URL should open Portal with discount offer').toBeVisible();
|
||||||
await portalFrame.locator('#input-name').fill('Testy McTesterson');
|
await portalFrame.locator('#input-name').fill('Testy McTesterson');
|
||||||
await portalFrame.locator('#input-email').fill('testy@example.com');
|
await portalFrame.locator('#input-email').fill('testy@example.com');
|
||||||
await portalFrame.getByRole('button', {name: 'Continue'}).click();
|
await portalFrame.getByRole('button', {name: 'Continue'}).click();
|
||||||
|
Loading…
Reference in New Issue
Block a user