mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Further attempt to fix update-published-post test in CI (#15964)
refs https://github.com/TryGhost/Team/issues/2371 - bumped timeout between saving and refreshing to account for slower speeds in CI - increased specificity for the frontend text comparisons so the output when failing is smaller and easier to parse
This commit is contained in:
parent
991b60a342
commit
df72182e2d
@ -177,11 +177,13 @@ test.describe('Publishing', () => {
|
|||||||
|
|
||||||
await createPost(adminPage, {title: 'Testing publish update', body: 'This is the initial published text.'});
|
await createPost(adminPage, {title: 'Testing publish update', body: 'This is the initial published text.'});
|
||||||
const frontendPage = await publishPost(adminPage);
|
const frontendPage = await publishPost(adminPage);
|
||||||
const frontendBody = frontendPage.getByRole('main');
|
await frontendPage.pause();
|
||||||
|
const frontendBody = frontendPage.locator('main > article > section > p');
|
||||||
|
const frontendHeader = frontendPage.locator('main > article > header');
|
||||||
|
|
||||||
// check front-end post has the initial body text
|
// check front-end post has the initial body text
|
||||||
await expect(frontendBody).toContainText('This is the initial published text.');
|
await expect(frontendBody).toContainText('This is the initial published text.');
|
||||||
await expect(frontendBody).toContainText(date.toFormat('LLL d, yyyy'));
|
await expect(frontendHeader).toContainText(date.toFormat('LLL d, yyyy'));
|
||||||
|
|
||||||
// add some extra text to the post
|
// add some extra text to the post
|
||||||
await adminPage.locator('[data-kg="editor"]').click();
|
await adminPage.locator('[data-kg="editor"]').click();
|
||||||
@ -197,10 +199,10 @@ test.describe('Publishing', () => {
|
|||||||
await adminPage.locator('[data-test-button="publish-save"]').click();
|
await adminPage.locator('[data-test-button="publish-save"]').click();
|
||||||
|
|
||||||
// check front-end has new text after reloading
|
// check front-end has new text after reloading
|
||||||
await frontendPage.waitForTimeout(100); // let save go through
|
await frontendPage.waitForTimeout(300); // let save go through
|
||||||
await frontendPage.reload();
|
await frontendPage.reload();
|
||||||
await expect(frontendBody).toContainText('This is some updated text.');
|
await expect(frontendBody).toContainText('This is some updated text.');
|
||||||
await expect(frontendBody).toContainText('Jan 7, 2022');
|
await expect(frontendHeader).toContainText('Jan 7, 2022');
|
||||||
const metaDescription = frontendPage.locator('meta[name="description"]');
|
const metaDescription = frontendPage.locator('meta[name="description"]');
|
||||||
await expect(metaDescription).toHaveAttribute('content', 'Short description and meta');
|
await expect(metaDescription).toHaveAttribute('content', 'Short description and meta');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user