Files
mygit/e2e/tests/admin/signin.test.ts
T
DuckQ1u 93d1b7c3d3
Copilot Setup Steps / copilot-setup-steps (push) Has been cancelled
first commit
2026-04-22 19:51:20 +07:00

39 lines
1.3 KiB
TypeScript

import {LoginPage, PostsPage, TagsPage} from '@/admin-pages';
import {Page} from '@playwright/test';
import {expect, test} from '@/helpers/playwright';
test.describe('Ghost Admin - Signin Redirect', () => {
async function logout(page: Page) {
const loginPage = new LoginPage(page);
await loginPage.logout();
}
test('deep-linking to a React route while logged out redirects back after signin', async ({page, ghostAccountOwner}) => {
await logout(page);
const tagsPage = new TagsPage(page);
await tagsPage.goto();
const loginPage = new LoginPage(page);
await expect(loginPage.signInButton).toBeVisible();
await loginPage.signIn(ghostAccountOwner.email, ghostAccountOwner.password);
await tagsPage.waitForPageToFullyLoad();
});
test('deep-linking to an Ember route while logged out redirects back after signin', async ({page, ghostAccountOwner}) => {
await logout(page);
const postsPage = new PostsPage(page);
await postsPage.goto();
const loginPage = new LoginPage(page);
await expect(loginPage.signInButton).toBeVisible();
await loginPage.signIn(ghostAccountOwner.email, ghostAccountOwner.password);
await postsPage.waitForPageToFullyLoad();
});
});