-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and improve E2E Test environment
- And rename all test components to use CM prefix instead of CrossModel - Improve CompositeEditor and related POs to ensure that saving, dirty state handling, closing etc. are properly delegated to the parent editor - Cleanup Add/Edit/Delete system diagram test - Add Page objects for froms/property views
- Loading branch information
Showing
17 changed files
with
615 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 CrossBreeze. | ||
********************************************************************************/ | ||
|
||
import { TheiaEditor, TheiaTextEditor, TheiaViewData } from '@theia/playwright'; | ||
import { CMCompositeEditor } from './cm-composite-editor'; | ||
|
||
export abstract class IntegratedEditor extends TheiaEditor { | ||
constructor( | ||
data: TheiaViewData, | ||
protected readonly parent: CMCompositeEditor | ||
) { | ||
super(data, parent.app); | ||
} | ||
|
||
override async activate(): Promise<void> { | ||
await this.parent.activate(); | ||
return super.activate(); | ||
} | ||
|
||
override close(waitForClosed?: boolean | undefined): Promise<void> { | ||
return this.parent.close(waitForClosed); | ||
} | ||
|
||
override closeWithoutSave(): Promise<void> { | ||
return this.parent.closeWithoutSave(); | ||
} | ||
|
||
override async focus(): Promise<void> { | ||
await this.parent.focus(); | ||
return super.focus(); | ||
} | ||
|
||
override async save(): Promise<void> { | ||
await this.parent.save(); | ||
} | ||
|
||
override async saveAndClose(): Promise<void> { | ||
await this.parent.saveAndClose(); | ||
} | ||
|
||
override async undo(times?: number | undefined): Promise<void> { | ||
await this.parent.undo(times); | ||
} | ||
|
||
override async redo(times?: number | undefined): Promise<void> { | ||
await this.parent.redo(times); | ||
} | ||
|
||
override async isDirty(): Promise<boolean> { | ||
return this.parent.isDirty(); | ||
} | ||
|
||
override async waitForVisible(): Promise<void> { | ||
await this.parent.waitForVisible(); | ||
return super.waitForVisible(); | ||
} | ||
|
||
override isClosable(): Promise<boolean> { | ||
return this.parent.isClosable(); | ||
} | ||
|
||
override title(): Promise<string | undefined> { | ||
return this.parent.title(); | ||
} | ||
} | ||
|
||
export abstract class IntegratedTextEditor extends TheiaTextEditor { | ||
constructor( | ||
filePath: string, | ||
protected readonly parent: CMCompositeEditor | ||
) { | ||
super(filePath, parent.app); | ||
} | ||
|
||
override async activate(): Promise<void> { | ||
await this.parent.activate(); | ||
return super.activate(); | ||
} | ||
|
||
override close(waitForClosed?: boolean | undefined): Promise<void> { | ||
return this.parent.close(waitForClosed); | ||
} | ||
|
||
override closeWithoutSave(): Promise<void> { | ||
return this.parent.closeWithoutSave(); | ||
} | ||
|
||
override async focus(): Promise<void> { | ||
await this.parent.focus(); | ||
return super.focus(); | ||
} | ||
|
||
override async save(): Promise<void> { | ||
await this.parent.save(); | ||
} | ||
|
||
override async saveAndClose(): Promise<void> { | ||
await this.parent.saveAndClose(); | ||
} | ||
|
||
override async undo(times?: number | undefined): Promise<void> { | ||
await this.parent.undo(times); | ||
} | ||
|
||
override async redo(times?: number | undefined): Promise<void> { | ||
await this.parent.redo(times); | ||
} | ||
|
||
override async isDirty(): Promise<boolean> { | ||
return this.parent.isDirty(); | ||
} | ||
|
||
override async waitForVisible(): Promise<void> { | ||
await this.parent.waitForVisible(); | ||
return super.waitForVisible(); | ||
} | ||
|
||
override isClosable(): Promise<boolean> { | ||
return this.parent.isClosable(); | ||
} | ||
|
||
override title(): Promise<string | undefined> { | ||
return this.parent.title(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.