Skip to content

Commit

Permalink
Fixed flaky publishing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmraible committed Sep 6, 2024
1 parent 18cc8dc commit 9befa60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ghost/core/test/e2e-browser/admin/publishing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ test.describe('Publishing', () => {
const date = DateTime.now();

await createPostDraft(adminPage, {title: 'Testing publish update', body: 'This is the initial published text.'});
const editorUrl = await adminPage.url();
await publishPost(adminPage);
const frontendPage = await openPublishedPostBookmark(adminPage);
await closePublishFlow(adminPage);
Expand All @@ -323,7 +324,7 @@ test.describe('Publishing', () => {
await expect(publishedHeader).toContainText(date.toFormat('LLL d, yyyy'));

// add some extra text to the post
await adminPage.locator('li[data-test-post-id]').first().click();
await adminPage.goto(editorUrl);
await adminPage.locator('[data-kg="editor"]').first().click();
await adminPage.waitForTimeout(500);
await adminPage.keyboard.type(' This is some updated text.');
Expand Down Expand Up @@ -455,6 +456,8 @@ test.describe('Publishing', () => {
await sharedPage.goto('/ghost');
await createPostDraft(sharedPage, postData);

const editorUrl = await sharedPage.url();

// Schedule far in the future
await publishPost(sharedPage, {date: '2050-01-01', time: '10:09'});
await closePublishFlow(sharedPage);
Expand All @@ -469,7 +472,7 @@ test.describe('Publishing', () => {
await checkPostNotPublished(testsharedPage, postData);

// Now unschedule this post
await sharedPage.locator('li[data-test-post-id]').first().click();
await sharedPage.goto(editorUrl);
await sharedPage.locator('[data-test-button="update-flow"]').first().click();
await sharedPage.locator('[data-test-button="revert-to-draft"]').click();

Expand Down

0 comments on commit 9befa60

Please sign in to comment.