Skip to content

Commit 6ee4e83

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 6ee4e83

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

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

+27-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,20 +56,26 @@ 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);
70+
await finishDiscard(t);
6471

6572
await assertThatWeAreOnPage(t, 'Home');
6673
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #1');
6774
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #2');
6875
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #3');
6976
});
7077

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 => {
78+
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 => {
7279
await prepareDocumentConflictBetweenAdminAndEditor(t);
7380
await startPublishAll(t);
7481
await assertThatConflictResolutionHasStarted(t);
@@ -80,7 +87,7 @@ test('Publish + Syncing: Create a conflict state between two editors, then try t
8087
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
8188
});
8289

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 => {
90+
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 => {
8491
await prepareDocumentConflictBetweenAdminAndEditor(t);
8592
await startPublishDocument(t);
8693
await assertThatConflictResolutionHasStarted(t);
@@ -92,6 +99,18 @@ test('Publish + Syncing: Create a conflict state between two editors, then try t
9299
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
93100
});
94101

102+
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 => {
103+
await prepareDocumentConflictBetweenAdminAndEditor(t);
104+
await startPublishAll(t);
105+
await assertThatConflictResolutionHasStarted(t);
106+
await chooseDiscardAllAsResolutionStrategy(t);
107+
await performResolutionStrategy(t);
108+
await finishDiscard(t);
109+
110+
await assertThatWeAreOnPage(t, 'Home');
111+
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
112+
});
113+
95114
async function prepareContentElementConflictBetweenAdminAndEditor(t) {
96115
await loginAsEditorOnceToInitializeAContentStreamForTheirWorkspaceIfNeeded(t);
97116

@@ -315,6 +334,11 @@ async function finishPublish(t) {
315334
await t.wait(2000);
316335
}
317336

337+
async function finishDiscard(t) {
338+
await t.click(Selector('#neos-DiscardDialog-Acknowledge'));
339+
await t.wait(2000);
340+
}
341+
318342
async function startSynchronization(t) {
319343
await t.click(Selector('#neos-workspace-rebase'));
320344
await t.click(Selector('#neos-SyncWorkspace-Confirm'));

0 commit comments

Comments
 (0)