Skip to content

Commit ee43458

Browse files
committed
TASK: Introduce tests for sync workflow edge-cases
- test for selecting 'Discard workspace "User workspace"' as resolution during publishing (previously froze) - test for navigating back after selecting 'Discard workspace "User workspace"' in sync mode and selecting another strategy
1 parent acc8a23 commit ee43458

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

Tests/IntegrationTests/Fixtures/1Dimension/syncing.e2e.js

+26-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test('Syncing: Create a conflict state between two editors and choose "Discard a
2121
await prepareContentElementConflictBetweenAdminAndEditor(t);
2222
await chooseDiscardAllAsResolutionStrategy(t);
2323
await performResolutionStrategy(t);
24+
await finishDiscard(t);
2425

2526
await assertThatWeAreOnPage(t, 'Home');
2627
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #1');
@@ -55,11 +56,16 @@ test('Syncing: Create a conflict state between two editors, start and cancel res
5556
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #3');
5657
});
5758

58-
test('Syncing: Create a conflict state between two editors and choose "Drop conflicting changes" as a resolution strategy, then cancel and choose "Discard all" as a resolution strategy during rebase', async t => {
59+
test('Syncing: Create a conflict state between two editors and switch between "Drop conflicting changes" and "Discard all" as a resolution strategy during rebase', async t => {
5960
await prepareContentElementConflictBetweenAdminAndEditor(t);
61+
62+
// switch back and forth
63+
await chooseDiscardAllAsResolutionStrategy(t);
64+
await cancelResolutionStrategy(t);
6065
await chooseDropConflictingChangesAsResolutionStrategy(t);
6166
await cancelResolutionStrategy(t);
6267
await chooseDiscardAllAsResolutionStrategy(t);
68+
6369
await performResolutionStrategy(t);
6470

6571
await assertThatWeAreOnPage(t, 'Home');
@@ -68,7 +74,7 @@ test('Syncing: Create a conflict state between two editors and choose "Drop conf
6874
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #3');
6975
});
7076

71-
test('Publish + Syncing: Create a conflict state between two editors, then try to publish and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
77+
test('Publish + Syncing: Create a conflict state between two editors, then try to publish the site and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
7278
await prepareDocumentConflictBetweenAdminAndEditor(t);
7379
await startPublishAll(t);
7480
await assertThatConflictResolutionHasStarted(t);
@@ -80,7 +86,7 @@ test('Publish + Syncing: Create a conflict state between two editors, then try t
8086
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
8187
});
8288

83-
test('Publish + Syncing: Create a conflict state between two editors, then try to publish the document only and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
89+
test('Publish + Syncing: Create a conflict state between two editors, then try to publish the document and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
8490
await prepareDocumentConflictBetweenAdminAndEditor(t);
8591
await startPublishDocument(t);
8692
await assertThatConflictResolutionHasStarted(t);
@@ -92,6 +98,18 @@ test('Publish + Syncing: Create a conflict state between two editors, then try t
9298
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
9399
});
94100

101+
test('Publish + Syncing: Create a conflict state between two editors, then try to publish the site and choose "Discard all" as a resolution strategy', async t => {
102+
await prepareDocumentConflictBetweenAdminAndEditor(t);
103+
await startPublishAll(t);
104+
await assertThatConflictResolutionHasStarted(t);
105+
await chooseDiscardAllAsResolutionStrategy(t);
106+
await performResolutionStrategy(t);
107+
await finishDiscard(t);
108+
109+
await assertThatWeAreOnPage(t, 'Home');
110+
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
111+
});
112+
95113
async function prepareContentElementConflictBetweenAdminAndEditor(t) {
96114
await loginAsEditorOnceToInitializeAContentStreamForTheirWorkspaceIfNeeded(t);
97115

@@ -315,6 +333,11 @@ async function finishPublish(t) {
315333
await t.wait(2000);
316334
}
317335

336+
async function finishDiscard(t) {
337+
await t.click(Selector('#neos-DiscardDialog-Acknowledge'));
338+
await t.wait(2000);
339+
}
340+
318341
async function startSynchronization(t) {
319342
await t.click(Selector('#neos-workspace-rebase'));
320343
await t.click(Selector('#neos-SyncWorkspace-Confirm'));

0 commit comments

Comments
 (0)