Skip to content

Commit

Permalink
Reverted portal-settings test
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdwinden committed Dec 19, 2024
1 parent 7523ea8 commit 1b5d723
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions ghost/core/test/e2e-browser/admin/portal-settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,68 +19,68 @@ test.describe('Portal Settings', () => {
test('can open portal on default page', async ({sharedPage}) => {
const modal = await openPortalLinks(sharedPage);

// fetch portal default url from input
const portalUrl = await modal.getByLabel('Default:').inputValue();
await sharedPage.goto(portalUrl);

const portalFrame = sharedPage.locator('[data-testid="portal-popup-frame"]');

// Wait for frame to be attached and visible
// check portal popup is opened
await expect(portalFrame).toBeVisible();
});

test('can open portal on signin page', async ({sharedPage}) => {
const modal = await openPortalLinks(sharedPage);

// fetch portal signin url from input
const portalUrl = await modal.getByLabel('Sign in').inputValue();
await sharedPage.goto(portalUrl);

const portalFrame = sharedPage.locator('[data-testid="portal-popup-frame"]');

// Wait for frame to be attached and visible first
await expect(portalFrame).toBeVisible();

const portalFrameLocator = sharedPage.frameLocator('[data-testid="portal-popup-frame"]');

// Wait for the frame content to be loaded
await expect(portalFrameLocator.locator('.gh-portal-signin')).toBeVisible({timeout: 15000});
await expect(portalFrameLocator.getByRole('heading', {name: 'Sign in'})).toBeVisible({timeout: 15000});

// check portal popup is opened
await expect(portalFrame).toBeVisible();
// check signin page is opened in portal
await expect(portalFrameLocator.getByRole('heading', {name: 'Sign in'})).toBeVisible();
});

test('can open portal on signup page', async ({sharedPage}) => {
const modal = await openPortalLinks(sharedPage);

// fetch portal signup url from input
const portalUrl = await modal.getByLabel('Sign up').inputValue();
await sharedPage.goto(portalUrl);

const portalFrame = sharedPage.locator('[data-testid="portal-popup-frame"]');

// Wait for frame to be attached and visible first
await expect(portalFrame).toBeVisible();

const portalFrameLocator = sharedPage.frameLocator('[data-testid="portal-popup-frame"]');

// Wait for the frame content to be loaded
await expect(portalFrameLocator.locator('.gh-portal-signup')).toBeVisible({timeout: 15000});

// check portal popup is opened
await expect(portalFrame).toBeVisible();
// check signup page is opened in portal
await expect(portalFrameLocator.locator('.gh-portal-signup')).toBeVisible();
});

test('can open portal directly on monthly signup', async ({sharedPage}) => {
const modal = await openPortalLinks(sharedPage);

// fetch and go to portal directly monthly signup url
const portalUrl = await modal.getByLabel('Signup / Monthly').inputValue();
await sharedPage.goto(portalUrl);

// Wait longer for Stripe checkout to load
await sharedPage.waitForURL(/^https:\/\/checkout.stripe.com/, {timeout: 15000});
// expect stripe checkout to have opeened
await sharedPage.waitForURL(/^https:\/\/checkout.stripe.com/);
});

test('can open portal directly on yearly signup', async ({sharedPage}) => {
const modal = await openPortalLinks(sharedPage);

// fetch and go to portal directly yearly signup url
const portalUrl = await modal.getByLabel('Signup / Yearly').inputValue();
await sharedPage.goto(portalUrl);

// Wait longer for Stripe checkout to load
await sharedPage.waitForURL(/^https:\/\/checkout.stripe.com/, {timeout: 15000});
// expect stripe checkout to have opeened
await sharedPage.waitForURL(/^https:\/\/checkout.stripe.com/);
});
});
});

0 comments on commit 1b5d723

Please sign in to comment.