mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +03:00
cb38a2d997
refs: https://github.com/TryGhost/DevOps/issues/78 Instead of running a single instance of Ghost, we now run an instance of Ghost for each test worker. This has the unfortunate effect that a test failing will close and restart a new instance of Ghost, but in general will be multiple times faster than sequential execution of tests.
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
const {expect} = require('@playwright/test');
|
|
const test = require('../fixtures/ghost-test');
|
|
const {disconnectStripe, setupStripe, generateStripeIntegrationToken} = require('../utils');
|
|
|
|
test.describe('Membership Settings', () => {
|
|
test.describe('Portal settings', () => {
|
|
test('Shows free tier toggle when stripe is disconnected', async ({page}) => {
|
|
await page.goto('/ghost');
|
|
// Disconnect stripe
|
|
await disconnectStripe(page);
|
|
|
|
// Open Portal settings
|
|
await page.goto('/ghost');
|
|
await page.locator('.gh-nav a[href="#/settings/"]').click();
|
|
await page.getByTestId('portal').getByRole('button', {name: 'Customize'}).click();
|
|
|
|
const modal = page.getByTestId('portal-modal');
|
|
// Check free tier toggle is visible
|
|
await expect(modal.locator('label').filter({hasText: 'Free'}).first()).toBeVisible();
|
|
|
|
// Reconnect Stripe for other tests
|
|
const stripeToken = await generateStripeIntegrationToken();
|
|
await page.goto('/ghost');
|
|
await setupStripe(page, stripeToken);
|
|
});
|
|
});
|
|
});
|