Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ghost/core/test/e2e-browser/admin/private-site.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ test.describe('Site Settings', () => {

// check the site is protected by a password
await frontendPage.goto('/');
await expect(frontendPage.getByRole('button', {name: 'Access site →'})).toBeVisible();
await expect(frontendPage).toHaveURL(/\/private\/\?r=%2F/);
await expect(frontendPage.getByRole('link', {name: 'Enter access code'})).toBeVisible();

await frontendPage.getByRole('link', {name: 'Enter access code'}).click();
await expect(frontendPage.getByRole('dialog', {name: 'Enter access code'})).toBeVisible();
await expect(frontendPage.getByRole('button', {name: /Enter/})).toBeVisible();

// @NOTE: site access doesn't not work because Playwright ignores cookies set
// during the redirect response. Possibly related to https://github.com/microsoft/playwright/issues/5236
// assert /private/?r=%2F
// assert should not see the site front page
// await frontendPage.getByPlaceholder('Password').fill(sitePassword);
// await frontendPage.getByRole('button', {name: 'Access site →'}).click();
// await frontendPage.getByRole('button', {name: /Enter/}).click();
// await frontendPage.waitForSelector('.site-title');
// await expect(frontendPage.locator('.site-title')).toHaveText('The Local Test');

Expand Down
Loading