mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Added the Playwright test: Sign up for paid plan via portal - single tier
This commit is contained in:
parent
c78a04f54c
commit
991b60a342
31
ghost/core/test/e2e-browser/portal/tiers.spec.js
Normal file
31
ghost/core/test/e2e-browser/portal/tiers.spec.js
Normal file
@ -0,0 +1,31 @@
|
||||
const {expect, test} = require('@playwright/test');
|
||||
const {deleteAllMembers, completeStripeSubscription} = require('../utils');
|
||||
|
||||
test.describe('Portal', () => {
|
||||
test.describe('Tiers', () => {
|
||||
test('Sign up for paid plan via portal - single tier', async ({page}) => {
|
||||
// make sure we have no members to start fresh
|
||||
page.goto('/ghost');
|
||||
await deleteAllMembers(page);
|
||||
|
||||
// go to website and open portal
|
||||
await page.goto('/');
|
||||
const portalTriggerButton = page.frameLocator('#ghost-portal-root iframe.gh-portal-triggerbtn-iframe').locator('div').nth(1);
|
||||
const portalFrame = page.frameLocator('#ghost-portal-root div iframe');
|
||||
await portalTriggerButton.click();
|
||||
|
||||
// fill out signup form and submit
|
||||
await portalFrame.locator('#input-name').fill('Testy McTesterson');
|
||||
await portalFrame.locator('#input-email').fill('testy@example.com');
|
||||
await portalFrame.locator('.gh-portal-btn-product .gh-portal-btn').nth(1).click();
|
||||
|
||||
// complete the stripe checkout flow
|
||||
await completeStripeSubscription(page);
|
||||
|
||||
// come back to the website, open portal and check member is logged in
|
||||
await page.waitForSelector('h1.site-title', {state: 'visible'});
|
||||
await portalTriggerButton.click();
|
||||
await expect(portalFrame.getByText('testy@example.com')).toBeVisible();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user